Satchmo allows you to setup multiple types of discount codes:
- Straight dollar amounts
- Percentage off
- Free shipping
Each of these types can be qualified or limited by:
- Number of uses
- Minimum order
- Specific dates
- Specific products
A discount code is easy to setup in Satchmo using the following fields:
Automatic discounts are how you do store wide sales.
Warning
Automatic discounts must always be percentage sales, and you can only have one running at a time. You should also ensure that you do not apply auto discounts to gift certificates.
In your site’s admin interface, create a new discount.
Make an “automatic” discount, so that it is available to the automatic discount template tags. Do not enter a new price in the admin for the products.
In the template where you want to show the auto discount, load the {% satchmo_discounts %} (Visit Satchmo Templates documentation for details on Satchmo filters) filter library.
You can now add some markup to your template, similar to below:
{% if sale %}
<div>
<div class="saleprices">
<h3> Regular price: <span class="saleprice" id="price">{{product.unit_price|currency}}</span></h3>
<h3> {{ sale.percentage_text }} off: <span class="saleprice" id="sale_saved">{{ product|discount_saved:"sale"|currency }}</span></h3>
<h3> Your price: <span class="saleprice" id="sale_price">{{ product|discount_price:"sale"|currency }}</span></h3>
{% else %}
<h3 id="price">{{product.unit_price|currency}}</h3>
</div>
{% endif %}
The key parts of the above markup are the {{ product|discount_saved:"sale"|currency }} and the {{ product|discount_price:"sale"|currency }} filtered variables. The former returns the amount saved by the discount while the latter returns the discounted price, all in the correct locale currency.