Formal request to enable granular control to hide the add to cart button & quantity.

On more than one occasion, I have run into situations when I need to hide the add to cart button on a single product, a group of products or all products on the site. Currently, the most "elegant" method to hide the button is to add a hook_form_alter function in the template.php file which can hide it globally or per product. For new users and those of us who don't program, this is not an elegant solution.

As an example, I just had a customer ask me to remove the ability for people to purchase from his website because he wants to direct customers to a distributor who sells online. I created the site with the intentions of using it as a shopping cart, now it will just be for product display. I have no reason to yank out the shopping cart because he may want to re-enable it down the road. While the template.php method does work, it isn't ideal. I've had other situations when a product is out of stock and I need to keep customers from ordering a particular product until the product is re-stocked (not utilizing the stock modules. Handling it manually because everything is drop shipped and I have no idea what the suppliers quantities are).

Some have suggested to hide or remove the product reference except this hides any attribute dropdowns as well which isn't intuitive to the given product(s). I still need customers to be able to shop, just not buy. Others have suggested to hide it with CSS which I have tried in the past and have found to be a bad idea because people still find a way to find the button...

There is a need for this feature:
https://drupalcommerce.org/discussions/2528/how-do-you-remove-add-cart-b...

https://drupalcommerce.org/questions/20019/need-remove-add-cart-button-a...

I think ideally, there needs to be a per node option, a per product option and a global site option. The problem, is keeping track of what has been disabled and where.

I've requested a similar feature in the past over on Ubercart and it's been shot down with the best solution to "configure it in the template.php file".

So, is this something that can be integrated into the current product reference and globally for the site?

Sorry if this is a duplicate. I didn't manage to find any other issues for this request.

Comments

ecvandenberg’s picture

Does it help if I state that I agree with Philsward?

I try to find a way to hide the add-to-cart button for specific products and specific user roles. Even with rules I can't find a way to do this. Although this issue node/1909098 says it should be possible, I did not succeed.

I tried another solution stated in https://drupalcommerce.org/discussions/2528/how-do-you-remove-add-cart-button. But that module hides the button permanently.