Hiding the Add to Cart button for certain parts
Has anyone been able to hide the add to cart button for specifice parts at all? I have tried various versions of code that utilize the extra fields option which have not worked. I'm definitely missing something here. Any help would be much appreciated. Thanks in advance.
|
Re: Hiding the Add to Cart button for certain parts
When you say "parts", do you mean products?
|
Re: Hiding the Add to Cart button for certain parts
Quote:
Yes, I mean products. O:) |
Re: Hiding the Add to Cart button for certain parts
I think you're on the right track, using Extra Fields to flag which products should hide the button. The button is in product_details.tpl so I would just add a wrapper around it checking for the value of the extra field. :)
|
Re: Hiding the Add to Cart button for certain parts
Quote:
The funny thing is, when I tried doing that, I wasn't using the right code to capture the variables correctly. It either eliminated the cart button for all of the parts, or none of them. Very strange! |
Re: Hiding the Add to Cart button for certain parts
If it still isn't working did you want to post the code?
|
Re: Hiding the Add to Cart button for certain parts
Sure, thanks so much for your help. Just give me a second to gather the code in question. :-)
|
Re: Hiding the Add to Cart button for certain parts
I basically created an extra field with the service name: NO_ADD_CART, and the field name: "No Add To Cart Button", for every product.
This is the code that I placed in the template common_files/customer/buttons/add_to_cart.tpl which is making the add to cart button dissappear for every product on the site. {* $Id: add_to_cart.tpl,v 1.1 2010/05/21 08:32:02 joy Exp $ vim: set ts=2 sw=2 sts=2 et: *} {if $extra_fields.field eq "NO_ADD_CART" and $extra_fields.field_value ne "no"} {include file="customer/buttons/button.tpl" button_title=$lng.lbl_add_to_cart additional_button_class=$additional_button_class|c at:' add-to-cart-button'} {/if} |
Re: Hiding the Add to Cart button for certain parts
I think you need to put your code in customer/main/product_details.tpl.
|
Re: Hiding the Add to Cart button for certain parts
I guess that some of the variables that I'm referencing aren't recorgnized in some templates? I'll give it a shot. Thanks for the help.
|
All times are GMT -8. The time now is 10:58 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.