I used ubercart points module for payment by user points.

If users buy product that price is 1000 and users just 500 points in their account. The coupon is set 100% discount for this product. When in checkout, the validateion is failed, the result said "the points isn't enought for checkout". And then i check the code and find the total value of $order object is still the product price not discounted. the ubercart points payment will check the order_total and current user points. So it's failed.

I don't know the problem is in uc_coupon or ubercart_points module? But i think why the order total isn't discounted value ?

CommentFileSizeAuthor
#1 1197392-coupon-order-total.patch475 byteswodenx

Comments

wodenx’s picture

Status: Active » Closed (won't fix)
StatusFileSize
new475 bytes

This is because of the way checkout pane processing works - the $order object passed to each pane has the order_total field calculated excluding line-items (see uc_cart.pages.inc line 314).

The attached patch to uc_coupon should be a workaround for your situation - but please note THIS PATCH WILL NOT BE COMMITTED, because there may be other modules/sites which depend on things working as they do now.

Your best bet for a more permanent solution would be to post in the ubercart userpoints issue queue to see if they'd be willing to recalculate the order total to include new line items before validating.