Displaying a list of active product catalog price rules
This Shop_Product::list_applied_catalog_rules() method allows you to display a list of catalog price rules applied to a product. You may want to display this list on the product details page. You can use the following code for displaying a list of active product discounts:
<?
$discounts = $product->list_applied_catalog_rules();
if ($discounts):
?>
<h2>Discounts!</h2>
<ul>
<? foreach ($discounts as $discount): ?>
<li>
<?= h($discount->name) ?><br/>
<?= h($discount->description) ?>
</li>
<? endforeach ?>
</ul>
<? endif ?>Next: Leaving the cart content after placing the order
Previous: Simplifying the checkout process
Return to Tips and Tricks

