2

Any help would be greatly appreciated.

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

2 Answers 2

1

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">
  <head>
    <css src="css/custom.css" />
  </head>
</page>

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

button.tocart{display:none;}

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

1

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 and acknowledge you have read our privacy policy.

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