cart bug fixes and small css fix

This commit is contained in:
prashant-webkul 2018-11-30 13:10:41 +05:30
parent ac18050967
commit 36f6783db8
4 changed files with 19 additions and 7 deletions

View File

@ -111,7 +111,7 @@ class AttributeDataGrid
'name' => 'value_per_locale',
'alias' => 'attributeValuePerLocale',
'type' => 'string',
'label' => 'ValuePerLocale',
'label' => 'Locale based',
'sortable' => true,
'wrapper' => function ($value) {
if($value == 0)
@ -123,7 +123,7 @@ class AttributeDataGrid
'name' => 'value_per_channel',
'alias' => 'attributeValuePerChannel',
'type' => 'string',
'label' => 'ValuePerChannel',
'label' => 'Channel based',
'sortable' => true,
'wrapper' => function ($value) {
if($value == 0)

View File

@ -696,11 +696,15 @@ class Cart {
*/
public function collectTotals()
{
$validated = $this->validateItems();
if(!$validated) {
return false;
}
if(!$cart = $this->getCart())
return false;
$this->validateItems();
$this->calculateItemsTax();
$cart->grand_total = $cart->base_grand_total = 0;
@ -745,11 +749,15 @@ class Cart {
{
$cart = $this->getCart();
if(!$cart) {
return false;
}
//rare case of accident-->used when there are no items.
if(count($cart->items) == 0) {
$this->cart->delete($cart->id);
return redirect()->route('shop.home.index');
return false;
} else {
$items = $cart->items;
@ -1082,6 +1090,10 @@ class Cart {
return $result;
} else {
$data['product'] = $id;
$data['is_configurable'] = false;
$data['quantity'] = 1;
$result = $this->add($id, $data);
return $result;

View File

@ -91,7 +91,7 @@ class CartController extends Controller
if($result) {
session()->flash('success', trans('shop::app.checkout.cart.item.success'));
} else {
session()->flash('success', trans('shop::app.checkout.cart.item.error-add'));
session()->flash('warning', trans('shop::app.checkout.cart.item.error-add'));
}
Cart::collectTotals();

View File

@ -911,7 +911,7 @@ section.slider-block {
}
.dropdown-content .item-details{
height: 75px;
max-height: 125px;
}
.item-details .item-name {