2

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

After add product to Cart, I change product quantity and I would like to listen this event.

Is there any event is thrown in this case? How can I listen to it?

[mini-cart-image]

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
Dinh Thai
  • 51
  • 3

1 Answers1

2

The component refreshes itself by using this useEffect.

    useEffect(() => {
        Liferay.on(CURRENT_ORDER_UPDATED, updateCartModel);

        return () => {
            Liferay.detach(CURRENT_ORDER_UPDATED, updateCartModel);
        };
    }, [updateCartModel]);

Where CURRENT_ORDER_UPDATED === 'current-order-updated'

Try something like the one below to better investigate

Liferay.on('current-order-updated', console.log)
  • Hi @Fabio, thank you for your answer. With LR DXP 7.3 and Commerce 3.0 (GA1). I can not find 'current-order-update', only available CHANGE_ORDER = 'orderSelected', but this event is not throw in this case – Dinh Thai Jun 17 '21 at 14:58