Issue #2724 fixed
This commit is contained in:
parent
6d5cc8a456
commit
2334cf4cc7
|
|
@ -163,19 +163,19 @@ class Booking extends Virtual
|
|||
return trans('shop::app.checkout.cart.integrity.missing_options');
|
||||
}
|
||||
|
||||
$filtered = Arr::where($data['booking']['qty'], function ($qty, $key) {
|
||||
return $qty != 0;
|
||||
});
|
||||
|
||||
if (! count($filtered)) {
|
||||
return trans('shop::app.checkout.cart.integrity.missing_options');
|
||||
}
|
||||
|
||||
$products = [];
|
||||
|
||||
$bookingProduct = $this->getBookingProduct($data['product_id']);
|
||||
|
||||
if ($bookingProduct->type == 'event') {
|
||||
$filtered = Arr::where($data['booking']['qty'], function ($qty, $key) {
|
||||
return $qty != 0;
|
||||
});
|
||||
|
||||
if (! count($filtered)) {
|
||||
return trans('shop::app.checkout.cart.integrity.missing_options');
|
||||
}
|
||||
|
||||
foreach ($data['booking']['qty'] as $ticketId => $qty) {
|
||||
if (! $qty) {
|
||||
continue;
|
||||
|
|
@ -223,7 +223,7 @@ class Booking extends Virtual
|
|||
}
|
||||
|
||||
if (isset($options1['booking']) && isset($options2['booking'])) {
|
||||
return $options1['booking'] === $options2['booking'];
|
||||
return $options1['booking'] == $options2['booking'];
|
||||
} elseif (! isset($options1['booking'])) {
|
||||
return false;
|
||||
} elseif (! isset($options2['booking'])) {
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class CartController extends Controller
|
|||
*/
|
||||
public function add($id)
|
||||
{
|
||||
try {
|
||||
// try {
|
||||
$result = Cart::addProduct($id, request()->all());
|
||||
|
||||
if ($this->onWarningAddingToCart($result)) {
|
||||
|
|
@ -87,13 +87,13 @@ class CartController extends Controller
|
|||
return redirect()->route('shop.checkout.onepage.index');
|
||||
}
|
||||
}
|
||||
} catch(\Exception $e) {
|
||||
session()->flash('error', trans($e->getMessage()));
|
||||
// } catch(\Exception $e) {
|
||||
// session()->flash('error', trans($e->getMessage()));
|
||||
|
||||
$product = $this->productRepository->find($id);
|
||||
// $product = $this->productRepository->find($id);
|
||||
|
||||
return redirect()->route('shop.productOrCategory.index', $product->url_key);
|
||||
}
|
||||
// return redirect()->route('shop.productOrCategory.index', $product->url_key);
|
||||
// }
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue