In my previous article I discussed the configuration of the first three options in the section of Usage Restriction for coupons in WooCommerce, i.e. "Minimum spend", "Individual use only" and "Exclude sale items". These options allow online store owners to include some additional functionalities and checks in the coupons. However, this section includes several other settings, which are "Products" and "Exclude Products". Let's discuss these options today.
Before starting off with the topic formally, allow me a brief recap of where we are. Go to your website's WordPress admin dashboard and then WooCommerce > Coupons > Add Coupon > Coupon Data > Usage Restriction. Now let's start with the configurations ahead.
Products is the option from where I will start today's topic. You can find this option beneath the checkbox of Exclude sale items. The option for Products will work only if you list a number of products which should be in the customer's cart for a coupon to be valid. Simply add the names of the products in the field provided. Let me explain how this setting works with the help of an example.
Consider a coupon with the following settings:
The above mentioned data shows that if the customer's cart contains any of these three products (i.e. Woo Ninja, Woo Logo, Woo Album #1) then this coupon can be used.
In the first case, the customer's cart contains three different items (i.e. Woo Ninja, Patient Ninja, Woo Album #2) out of which one item (i.e. Woo Ninja) has been defined by the store owner in the Products field of the coupon. It means that the customer can successfully use this coupon and enjoy a discount of £50 on the entire cart.
The cart totals also show that after using this coupon the original price of the order, i.e. £79, is reduced to £29.
Now the customer's cart contains two different items (i.e. Patient Ninja, Woo Album #2) and no such item has been defined by the store owner in the Products field. Hence, when the customer tries to apply a coupon on the order, a notification will display on the screen with a message saying "Sorry, this coupon is not applicable to your cart contents".
The cart totals also show that the customer must pay the full amount in this case.
The option for Exclude products will function in the opposite manner to Products which we've just discussed. In this field you can specify the names of all those products on which the coupon will not apply, and if any of these products are in the cart then a customer will not be able to use this coupon. I am again going to explain the working of this coupon, which has the following configurations:
If the customer's cart contains any of these three products (i.e. Woo Logo, Woo Album #2 and Woo Single #2) then this coupon cannot be used.
The figure displayed above shows a cart where a customer has placed three different items, i.e. Woo Album #2, Happy Ninja and Woo Ninja. However, the online store owner has added Woo Album #2 in the Exclude products field. So when the customer tries to use the coupon on this cart, a notification of an unsuccessful attempt will be displayed.
And similarly, the cart totals also represent a full price of £59 which is to be paid by the customer.
In the next scenario, the cart again contains three different items (i.e. Happy Ninja, Woo Ninja, Woo Single #1), but this time no item from the Exclude products field is included. So the coupon will be applied successfully, as can be seen below.
The cart totals shows that now a customer enjoys a discount on the total price of £53, which reduces to £3.
I hope to have explained these two properties clearly, with two different examples each. I will be completing the section of Usage Restriction settings in my next article. I hope that up till now I have made things quite clear. Still if you have any queries you may ask in the comment box below.