You are here

function uc_coupon_order in Ubercart Discount Coupons 6

Implementation of hook_order().

Ensure any cart pane coupon is added to the order if the checkout page is skipped (e.g. Paypal Express Checkout, Google Checkout)

File

./uc_coupon.module, line 854
Provides discount coupons for Ubercart.

Code

function uc_coupon_order($op, &$arg1, $arg2) {
  if ($op == 'save' && isset($_SESSION['uc_coupon'])) {
    $coupon = uc_coupon_validate($_SESSION['uc_coupon'], $arg1);
    if ($coupon->valid) {
      _uc_coupon_apply_to_order($arg1->order_id, $coupon);
    }
  }
}