X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Free items - remove buy button? (https://forum.x-cart.com/showthread.php?t=68303)

designguru 12-12-2013 06:12 AM

Free items - remove buy button?
 
Hi,

I would like to remove the 'buy' button from the product items page for free items (digital items).

There is also a border shown where usually the price is shown where I would like to display the word 'Free'. So the price of $0.00 equals the word Free.

Thank you!

designguru 12-13-2013 03:31 AM

Re: Free items - remove buy button?
 
anyone knows how to remove the buy button for free items?

totaltec 12-13-2013 07:50 AM

Re: Free items - remove buy button?
 
Let's assume you are using the ideal_comfort skin.
In /ideal_comfort/customer/buttons/buy_now.tpl

Surround the button code with an if statement like this:
Code:

{if $product.price ne 0}
{include file="customer/buttons/button.tpl" button_title=$lng.lbl_buy_now_img|substitute:"AltImagesDir":$AltImagesDir tips_title=$lng.lbl_buy_now notitle=true additional_button_class=$additional_button_class|cat:' add-to-cart-button'}
{/if}


designguru 12-13-2013 08:10 AM

Re: Free items - remove buy button?
 
Quote:

Originally Posted by totaltec
Let's assume you are using the ideal_comfort skin.
In /ideal_comfort/customer/buttons/buy_now.tpl

Surround the button code with an if statement like this:
Code:

{if $product.price ne 0}
{include file="customer/buttons/button.tpl" button_title=$lng.lbl_buy_now_img|substitute:"AltImagesDir":$AltImagesDir tips_title=$lng.lbl_buy_now notitle=true additional_button_class=$additional_button_class|cat:' add-to-cart-button'}
{/if}



Thank you!!

Didn't work in the skin/common_folder/ folder but will try in the templates folder.

How to get rid of the border (box) where the price appears when there's no price set?

totaltec 12-13-2013 08:21 AM

Re: Free items - remove buy button?
 
Not sure what you mean. Are you referring to the category page or product page, do you mean the input box where they enter their price?

Can you provide a link to this, show a picture or at least tell us what skin you are using?

designguru 12-13-2013 08:26 AM

Re: Free items - remove buy button?
 
Quote:

Originally Posted by totaltec
Not sure what you mean. Are you referring to the category page or product page, do you mean the input box where they enter their price?

Can you provide a link to this, show a picture or at least tell us what skin you are using?


Sent you a PM. We use the 3-column template. Will add a picture so if others want to remove this box.

totaltec 12-13-2013 08:47 AM

Re: Free items - remove buy button?
 
Okay, That is the price input box. Again assuming you are using ideal_comfort skin, look in: /ideal_comfort/customer/main/product_details.tpl

Around line 117 you will see this code:
Code:

{else}
  <input type="text" size="7" name="price" />
{/if}


Simply place comments around this input field like this:
Code:

{else}
  {*<input type="text" size="7" name="price" />*}
{/if}


designguru 12-13-2013 09:08 AM

Re: Free items - remove buy button?
 
Quote:

Originally Posted by totaltec
Okay, That is the price input box. Again assuming you are using ideal_comfort skin, look in: /ideal_comfort/customer/main/product_details.tpl

Around line 117 you will see this code:
Code:

{else}
  <input type="text" size="7" name="price" />
{/if}


Simply place comments around this input field like this:
Code:

{else}
  {*<input type="text" size="7" name="price" />*}
{/if}



The box is gone :) Thanks so much!

Couldn't remove the button yet. I'm using a customized 3-column skin (common_files)

totaltec 12-13-2013 09:13 AM

Re: Free items - remove buy button?
 
Good!
Try editing:
/common_files/customer/buttons/buy_now.tpl

designguru 12-13-2013 09:14 AM

Re: Free items - remove buy button?
 
I already edited this template.

There is another buy_now.tpl in the /common_files/customer/buy_now.tpl and one in here /common_files/customer/main/buy_now.tpl


All times are GMT -8. The time now is 01:26 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.