Skip to content

Examples ​

The Store Price Rule module has no templates of its own: it works with the example templates of the Store module. You can install these templates via the CP of the Store module, or alternatively, navigate to system/user/addons/reinos_store/templates/store.group and copy them directly from there.

The cart templates (e.g. cart.html) already contain the coupon code field, the discount, the free shipping and the old price of discounted items. The {cart:added_by_buy_x_get_y_free} variable for the Buy X Get Y Free items can be added yourself. A short overview, used inside the {exp:reinos_store:cart} tag:

html
{cart:items}
    {cart:name}
    {if cart:added_by_buy_x_get_y_free}<small>Free gift</small>{/if}

    {cart:price:formatted}
    {if cart:on_sale}&nbsp;<strike>{cart:old_price:formatted}</strike>{/if}
{/cart:items}

<!-- the coupon code field for the rules that are triggered by a code -->
<input type="text" name="coupon_code" value="{cart:coupon_code}"/>

{if cart:discount > 0}
    Discount: {cart:discount:formatted}
{/if}

{if cart:has_free_shipping}
    Free shipping
{/if}

See the Cart tag of the Store module for the full example.