Jump to content

How to change the discount (-) sign to (Save) in price drop.


Recommended Posts

Hi guys,

 

This could be a very simple to do job but somehow I could not find where to edit it.

 

I needed to change the discount (-) sign to (save), for example: the discounted of $50 off on specials and current Prestashop shown as (-$50.00) but I wanted to change it to (Save $50.00) instead.

 

Please help, thank you very much in advance.

 

Regards

 

Jacky

Link to comment
Share on other sites

As far as I know that's hardcoded in the TPL files. Depending on where you want it to display like that, you'll have to edit the corresponding tpl. For example, for the product page you'll need to change product.tpl, at about line 407 (1.5.4)

 

   {if $product->specificPrice AND $product->specificPrice.reduction_type == 'amount' AND $product->specificPrice.reduction|intval !=0}
 -{convertPrice price=$productPriceWithoutReduction-$productPrice|floatval}
   {/if}

Link to comment
Share on other sites

As far as I know that's hardcoded in the TPL files. Depending on where you want it to display like that, you'll have to edit the corresponding tpl. For example, for the product page you'll need to change product.tpl, at about line 407 (1.5.4)

 

{if $product->specificPrice AND $product->specificPrice.reduction_type == 'amount' AND $product->specificPrice.reduction|intval !=0}
 -{convertPrice price=$productPriceWithoutReduction-$productPrice|floatval}
{/if}

 

Hi Nemo1

 

Thanks for that and unfortunately I don't know much about php coding, will you be more specify which code to change?

I just want to replace the minus (-) sign to (save) in the product details page.

 

Regards

 

Jacky

Link to comment
Share on other sites

Which PS version are you using? If you use a custom theme, it's impossible for us to determine at which line you must change the minus sign :) Otherwise let us know

 

 

Hi Nemo1,

 

Thanks for your respond.

 

I'm using PS 1.5.3. default theme and only changing the theme colour so there's not much changes on code

beside adding code for random products on homefeature.

 

Regards

 

Jacky

Link to comment
Share on other sites

Line 400 and next one, the code follows here:

  <p id="reduction_percent" {if !$product->specificPrice OR $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}><span id="reduction_percent_display">{if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}</span></p>
  <p id="reduction_amount" {if !$product->specificPrice OR $product->specificPrice.reduction_type != 'amount' && $product->specificPrice.reduction|intval ==0} style="display:none"{/if}><span id="reduction_amount_display">{if $product->specificPrice AND $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|intval !=0}-{convertPrice price=$product->specificPrice.reduction|floatval}{/if}</span></p>

 

Pretty messy, but try to find the minus signs and replace those :)

Link to comment
Share on other sites

Line 400 and next one, the code follows here:

  <p id="reduction_percent" {if !$product->specificPrice OR $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}><span id="reduction_percent_display">{if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}</span></p>
  <p id="reduction_amount" {if !$product->specificPrice OR $product->specificPrice.reduction_type != 'amount' && $product->specificPrice.reduction|intval ==0} style="display:none"{/if}><span id="reduction_amount_display">{if $product->specificPrice AND $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|intval !=0}-{convertPrice price=$product->specificPrice.reduction|floatval}{/if}</span></p>

 

Pretty messy, but try to find the minus signs and replace those :)

 

 

Hi Nemo1,

 

You're the best and thank you so much for your helps, I am highly appreciated indeed.

 

Mod, please add [solved] to the header of this topic on my behalf, thank you.

 

Regards

 

Jacky

Link to comment
Share on other sites

×
×
  • Create New...