I am working on a shopping cart application, it is working but when I emit the event from single-product-page it does not work
Emit event not working
Your listener is trying to run an ‘updateQuantity’ function but the function is called ‘add’.
Try this:
protected $listeners = ['add'];
You’re emitting on click to an ‘addToCart’ event, and in component listener must be the same…you have just ‘add’.
The “add” method is on Single Product and on S hop livewire component and “add” listener is only in cart.php different livewire component