Skip to content

Magento 2:How can I fetch and log the product information on the product page when the user customises the product (e.g: changes the size, color, etc)

Right now in my template phtml file I am using this code to fetch the data and log it:

console.log("Product Information: ", <?=json_encode($block->getProduct())?>);

But I am unable to fetch information when the user customises the product by changing the size or color of the product, I need that information that time as well.