| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Remove Buy Now button. | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Remove Buy Now button.
Can't seem to find anything in searches that is relevent.
Version 4.4.3. For various reasons we need to price a product as ё0 and ask customers to phone for a price. When priced as ё0 though it asks the customer to name their own price and shows the buy now button. Does anyone know how to prevent this and what file to edit. We basically want a "if price = 0 then don't show button". Changing the labels was done easily. See http://www.mercersfurniture.co.uk/home.php?cat=526 as example. Thanks. Denis. |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Remove Buy Now button.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
#3
|
|||||||
|
|||||||
Re: Remove Buy Now button.
Thanks, I saw that one but it's refering to the old v4.1.x and v4.4.3 code looks nothing like that. We only want to show the buy now button anywhere, product list or product areas, if the product value is >ё0.00. Changing the messages by editing the labels was simple, but how do we turn off the buy now button?
Denis. |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Remove Buy Now button.
You can use an if statement to hide the button, like
{if $product.price gt 0} show buy button code {else} call for price {/if}
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#5
|
|||||||
|
|||||||
Re: Remove Buy Now button.
Thanks for that, worked a treat .
The hardest part is knowing just where to put the code. I have removed the "Buy Now" button on product lists where the price is ё0.00 and replaced it with CALL FOR PRICES instead. I have also removed "Add to cart" button in the product details pages for zero priced items and used the same message. In the /skin/custom_scheme/customer/main/product_details.tpl file: (The added bits are in red text. The other is part of the standard file and should not be removed): {if $product.appearance.buy_now_buttons_enabled} {if $product.forsale ne "B"} <ul class="simple-list"> <li> <div class="buttons-row buttons-auto-separator"> {if $product.price gt 0} {include file="customer/buttons/add_to_cart.tpl" type="input" additional_button_class="main-button"} {else} <font color="red" size="2"><b>CALL FOR PRICES</b></font><br><br> {/if} In the /skin/common_files/customer/buttons/buy_now.tpl file: {if $product.price gt 0} {include file="customer/buttons/button.tpl" button_title=$lng.lbl_buy_now additional_button_class=$additional_button_class|c at:' add-to-cart-button'} {else} <font color="red" size="2"><b>CALL FOR PRICES</b></font><br><br> {/if} {* END TEST *} I have included the above for anyone using V4.4.3 who may have the same enquiry. Ours is a customised site so the file shown above in the custom_scheme folder will probably be in the scheme folder for the site. Hope this helps. Denis. |
|||||||
|
#6
|
|||||||
|
|||||||
Re: Remove Buy Now button.
We have tried to impliment a similar type of system but with the difference that it's based on user being logged in and being of a set membership level..
but I've tried accessing membershipId different ways with no success.. {$user_account["membershipid"]} $userinfo.membershipid always returns 0 ! using version 4.4
__________________
X-Cart 4.2 |
|||||||
#7
|
|||||||||
|
|||||||||
Re: Remove Buy Now button.
Correct, it is not present. Add this towards the bottom of include/check_useraccount.php:
Code:
|
|||||||||
#8
|
|||||||
|
|||||||
Re: Remove Buy Now button.
I would like to do this based on a specific category (our freebies category - cat=287) in addition to the 'gt 0' price.
Any help on the code for this would be extremely helpful and much appreciated!
__________________
currently: 4.7.1 previously: XCart Version 4.4.5 Pro |
|||||||
#9
|
|||||||
|
|||||||
Re: Remove Buy Now button.
Quote:
Has anything changed in Version 4.5.3? We are modifying as suggested above, but there is still no data in the smarty tag. Is there any particular place in the PHP file that the assignment line needs to be added? Thank you
__________________
Version 4.3.2 Version 4.4.3 Version 4.4.5 Version 4.5.3 Version 5.3.x Version 5.4.x |
|||||||
#10
|
|||||||
|
|||||||
Re: Remove Buy Now button.
Thanks for this Denis! Would the code:
{if $product.price gt 0} change at all for american dollars? I'm not sure if your "gt" represents your currency. Thanks in advance! Quote:
__________________
Dawn X-Cart Business 5.3.6.3 Mods: Qty input - Custom Mod Part numbers near title - Custom Mod Membership approval before ordering - Custom Mod Order Forms - Custom Mod Freight on Board - Custom Mod Catalog Order Form Call For Price Template: Crisp White skin Running on Windows |
|||||||
|
|||
X-Cart forums © 2001-2020
|