LemonStand Version 1 Has Been Discontinued
This documentation is for LemonStand Version 1. LemonStand is now offered as a cloud-based eCommerce platform.
 You can try the new LemonStand and learn about upgrading here.
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: Storing Cart Content After Customer Places Order
Previous: How to Simplify the Checkout Process
Return to Tips and Tricks
