Is there any simple way or any plugin around that allows to create a coupon code for the following kind of offer: "get product X for free on orders over $100"?
Asked
Active
Viewed 2,929 times
1 Answers
5
Yes this is possible with an additional plugin: The commercial version of WooCommerce Extended Coupon Features.
- In WooCommerce coupons settings you have already a minimum field for orders amount:
The free version of this plugin has already Auto coupons functionality, which allow coupons to be automatically added to the users cart if it's restrictions are met. Also above
With the inexpensive commercial version of this plugin you have the missing functionality you need: Adding free products to the customer's cart based the on coupon rules.
So with that 3 functionalities, the conditions are met to auto add a coupon code for "get product X for free on orders over $100".
Additional tricks about woocommerce coupons
1) WooThemes snippet: Create a coupon programmatically
2) Auto apply Discount Coupon to Customer’s Purchase:
function order_price_is_greater_than_100() {
global $woocommerce, $total_qty;
if ( $woocommerce->cart->has_discount( $coupon_code ) ) return;
if ( $woocommerce->cart->get_cart_total() >= 100 ) {
$coupon_code = 'UNIQUECODE'; // <= set the name of your coupon code here
if (!$woocommerce->cart->add_discount( sanitize_text_field( $coupon_code ))) {
$woocommerce->show_messages();
}
echo '<div class="woocommerce_message"><strong>The total price in your cart is greater than 100: You get … </strong></div>';
}
}
add_action('woocommerce_before_cart_table', 'order_price_is_greater_than_100', 10, 0);

LoicTheAztec
- 229,944
- 23
- 356
- 399