Reputation: 119
In woocommerce I'want to apply discount coupon on shipping cost only. I'm providing only shipping service to my customer and offering some discount via coupon, So, I just want to apply that discount amount on Shipping Cost only?
Upvotes: 4
Views: 1614
Reputation: 99
You can provide coupons on the basis of shipping method. In this case, the coupon will be applied only to those customers who use the linked shipping method. The coupon can also be made to apply for certain customers based on location. The free coupon extension plugin Smart coupon for WooCommerce lets you do this.
Upvotes: 1
Reputation: 358
WooCommerce developers do not support this kind of discount. see the attached image below:
however, maybe following hack could work:
you need to edit wc-admin-functions.php
file, you can find it inside woocommerce=>includes=>admin
directory.
Search and find this:
update_post_meta( $order_id, '_cart_discount', $subtotal - $total );
and replace it with the following one:
update_post_meta( $order_id, '_cart_discount', $total_shipping_tax );
I personally, do not like this way, the better way could be override this statement from functions.php
file of your active theme, or you should hook this code into a suitable WooCommerce Action
.
so whenever you or your client update the plugin your change remain unaffected. let me know if you find any other solutions that work.
Upvotes: 0