ryanmitchell
Dear Ryan,
Thank you very much for the great hint.
and i have created custom extension to validate $cartItem->qty.
in boot() method
Event::listen('cart.adding', function($cartItem){
$cartItem = Cart::content()->each(function($cartItem) {
if ($menuItem = Menus_model::find($cartItem->id)) {
if($cartItem->qty >= $menuItem->stock_qty)
throw new ApplicationException(sprintf(
lang('igniter.cart::default.alert_low_on_stock'),
$menuItem->menu_name,
$menuItem->stock_qty
));
}
});
return [$cartItem];
But having issue, once the exception throw, the same continued on whole cart items, this is not allowing to add any items, till remove or update quantity in cart
Screen Cast Video
Please help me to fix this issue.
Thank you.