The conditional action code is looking for the cart's current coupon in:
$order->data['coupon']

I think this is now stored in the session as the value does not appear to be available in the order object.

As a result the conditional action is not responding correctly to the current coupon condition.

Assuming I am right in this assumption, I have attached a patch to change the uc_coupon_condition_order_has_coupon function.

CommentFileSizeAuthor
#1 uc_coupon.ca_.inc_.patch816 bytesikos
uc_coupon.ca_.inc_.patch804 bytesikos

Comments

ikos’s picture

StatusFileSize
new816 bytes

Revised version of my patch attached. Although it worked, it did not change the case of the coupon code before checking.

wodenx’s picture

Status: Active » Postponed (maintainer needs more info)

This patch will only work if the condition is invoked in the same session in which the coupon was applied - i.e. not when orders are updated after the fact (by IPN, for example).

The coupon is inserted into the $order object when it is validated. At what stage in the order process (i.e. through what trigger) are you invoking this condition?

wodenx’s picture

Status: Postponed (maintainer needs more info) » Needs work

Connected to #276498: Discount on (or free) shipping?. The $order object will not contain the currently applied coupon until after the checkout page is submitted - thus it will not be available for any checkout pane ajax callbacks. Will try to implement the fix suggested by longwave at #31 of the referenced thread.

wodenx’s picture

Version: 6.x-1.5 » 6.x-1.x-dev
Status: Needs work » Needs review

Please see #276498: Discount on (or free) shipping? for a patch which should resolve this issue properly.

wodenx’s picture

Status: Needs review » Closed (duplicate)