Using Discount Coupons 6.x-1.x-dev with Ubercart 6.x-2.4
All works well EXCEPT if customer pays using PayPal Express. If does, then coupon %-off shows as a line item in purchases AND as a discount % applied to subtotal.
Should NOT show as line item as an item purchased!
Net effect is to double the %-off if paid with PayPal Express.
This happens regularly & often - not a "one time" fluke.
Needs correction.

CommentFileSizeAuthor
#1 1181120-paypal-express.patch624 byteswodenx

Comments

wodenx’s picture

Status: Active » Needs review
StatusFileSize
new624 bytes

Thanks for catching this - hard to believe it's not come up before.

Please try the attached patch and let me know if it resolves the problem. Note: the coupon will still appear as an item in the cart, but should no longer count towards the total. You could probably alter this behavior by overriding "theme_cart_review_table()" (default implementation is in uc_cart_checkout_pane.inc") and changing what is displayed if the url is the paypal review page, something like

...
   // Set up table rows.
   $contents = uc_cart_get_contents();

   foreach ($contents as $item) {
+    if ($_GET['q'] == 'cart/echeckout/submit' && isset($item->module) && $item->module == 'uc_coupon') {
+      continue;
+    }
     $price_info = array(
       'price' => $item->price,
       'qty' => $item->qty,
...
wodenx’s picture

Status: Needs review » Fixed

Committed to DEV.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

j0rd’s picture

There's a bug in this patch I believe.

function uc_coupon_order_product_alter(&$product, &$order) {    

Should be

function uc_coupon_order_product_alter(&$product, $order) {    

As per http://api.lullabot.com/hook_order_product_alter

I'm also getting reports in my error log.

wodenx’s picture

Thanks. Committed to new release 6.x-1.7.