Magento show money saved as a Percentage
Go to the following location: app/design/frontend/yourtheme/yourtheme/template/catalog/product/view/
Download and back-up the this file “price.phtml”.
Open file and look for: (Around line 318 (for me) )
<?php else: // excl. ?>
<p class="old-price">
<span class="price-label"><?php echo $this->__('Regular Price:') ?></span>
<span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_regularPrice,true,false) ?>
</span>
</p>
After this add
<?php
// Display Percentage Saved here
$totalPercent = (($_regularPrice / $_finalPrice) *100) - 100;
echo "<div class='savings'>";
echo "(save ".round($totalPercent)."%)";
echo "</div>";
?>
Written by David Allsop
Related protips
Have a fresh tip? Share with Coderwall community!
Magento checkout pages are a common target for Magecart-style card skimming. Payment, analytics, and extension scripts on those pages need an inventory and a watch for silent changes.
Security insights from Cside