I would like to show discount percentage on image as badge (refer image 2). I followed the instructions from http://www.customy.com/blog/show-product-discount-percent-in-magento/ and managed to show discount percentage on product page (refer image 1).
<?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; ?>
Now I got result as:
Now I need to show discount percentage on product image too like
What should I do to show discount badge on product image? I'm using magento 18.104.22.168 RWD theme