Hi All,

I am using ubercart 7.x-3.6 module with drupal 7.26. I m making a website that is similar function with this website http://www.sigmaphoto.com/product/70-300mm-f4-56-dg-macro. and i tried to use ubercart attribute to make this work, but all of the attributes are linking to the "add to cart button" even though the price is 0.

how can we have the "add to cart" button dynamically. if product is not for sale, we take customer to a find a dealer link, else we show both find a dealer and add to cart button for products. (please see the attached image).

Any help would be immensely appreciated.

Thanks,
Lan

CommentFileSizeAuthor
#1 Capture2.PNG106.75 KBLan
#1 Capture1.PNG107.64 KBLan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Lan’s picture

Title: hide "Add To Cart button" when set up the attribute price is 0 » hide "Add To Cart button" when set up the attribute
Issue summary: View changes
FileSize
107.64 KB
106.75 KB
Lan’s picture

Issue summary: View changes
Lan’s picture

TR’s picture

Assigned: Lan » Unassigned
Category: Feature request » Support request
TR’s picture

Status: Active » Fixed

You can do this by checking the stock level for the attribute and using hook_form_alter(), a theme function override, or a template to suppress the display of the add-to-cart button when the stock level is 0. (Doing this when price is 0 makes no sense at all - attribute prices are relative, so 0 just means the attribute is priced the same as the base price.) I believe there are quite a few threads on ubercart.org which discuss this. Likewise, I know there are some contributed modules here on drupal.org which hide the add-to-cart button as part of an out-of-stock solution - use the search function and you'll find them. If you have further questions about how to implement this, please discuss it in the forums at ubercart.org.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.