SEOshop Documentation

Discount rules

Version 1.0, last edit: Oct 22, 2014

Introduction

With discount rules you will have many more opportunities to give discounts to your customers. For example, you can offer a ‘2 for the price of 1’ bargain, or give discounts to loyal customers.

Installing

Add the code in the product.rain template under GENERAL > Design > Template Editor

The code.

With this code the discount rules will work and also includes the normal discount

{% if product.discounts or product.discount_rules %}
 <div>
{% if product.discounts %}
  {% for discount in product.discounts %}
    <li>
      {{ 'Buy $1 for $2 each and save $3' | t (discount.quantity, discount.price | money, discount.percentage | percentage) }}
      {% if discount.unit and shop.settings.legal.mode == 'strict' %}
        ({{ discount.unit.price | money }} / {{ discount.unit.unit }})
      {% endif %}
    </li>
  {% endfor %}
{% endif %}
 {% if product.discount_rules %}
  {% for discount_rule in product.discount_rules %}
    <li>{{ discount_rule }}</li>
  {% endfor %}
{% endif %}
  </div>
{% endif %}

Existing code.

If you have an existing code, it should look like this. Search for it and replace it with the new code.

{% if product.discounts %}
<div>
{% for discount in product.discounts %}
  <li>
    {{ 'Buy $1 for $2 each and save $3' | t (discount.quantity, discount.price | money, discount.percentage | percentage) }}
    {% if discount.unit and shop.settings.legal.mode == 'strict' %}
      ({{ discount.unit.price | money }} / {{ discount.unit.unit }})
    {% endif %}
  </li>
{% endfor %}
</div>
{% endif %}

Help

If you need any help regarding this subject, please do not hesitate to get in touch. You can reach us via support@seoshop.com.

Was this article helpful? Yes No
One moment please
Thanks for your feedback.