Issue fixed (If configurable product added to cart without options)
This commit is contained in:
parent
687d28a9d0
commit
d2f620bb9f
|
|
@ -241,7 +241,7 @@ class Cart {
|
|||
$product = $this->product->findOneByField('id', $id);
|
||||
|
||||
if ($product->type == 'configurable') {
|
||||
if (! isset($data['selected_configurable_option'])) {
|
||||
if (! isset($data['selected_configurable_option']) || ! $data['selected_configurable_option']) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,13 +97,17 @@ class CartController extends Controller
|
|||
|
||||
Event::fire('checkout.cart.add.after', $result);
|
||||
|
||||
Cart::collectTotals();
|
||||
|
||||
if ($result) {
|
||||
session()->flash('success', trans('shop::app.checkout.cart.item.success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
} else {
|
||||
session()->flash('warning', trans('shop::app.checkout.cart.item.error-add'));
|
||||
}
|
||||
|
||||
Cart::collectTotals();
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue