Jump to content

Displaying Original price in product details


Recommended Posts

Hi guys,

I am newbie in Prestashop, but I found a issue displaying original price in Product details.

Basically the idea is to display Current price and the Original price as well as the percentage of discount.

In the product.tpl there is variable called $productPriceWithoutRedution but the value there is the price of the product with discount. Here is the scenario:

A product with regular price of 100$ has been discounted from the Price tab by adding a rule where the new price is 80$. There is no extra discounts for the group.

When I use {$productPriceWithoutRedution} it's 80$ instead of 100$ and this way I cannot calculate the precentage of discount as well I cannot display the original price.

My solution is to extend the Product.php class. Here is the code snippet: http://pastebin.com/Akbx9Tft

You should get that code and place it in: /your_presta_installation/override/classes/Product.php

Then your $productPriceWithoutRedution will display the proper value of the Info tab

Hope this helps to someone.

Link to comment
Share on other sites

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...