Do You Want to Learn Marketing or Coding? Do You Want to Learn Marketing or Coding?

Show Magento Savings by Percentage on Product Page

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

So you want to display the percentage of savings your customer is getting during a sale. Well here is a way to find the percentage of savings and display it to your customer the magneto product page.

Here is what your end result can look like:
Magneto product savings by percentage

Fire up your ftp and go to the following location: app/design/frontend/yourtheme/yourtheme/template/catalog/product/view/

Download and back-up the this file “price.phtml”.

Open up the file and look for this piece of code.


__('Regular Price:') ?>

currency($_regularPrice,true,false) ?>

Below this add the following:


";
echo "(save ".round($totalPercent)."%)";
echo "

";
?>

This code gets the regular price, and the final price and calculates the percentage. It then echos it in a div called “savings”.
We then round the percentage up and display it on our magento product page. Finally, we close the “savings” div.

When you reload your page, you should see that the savings percentage is displayed on your magento shop for all users to see!

Yay…

I Really Need

Reviewing nerdy stuff is expensive.

Consider clicking on this ad & buying that item you REALLY wanted from Amazon.

It helps a ton!

Leave Your Thoughts