Skip to content

Magento 2 show/hide add to cart button based on section data

I need to show/hide the add-to-cart button based on some custom values. These values are stored in a product attribute. The values are updated at the time of order creation.

I am using sections.xml for this to overcome the cache issue. But I am facing issues while getting the product id in the source map php file.

I am referred the below link to do this.
https://aureatelabs.com/magento-2/how-to-use-private-content-or-sections-in-magento-2/