0

I need to hide the add to cart button so currently, I have a plugin aroundIsSalable which sets the return to false if you are logged out.

The issue with this is that it also hides the options for a configurable product. How can I get it set saleable to false but also show the configurable options

1
  • If you managed to solve this, can you share the solution ?
    – adi
    May 10, 2020 at 12:16

1 Answer 1

0

Don't use Plugin. Override addtocart.phtm template and hide/show button using custom module helper in addtocart.phtml.

catalog_product_view.xml

<referenceBlock name="product.info.addtocart">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">NAMESAPCE_MODUEL::catalog/product/view/addtocart.phtml</argument>
        </action>
</referenceBlock>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.