In my previous post I showed you some code discovered in a website, which would show you how much you were saving in both currency and percentage on the price output.
However my client wanted to only show this if it was showing on the product page, not on category pages. Here's the code!
if(Mage::app()->getRequest()->getControllerName() != "category"){ ?> <?php $_savePercent = 100 - round(($_finalPrice / $_price) * 100); $_saveAmount = number_format(($_price - $_finalPrice), 2); ?> <p class="yousave"> <span class="price-label label">You Save: </span> <span class="price"> <strong class="save-amount">£<?php echo $_saveAmount; ?></strong> (<?php echo $_savePercent; ?>%) </span> </p> <?php } ?> <?php endif; ?>