Skip to content

Magento 2: Get product quantity “ajax:addToCart” event

I am trying to capture the add to cart event in magento as mentioned here:
Magento 2: Proper way to utilize “ajax:addToCart” event

$(document).on('ajax:addToCart', function (event, data) {
    console.log(event);
    console.log(data);
});

I was wondering if there is any way to understand how many of the particular item we added to the cart when clicking on the add to cart button.