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
Comment | File | Size | Author |
---|
Comments
Comment #1
Lan CreditAttribution: Lan commentedComment #2
Lan CreditAttribution: Lan commentedComment #3
Lan CreditAttribution: Lan commentedComment #4
TR CreditAttribution: TR commentedComment #5
TR CreditAttribution: TR commentedYou 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.