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

Hide add-to-cart button if price = 0.00

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-01-2011, 07:26 AM
 
denisRGM denisRGM is offline
 

Newbie
  
Join Date: Jun 2011
Posts: 7
 

Default Hide add-to-cart button if price = 0.00

Can anyone help me. I want to hide the add-to-cart button on the product pages if the price is shown as 0.00. Site is RGM (see signature)

Version concerned is 4.4.3.

Many thanks.

Denis.

Last edited by denisRGM : 11-01-2011 at 07:31 AM. Reason: Site added
Reply With Quote
  #2  
Old 11-02-2011, 01:03 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,052
 

Default Re: Hide add-to-cart button if price = 0.00

Start by finding the template product_details.tpl in customer/main in your skin folder.

Then look for the code that displays the button, e.g.
{include file="customer/buttons/add_to_cart.tpl" type="input" additional_button_class="main-button"}

Then surround that code with an if statement to determine if the price is 0.

{if $product.taxed_price ne 0}

{/if}

The button will then only show if the product has a price above 0.
__________________
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.
Reply With Quote

The following 2 users thank pauldodman for this useful post:
denisRGM (11-02-2011), Petepots (11-02-2011)
  #3  
Old 11-02-2011, 05:35 AM
 
denisRGM denisRGM is offline
 

Newbie
  
Join Date: Jun 2011
Posts: 7
 

Default Re: Hide add-to-cart button if price = 0.00

Many thanks Paul. I thought that was what I had typed in the first place but copy and paste of your text worked fine while mine didn't. Thank you so much.

Denis.
Reply With Quote
  #4  
Old 11-17-2016, 08:53 AM
 
Duckworks Duckworks is offline
 

Member
  
Join Date: Nov 2015
Posts: 19
 

Default Re: Hide add-to-cart button if price = 0.00

Is it possible to hide the add-to-cart button when the price=0 by using the custom CSS? I'd rather not dig into the php code.
__________________
Business 5.3.1.5
Reply With Quote
  #5  
Old 11-17-2016, 08:57 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,052
 

Default Re: Hide add-to-cart button if price = 0.00

Are you using X-Cart 5?
This is a version 4 thread.
__________________
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.
Reply With Quote
  #6  
Old 11-17-2016, 09:31 AM
 
Duckworks Duckworks is offline
 

Member
  
Join Date: Nov 2015
Posts: 19
 

Default Re: Hide add-to-cart button if price = 0.00

oops, sorry. will post on the proper forum
__________________
Business 5.3.1.5
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:53 PM.

   

 
X-Cart forums © 2001-2020