Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › Auto-apply not working on negative values
- This topic has 2 replies, 2 voices, and was last updated 10 years, 8 months ago by Kenneth A Gagne.
- AuthorPosts
- February 12, 2016 at 2:19 am #319Kenneth A GagneParticipant
I have a strange situation where I want the price to go UP — so I’ve made the coupon worth -20 and have set it to trigger if three particular items are in the customer’s cart. However, I can’t get it to auto-apply! If the customer manually applies the coupon code, it works fine. If I change the coupon’s value to make the cart price go down, it auto-applies fine. But auto-applying a negative coupon won’t work. Is this a bug?
-Ken
February 13, 2016 at 10:21 pm #321Soft79KeymasterWell not a bug, just an unexpected feature ;)
for now, just edit line 387 of wjecf-autocoupon.php:
replace
if ( $coupon->get_discount_amount( $cart_item['data']->price, $cart_item ) > 0 ) {with
if ( $coupon->get_discount_amount( $cart_item['data']->price, $cart_item ) <> 0 ) {I will fix this in a future version.
February 14, 2016 at 11:26 pm #324Kenneth A GagneParticipantYes! I made the change you suggested, as well as on line 269 of the pro edition, and now the negative coupon works perfectly.
I realize that this is an unusual use of a coupon, and there are probably better ways to do what I’m trying to accomplish. I appreciate you not objecting to that and instead offering this easy fix. Thank you very much.
-Ken
- AuthorPosts
- You must be logged in to reply to this topic.