6 replies [Last post]
shisamud's picture
Offline
Joined: 08/30/2010
Juice: 6
Was this information Helpful?

Hi,

In the initial release of our site, we just want users to be able to add items to a Wishlist (and email the Wishlist) but not be able to add items to the Shopping Cart or checkout items. We have installed the Wishlist module in addition to the standard Ubercart modules. When we display the product catalog page both "Add to Cart" and "Add to Wishlist" buttons are displayed. Is there any way to hide just the "Add to Cart" button and not the other?

I have read through the support Forums. I have tried the "Disable Product" and "Members Only" modules without any luck. Any help will be appreciated.

scottm316's picture
Offline
Joined: 06/09/2010
Juice: 50
Re: Hide Add to Cart button

You might need to make your own 10-20 line module to do that. The one I made disables the add-to-cart button, so you can still kinda see it and can get familiar with where it's going to be. Then when you're ready to sell just disable the module. The module determines if the node is a product and has a add-to-cart form on it. If it does, utilize the disabled key in the add-to-cart form {
$form['submit']['#attributes']['disabled']="disabled";
// unset() or change other stuff here
}

scottm316's picture
Offline
Joined: 06/09/2010
Juice: 50
Re: Hide Add to Cart button

You might need to make your own 10-20 line module to do that. The one I made disables the add-to-cart button, so you can still kinda see it and can get familiar with where it's going to be. Then when you're ready to sell just disable the module. The module determines if the node is a product and has a add-to-cart form on it. If it does, utilize the disabled key in the add-to-cart form {

  $form['submit']['#attributes']['disabled']="disabled";
  // unset() or change other stuff here

}

shisamud's picture
Offline
Joined: 08/30/2010
Juice: 6
Re: Hide Add to Cart button

Unfortunately, building a module is beyond my level of expertise at the moment. I was hoping that I could alter an existing CSS file or Template file to achieve this. I added the following lines to uc_catalog.css file but it hid both the Add to Cart and Add to Wishlist buttons. Any other ideas?

.add-to-cart .button-wrapper {
display:none;
}

scottm316's picture
Offline
Joined: 06/09/2010
Juice: 50
Re: Re: Hide Add to Cart button

Oh. Good thats easy. Split the css classes up and make one display:none and one not. Change this

.add-to-cart .button-wrapper {
display:none;
}

to this:

.add-to-cart {
display:none;
}
.button-wrapper {
//whatever was here in the first place...
}
djlucky69's picture
Offline
Joined: 02/21/2012
Juice: 3
hidding add to card button for certain products

hi I want to hide add to card button for certain products, I'm thinking in move to drupal 7 my website http://www.funhelps.com. But if i want to disable this button i think it is only possible with wildcards, is that possible? There is another easier option, or could you give me an example? Thanks for your product and congratulations for your work!!!

make-online-shop's picture
Offline
Joined: 01/01/2011
Juice: 504
How to hide the ADD TO CART button ?

Hello,

Is there a module or any other easier way to hide the ADD TO CART button now ?

Thanks a lot.