Whenever i try to run npm run production and npm run watch in pacakages/webkul/admin, packages/webkul/ui and packages/webkul/shop, The following error occurs.How to solve it
Undefined variable $__env (View: /var/www/html/public) (View: /var/www/html/resources/themes/velocity/views/home/index.blade.php)
Event checkout.cart.add.after should return product not whole cart?
profner last edited by
When listening to the checkout.cart.add events being dispatched in Cart.php addProduct() function, the before event dispatches with the $product object, but the after event dispatches with the entire $cart object.
Does it not make sense to dispatch the event with $parentCartItem since the function is more relating to a single product being added rather than the whole cart?
If one needs to listen for the whole cart, the event checkout.cart.collect.totals.after dispatched in collectTotals() seems more appropriate.
In Webkul\Checkout\src\Cart.php ~Line 186:
--Event::dispatch('checkout.cart.add.after', $cart); ++Event::dispatch('checkout.cart.add.after', $parentCartItem );