Whenever a discount is applied, a coupon is created, but what does this mean exactly?
Let’s take a look at the behavior on the backend after products have been purchased and discount rules have been applied.
For the admin, it is important to know what will happen exactly with a cart rule and the coupon that is created.
We will explain this step by step, by using an example.
If there are two or more cart rules valid, the plugin always creates a unique coupon, so it merges the discount amount of the rules into a unique value.
For this reason, even if the rules have a percentage discount, the coupon will be created as a fixed price.
Create the cart rules
Now suppose we have created 2 cart rules:
- Cart rule 1 applies a discount of 10% for cart subtotal greater than 100$.
- Cart rule 2 with an extra 5% if the cart has more than four items.
Add products to the cart – customer view
Now we will add some products to the cart, so both rules are valid.
What happens on the cart page, what will the customer see?
The plugin will apply a coupon with the amount of the two rules so 10% + 5% discount.
Change rules – exclude product(s)
Now, for rule 1 we want to exclude specific products from the cart.
So we will add the Exclude products condition and select Hiking shoes.
On the frontend, the customer will not see the difference, because the coupon amount is simply calculated without this product.
On the backend, however, the coupon is applied on all items because the coupon is a fixed price.
Backend view of created coupon – 2 valid rules
As you can see, each item will have the same discount (not in percentage), also the excluded product will be discounted.
Backend view of created coupon – 1 valid rule
If only one rule is valid, the plugin creates the correct coupon (in percentage for example) and if there are products in exclusion, these products will not receive the discount.
So on frontend, the coupon amount will be the 10% without the product “Hiking Shoes”
And in the order, the items will have the right discount amount.
As you can see, now the Hiking shoes item does not have the discount applied!
Now, why is this important to know?
Because, for example, when you receive a refund request, it is good to know how the discount rules have been applied, so you can make sure to refund the right amount.