Jump to content

Forcing Specific Pricing to Display Percentage Discount


Recommended Posts

Hello everyone,

 

I am a Prestashop newbie, trying to use the Specific Price feature in the Price menu within Products. I would like to discount a product by means of currency point reduction, but I would like this discount to be displayed as a percentage in the product page itself. Here's what I mean:

 

Back Office:

 

Retail Price = $500

Discount (currency point) = -$100

 

Final Price = $400

 

 

Product Page:

 

Price: $400

Discount: -20%

Strikethrough price: $500

 

 

I've tried looking around the forums but couldn't find what I'm looking for specifically. Here's what I've tried so far:

 

I went into and product.tpl under the Classes folder and changed the following lines (Please excuse my rudimentary coding skills. To be honest I don't know what I'm doing):

<p id="reduction_amount" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'amount' || $product->specificPrice.reduction|floatval ==0} style="display:none"{/if}>
<span id="reduction_amount_display">
{if $product->specificPrice && $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|floatval !=0}-{convertPrice price=$productPriceWithoutReduction-$productPrice|floatval}
{/if}
</span>
</p>

to match the exact format for percentage:

<p id="reduction_amount" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}>
<span id="reduction_amount_display">
{if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}
{/if}
</span>
</p>

The result is that the reduction label is now gone off the product page on currency point discounts and displaying twice on the percentage discounts.

 

What am I doing wrong? Can someone please point me in the right direction on how to achieve this? Also, will this be reflected in the customer's bill?

 

Thanks, any help would be very appreciated.

 

Tony

 

Edit - Also, I'm on PrestaShop™ 1.6.0.8 

Edited by anthoj (see edit history)
  • Like 1
Link to comment
Share on other sites

Hi,

 

could you please copy the entire .tpl code of your reduction_percent and old_price paragraphs?

A link to one of the products would be helpful as well!

 

Thanks for the reply...

 

I have not modified any of these paragraphs, these are the original codes. 

<p id="reduction_amount" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'amount' || $product->specificPrice.reduction|floatval ==0} style="display:none"{/if}>
									<span id="reduction_amount_display">
									{if $product->specificPrice && $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|floatval !=0}
										-{convertPrice price=$productPriceWithoutReduction-$productPrice|floatval}
									{/if}
									</span>
								</p>
									{if $priceDisplay >= 0 && $priceDisplay <= 2}
										{hook h="displayProductPriceBlock" product=$product type="old_price"}
										<span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span>
										<!-- {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if} -->
									{/if}
								</p>

Another option I have is to figure out the difference percentage difference and reduce it that way, but the pricing won't be specific to the penny if I do that...

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...