If a uc_coupon is used to take off 100% of the value the price becomes £0.

But this also causes the payment pane to reload. Reloading causes the JavaScript click that was attached to the hidden form field $('#edit-panes-payment-current-total').click(function() { free_order_check_total(this.value); }); to be lost during the AHAH reload.

In 6.x i think this can be resolved with Drupals "behaviors" feature?

So we end up with a total of £0 but still the option to pay because the free_order_check_total() JS call never got executed when the payment pane was re-loaded.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rszrama’s picture

Status: Active » Postponed (maintainer needs more info)

I don't understand why the behavior you're describing is happening unless the uc_coupon module is doing something funny here. The whole pane shouldn't be reloading, and since the hidden current total field is outside of the line items div (that's what should actually be getting reloaded) it isn't affected by a normal line item update. Perhaps the coupon module is doing its own reloading that overwrites this?

Agence Web CoherActio’s picture

I have the same issue with uc_discounts_alt on 6.x beta 4

Example :
Product price is 10€.
Applied discount of 10€.
Hence total is 0€.

Payment pane is not refreshed. Actually, it seems to be hanging (3 elements waiting to be loaded in status bar of Safari)

Thanks

Laurent

julient’s picture

I have a similar issue.
Using conditional action, I make sure that only the Free order payment method is visible when the total is 0.
Flow goes like that:
- payment is $10
- discount for $10 is applied and total is now 0
- only free payment method is visible
- you submit and on the order review page, despite a total of 0 it reads payment will be done with Paypal.
- you click submit and indeed you are taken to Paypal.

Agence Web CoherActio’s picture

I have posted a quick fix for this. See http://drupal.org/node/683216#comment-2541426

Of course, a more flexible solution would be better : the issue is coming from the calculation of current total in ubercart/payment/uc_payment/uc_payment.js which doesn't support VAT properly

Laurent

raefrog’s picture

I tried this fix and couldn't get it to work. I am wondering if I don't have the right id for taxes. Can you tell me where I would find the id? I am using the default tax module from Ubercart.

drupeo’s picture

Not sure if this helps anyone but I've just found that the free order module relies on the setting "Show the order total preview on the payment pane" being on at admin/store/settings/checkout/edit/panes

orianasarac’s picture

@drupeo - that is totally helpful, thx!

scotwith1t’s picture

Title: Coupons updating the cart total but free_order_check_total() never gets called » Requires Order Total Preview to be enabled in Payment Pane!
Version: 5.x-1.0 » 6.x-1.x-dev
Status: Postponed (maintainer needs more info) » Needs review
FileSize
1.64 KB

dear Lord, I spent FAR too long trying to figure this out and somehow overlooked this post (probably the title, so I'm retitling) AND posting the fix for anyone who wants it...this will at least WARN the user that they need to enable that setting for this to work...right now it just checks if the payment PANE is set, which it almost always will be unless it's disabled in admin/store/settings/checkout/edit/panes. but just to clarify @drupeo's comment, on this same page, there is a collapsible fieldset for Payment Method Settings and the "Show order total preview" MUST be checked as this module depends on that preview to work as it sets the ['current_total'] part of the payment pane's array. Anyway, here's a simple patch that anyone can use...I got a bit carried away with the drupal_set_message probably, but there will be no mistaking why you're experiencing what I did for the last 5 hours. Hopefully save someone else's time in the future.

scotwith1t’s picture

crap. patch didn't work. this one should be right. sorry, new to patching, but figure it's about time. :)

scotwith1t’s picture

Title: Requires Order Total Preview to be enabled in Payment Pane! » When using coupons, requires order total preview to be enabled in payment pane
scotwith1t’s picture

FileSize
3.01 KB

ok, the formatting was terrible, it broke it even worse and i think was against the beta release...sorry for the messy posting, new to git too...but I think I got it this time and against dev...(i hope so, this is becoming embarrassing)...wish you could delete an uploaded file