Liferay商务: Is there any event is thrown when Product Quantity Change on Mini Cart?

标签 liferay product-quantity minicart liferay-commerce

我正在使用 Liferay DXP 7.3 和 Commerce 3.0。 (GA1)

将产品添加到购物车后,我更改了产品数量,并且我想收听此事件。

在这种情况下是否会引发任何事件? 我怎样才能听到它?

[mini-cart-image]

最佳答案

组件通过使用此 useEffect 来刷新自身。

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

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

其中CURRENT_ORDER_UPDATED === 'current-order-updated'

尝试像下面这样的方法来更好地调查

Liferay.on('current-order-updated', console.log)

关于Liferay商务: Is there any event is thrown when Product Quantity Change on Mini Cart?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68016524/

相关文章:

tomcat - 在 8080 端口打开 Tomcat 页面时出错

php - 添加到购物车并重定向到 WooCommerce 中可变产品的结帐

php - 即使在 Woocommerce 中使用 ajax 添加到购物车时也可以设置最小输入数量

php - Woocommerce 中特定产品的购物车批量折扣

javascript - Minicart.js - 商品已添加到购物车,但购物车未显示

css - SASS 无效的 CSS

web-services - 使用 Liferay 使用 Web 服务

java - Liferay 6.2 上 Spring MVC 表单中的 Portlet 命名空间