Liferay Commerce Mini Cart Remove All Items event listener is not working

Viewed 109

I am working with Liferay DXP 7.3 and Commerce 3.0. (GA1)

I would like to listen event Remove All Items on Mini Cart, but the event is not triggered. This is my code:

Liferay.on('productRemovedFromCart', getCartTotal);

Does any one know how can I listen to this event?

mini-cart image

1 Answers

Try 'product-removed-from-cart'. The payload will include the removed product sku.

Here's the code which fires the event:

Liferay.fire(PRODUCT_REMOVED_FROM_CART, {
    skuId: 111111,
});

Just use a dash cases rather than camel cases ;)

Related