Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Remove Buy Now button.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-01-2012, 08:24 AM
 
denisgre denisgre is offline
 

Newbie
  
Join Date: Jan 2012
Posts: 8
 

Default 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.
__________________
v4.4.3
Site is http://www.mercersfurniture.co.uk
Reply With Quote
  #2  
Old 02-01-2012, 11:15 AM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Remove Buy Now button.

http://forum.x-cart.com/showthread.php?p=254207

---
__________________
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)
Reply With Quote
  #3  
Old 02-01-2012, 01:20 PM
 
denisgre denisgre is offline
 

Newbie
  
Join Date: Jan 2012
Posts: 8
 

Default 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.
__________________
v4.4.3
Site is http://www.mercersfurniture.co.uk
Reply With Quote
  #4  
Old 02-01-2012, 01:47 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default 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
Reply With Quote

The following user thanks cflsystems for this useful post:
denisgre (02-13-2012)
  #5  
Old 02-13-2012, 06:59 AM
 
denisgre denisgre is offline
 

Newbie
  
Join Date: Jan 2012
Posts: 8
 

Default 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.

__________________
v4.4.3
Site is http://www.mercersfurniture.co.uk
Reply With Quote

The following 2 users thank denisgre for this useful post:
vtscomputers (07-29-2012), YannisP (03-14-2012)
  #6  
Old 04-20-2012, 11:17 AM
 
sauve001 sauve001 is offline
 

Newbie
  
Join Date: Jun 2009
Posts: 1
 

Default 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
Reply With Quote
  #7  
Old 04-24-2012, 12:40 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Remove Buy Now button.

Correct, it is not present. Add this towards the bottom of include/check_useraccount.php:
Code:
$smarty->assign('user_membershipid',$user_account['membershipid']);
The smarty variable will be {$user_membershipid}.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #8  
Old 07-29-2012, 05:19 AM
 
vickis vickis is offline
 

Advanced Member
  
Join Date: Dec 2006
Posts: 47
 

Default 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
Reply With Quote
  #9  
Old 11-01-2012, 05:06 PM
 
K-VAR K-VAR is offline
 

Member
  
Join Date: Oct 2005
Posts: 12
 

Default Re: Remove Buy Now button.

Quote:
Originally Posted by cherie
Correct, it is not present. Add this towards the bottom of include/check_useraccount.php:
Code:
$smarty->assign('user_membershipid',$user_account['membershipid']);
The smarty variable will be {$user_membershipid}.

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
Reply With Quote
  #10  
Old 01-14-2014, 11:39 AM
 
Dawn Howard Dawn Howard is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 229
 

Default 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:
Originally Posted by denisgre
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.

__________________
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
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:57 PM.

   

 
X-Cart forums © 2001-2020