Jump to content

Change price from $0 to FREE


Recommended Posts

Hey guys, I'm looking to change anything with a price of "$0" to the text "FREE" and add a class to the text such as

<span class="free">FREE</span>

 

I looked eveywhere for this and was surprised to see nobody seems to have asked for this yet (at least that I saw). If this has been addressed elsewhere my apologies. I'm new to the forums and prestashop for that matter.

Link to comment
Share on other sites

  • 2 weeks later...

Figured it out... modifying the code from the link you gave me elpatron

 

In product list.tpl there was code:

{displayWtPrice p=$product.price}

 

which I changed to:

{if $product.price == 0}{l s='FREE'}{else}{displayWtPrice p=$product.price}{/if}

  • Like 1
Link to comment
Share on other sites

  • 10 months later...

Hi all,

 

After days of attempts I succeeded it but only in one language. it is not in the ordering process (Basket of 1-5 pages) and in the main page (I guess it uses the file "product-list.tpl" too) if anyone knows how to make this another changes please say it.

 

I write the code to change "0.00" to "Free" on the product page:

 

In file "product.tpl" of your theme (line 383):

 

Original code:

 

<p class="our_price_display">
{if $priceDisplay >= 0 && $priceDisplay <= 2 
 <span id="our_price_display">{convertPrice price=$productPrice}</span>
 <!--{if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
 {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
 {/if}-->
{/if}
</p>

 

 

And the solution code:

 

<p class="our_price_display">
{if $priceDisplay >= 0 && $priceDisplay <= 2 and $productPrice neq 0}
 <span id="our_price_display">{convertPrice price=$productPrice}</span>
 <!--{if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
 {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
 {/if}-->
 {else} Free
{/if}
</p>

 

My PS version is 1.5.3.1

Link to comment
Share on other sites

  • 11 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...