Skip to content
ZenoCloud
Applications

How to Hide Add to Cart Button in Magento 2?

Learn how to hide the add to cart button in Magento 2 for specific products or conditions.

How to Hide Add to Cart Button in Magento 2?

Sometimes you may want to hide the add to cart button for certain products in your Magento store.

Why Hide Add to Cart Button?

Common reasons include:

  • Out of stock products
  • Pre-order items not yet available
  • Products with special purchase conditions
  • Demo or showcase products
  • Products requiring customer inquiry

How to Hide Add to Cart Button

There are several methods:

Method 1: Product-level Setting

  • Edit the product in admin
  • Navigate to Product Details
  • Set stock to 0 (this hides add to cart for out of stock items)
  • Save the product

Method 2: Using Extensions

Use third-party extensions that provide UI controls for hiding add to cart buttons based on conditions.

Method 3: Custom Code

Modify theme templates to conditionally hide the add to cart button based on product attributes.

Wrap Up

Hiding the add to cart button helps control product availability and improve the customer experience.

Next step

Apply the lesson to a real environment.

Browse all field notes
Quote request

What should we quote?

Describe the configuration or problem, location and timing.

Add company or phone
Replies go to your work email. Add a phone number only if you want a call.