| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Hiding the Add to Cart button for certain parts | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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.
__________________
X-Cart 4.4.2 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Hiding the Add to Cart button for certain parts
When you say "parts", do you mean products?
__________________
Paul Dodman e-business & m-commerce consultant w: www.luminointernet.com e: xcart@luminointernet.com Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart. |
|||||||||
#3
|
|||||||
|
|||||||
Re: Hiding the Add to Cart button for certain parts
Quote:
Yes, I mean products.
__________________
X-Cart 4.4.2 |
|||||||
#4
|
|||||||||
|
|||||||||
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.
|
|||||||||
#5
|
|||||||
|
|||||||
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!
__________________
X-Cart 4.4.2 |
|||||||
#6
|
|||||||||
|
|||||||||
Re: Hiding the Add to Cart button for certain parts
If it still isn't working did you want to post the code?
|
|||||||||
#7
|
|||||||
|
|||||||
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.
__________________
X-Cart 4.4.2 |
|||||||
#8
|
|||||||
|
|||||||
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}
__________________
X-Cart 4.4.2 |
|||||||
#9
|
|||||||||
|
|||||||||
Re: Hiding the Add to Cart button for certain parts
I think you need to put your code in customer/main/product_details.tpl.
__________________
X-Cart 4.4.4 Gold |
|||||||||
#10
|
|||||||
|
|||||||
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.
__________________
X-Cart 4.4.2 |
|||||||
|
|||
X-Cart forums © 2001-2020
|