Any help would be greatly appreciated.

  • 1
    You can set the product stock status to 'Out of Stock' Nov 16 '21 at 13:09
  • you want to hide from product page only or what? Nov 17 '21 at 6:07
  • 1
    Yes Dhiren you got it right Nov 17 '21 at 7:16

In Your custom module you can create view/frontend/layout/default.xml with the below content.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/framework/Module/etc/module.xsd">
    <css src="css/custom.css" />

Create a file in view/frontend/web/css/custom.css


Note that this will hide add to cart button from the listing as well as the product view page.


Free module ProductAvailable hides the 'add to cart' button from your site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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