Last active
July 12, 2017 17:46
-
-
Save ravixp/14cc69e7d87e768cbe12d73e279cfd3c to your computer and use it in GitHub Desktop.
Magento 1: Add the saving amount and the discounted percentage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if($_finalPrice < $_price): ?> | |
| <?php | |
| $_discounted_percentage = 100 - round(($_finalPrice / $_price) * 100); | |
| $_saving_amount = number_format(($_price - $_finalPrice), 2); | |
| ?> | |
| <p class="saving-price"> | |
| <span class="price-label"><?php echo $this->__('Your Save: '); ?></span> | |
| <span class="price"> | |
| <span class="saving-amount"> | |
| <?php echo $_coreHelper->formatPrice($_saving_amount, false) ?> | |
| </span> | |
| <span class="discounted-percentage"> | |
| <?php echo $_discounted_percentage; ?>% | |
| </span> | |
| </span> | |
| </p> | |
| <?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment