Saturday 6 April 2013

Add Discount Label on List page


Open app/design/frontend/yourpackage/yourtheme/template/catalog/product/price.phtml

find

<?php endif; /* if ($_finalPrice == $_price): */ ?>

add Just after this line

<?php // Discount percents output start ?>
    <?php if($_finalPrice < $_price): ?>
    <?php $_savePercent = 100 - round(($_finalPrice / $_price)*100); ?>
        <p class="special-price yousave">
            <span class="label"><?php echo $this->__('You Save:') ?></span>
            <span class="price">
                <?php echo $_savePercent; ?>%
            </span>
        </p>
    <?php endif; ?>
<?php // Discount percent output end ?>

No comments:

Post a Comment