Discounts

Overview #

Discounts are deductions off line items and an order, while products are in the cart. Discounts are only calculated while items are in the cart, Sales can apply to a product outside of the cart context.

To make a discount, simply go to commerce > promotions > discounts in the control panel.

Ordering #

Discounts are processed and applied in the order they are sorted in the control panel.

By setting the Stop processing further discounts after this discount matches checkbox on a discount, and if that discount conditions matches, no further discounts will be applied to the cart.

Coupon Discounts #

Discounts can optionally be a coupon based discounts. Coupon discounts have a coupon code entered in as a special condition on the ‘coupon’ tab.

If no coupon is entered, this discount is matched on all other conditions configured. If a coupon is added to the discount, all other conditions still need to be met in addition to the coupon being applied to the cart.

If you enter a coupon code as discount condition, additional conditions are shown that pertain to a coupon discount:

Per User Coupon Limit #

How many times one user is allowed to use this discount. Setting this requires a user to be logged in to use the discount. Setting this limit will not allow guests to use the discount. Set to zero for unlimited use of this coupon by guests or users.

This limit is controlled at the discount ID level, meaning if you change the coupon code itself, the counter still applies.

Per Email Address Coupon Limit #

How many times one email address is allowed to use this discount. This applies to all previous orders, whether guest or user. Set to zero for unlimited use by guests or users.

This limit is controlled at the discount coupon code itself, so changing the code on a discount will reset this limit condition.

Total Coupon Use Limit #

How many times this coupon can be used in total by guests or logged in users. Set zero for unlimited use.

This limit is controlled at the discount ID level, meaning if you change the coupon code itself, the counter still applies.

Times Coupon Used #

Read only field that counts how many times this coupon has been used, if a total coupon usage limit has been set.

This limit is controlled at the discount ID level, meaning if you change the coupon code itself, the counter still applies.

Reset Counter #

After this coupon has been used at least once, there is the ability to reset all usage counters. This applies to all conditions based on the discount ID, not the ‘Per Email Address Coupon Limit’, which is based on the coupon code itself.

Conditions #

The following conditions are available for configuration on a discount:

Start Date #

Date and time from which the discount will be active. Leave blank for unlimited start date.

End Date #

Date and time from which the discount will be finished. Leave blank for unlimited start date.

User Groups #

The current customer must be logged in and belong to one of the selected user groups for this discount to apply.

This condition is only available in Craft CMS Pro licensed installation.

Product Types #

Product types for which this discount will be applicable to. Leave blank for all product types.

Products #

Products for which this discount will be applicable to. Leave blank for all products.

Purchase Total #

Restrict the discount to only those orders where the customer has purchased a minimum total value of matching items.

Minimum Purchase Quantity #

Maximum number of matching items that can be ordered for this discount to apply. A zero value here will skip this condition.

Exclude this discount for products that are already on sale #

This checkbox will not match a product in an above condition if the item has a sale promotion already applied to it.

Amounts #

The amounts tab allows you to choose the amounts added or removed from an order if the discount’s conditions are met.

Base Discount #

The flat value which should discount the order’s total price. i.e “10” for $10 off.

Per Item Discount #

The flat value which should discount each item in the order. i.e “1” for $1 off.

Percent Discount #

The percentile value which should discount each item in the cart. i.e. “4%” for 4% off

Set shipping costs to zero for matching products #

This checkbox removes any shipping cost from a matching line item, and includes it in the discount.

Coupon Usage #

To make a discount that requires a coupon, simply make a standard discount, but add a coupon code in the the coupon tab when editing the discount. This will allow this discount to apply to the order when its conditions are met, and the coupon has been added to the cart.

To add the coupon to the cart, the customer just needs to submit a couponCode to the commerce/cart/updateCart form action. There is already an example of this form in the example templates, but also reproduced here:

<form method="POST">
    <input type="hidden" name="action" value="commerce/cart/updateCart">
    <input type="hidden" name="redirect" value="shop/cart">
    {{ getCsrfInput() }}
    <span class="{% if cart.getError('couponCode') %}has-error{% endif %}">
    <input type="text" name="couponCode" width="11" class="{% if cart.getError('couponCode') %}has-error{% endif %}" value="{{ cart.couponCode }}" placeholder="{{ "Coupon Code"|t }}">
    </span>
    <input type="submit" class="button" value="{% if cart.couponCode %}Change{% else %}Apply{% endif %} Coupon"/>
</form>

Of course, you can also submit the couponCode during any other updateCart form request, like adding to cart or updating custom fields.

If the coupon applied to the cart successfully, then you will see a discount adjustment added to the cart, otherwise you will see an error message as shown in the error handling code above.

Buy Craft Commerce

Craft Commerce site license

Includes

  • Standard tech support
  • Unlimited app updates
  • Craft Pro site license
Buy now for $999
Can I try before buying?

Absolutely. Just download it from the “Download” button in the site header and follow our installation instructions. You’ll have the full feature set to experiment with, with just one limitation: you won’t be able to charge credit cards. Until Craft Commerce has been purchased and activated, it’s limited to a single dummy gateway.

Will there be recurring/upgrade fees?

Nope, it’s just a one-time license fee per site.

Can I use this on an existing Craft site?

Yes! And if you already have a Craft Pro license (or you don’t need one), just flip that “Include a Craft Pro license” switch in the purchase form, and we’ll drop the price to $700.

Is Craft Pro required?

Craft Commerce does not require Craft Pro; it works perfectly fine on Craft Client and Personal editions as well!

Can I try before buying?

Absolutely. Just download it from the “Download” button in the site header and follow our installation instructions. You’ll have the full feature set to experiment with, with just one limitation: you won’t be able to charge credit cards. Until Craft Commerce has been purchased and activated, it’s limited to a single dummy gateway.

Will there be recurring/upgrade fees?

Nope, it’s just a one-time license fee per site.

Can I use this on an existing Craft site?

Yes! And if you already have a Craft Pro license (or you don’t need one), just flip that “Include a Craft Pro license” switch in the purchase form, and we’ll drop the price to $700.

Is Craft Pro required?

Craft Commerce does not require Craft Pro; it works perfectly fine on Craft Client and Personal editions as well!