0
votes

I have written a plugin that allows customers to redeem points for discounts on merchandise in WooCommerce. When the customer redeem the points it generates coupons and applies them to the cart for the discount.

Everything works as expected but I want the coupon amount to be applied to the full cart value including shipping costs. If I make the coupon value large enough to include the shipping costs it just leaves an unclaimed amount from the coupon and caps it at the cart subtotal.

Is there a way to change the way it generates the coupon, or change the way it does the discount so I can make it include the shipping costs?

1
Coupons in WooCommerce are note made to be applied on shipping as they are only apply on cart content… Now nothing it's impossible, but what you are asking is a real development, not for StackOverFlow. - LoicTheAztec
Thanks for the feedback. Can you tell me if there is another way to accomplish the same thing? Perhaps a custom discount? - RonnBlack

1 Answers

0
votes

This plugin will allow coupons to apply against shipping costs (but not additional fees); It hasn't been updated in a few years, but I reviewed the code and tested it earlier today, and it is still working well!

Update: Upon further inspection, it looks like this plugin is throwing an error in PHP:

Got error 'PHP message: coupon_amount was called incorrectly. Coupon properties should not be accessed directly.

It needs to be updated to support WooCommerce v3.