This module is great and has continually improved over time.

We've discovered a small bug in what may be a fairly unique case.

We have a conditional action set up to calculate shipping options. There's a standard shipping and a free shipping option. If the order subtotal is >= $75, free is offered, otherwise a standard flat rate is offered.

What's happening with the coupon module is that if a customer adds a coupon and then gets the the Review page, the coupon is added as an "item" to the cart. If for some reason the user goes back after that, the coupon "item" in the cart reduces the subtotal. This affects which of our shipping options gets presented when they return to the checkout page.

So when an order qualifies for the free shipping the first time through, a coupon being added as an "item", disqualifies the order for free shipping the next time through. However, even if the user chooses the standard shipping option the second time, they get and "invalid option" error and instructions to recalculate the shipping options.

So, for some reason, the "Calculate Shipping" function shows the standard shipping option, but form submission doesn't validate it, it's still looking for the Free Shipping option.

This can be solved if the coupon is cleared from the cart and the checkout process is started again, however this is not intuitive and complicates the user experience. Perhaps coupons could be automatically cleared from the cart when a user comes to the checkout page?

I will be looking into these processes but wanted to post here for feedback if someone has deeper knowledge of them already, and can provide advice.

I'll post findings and any solutions as I discover them. Thanks in advance for any advice.

CommentFileSizeAuthor
#2 1316464-quote-condition.patch1.38 KBwodenx

Comments

wodenx’s picture

I can't reproduce this behavior exactly - using Ubercart 2.6/uc_coupon 1.7 - I set up a free shipping option using uc_flatrate, based on the "order total" condition. I can't get an invalid option message, but I do think the behavior is less than ideal. In my opinion, when you enter a coupon on the checkout page, if it brings the order total below the minimum, the free shipping option should be removed. This will involve a bit of investigation - I'll try to get to it as soon as I can

wodenx’s picture

Status: Active » Needs review
StatusFileSize
new1.38 KB

OK this isn't the prettiest solution, but it's something. The real problem is that uc_quote hard-codes the current cart-contents into the checkout page javascript - so there's no way for any other module to alter them via ajax once the checkout page has been loaded. For this reason, I think the only solution is to prevent coupons from counting towards the order total. The only real way to do this seems to be through a price alterer.

If anyone can think of a better solution, please post. Otherwise, give this patch a try and see if it helps.

nelslynn’s picture

I had this same issue uc_coupon version 6.x-1.7 with Ubercart 2.7.

Thank you for the patch vodenx!

Will this patch be committed?

wodenx’s picture

Status: Needs review » Postponed

I'm not sure. As I say, I think it's an ugly solution. I would rather see the problem fixed by changing the way the shipping quote module works. I've opened an issue in the Ubercart queue at #1419160: uc_quote doesn't play well with other checkout pane ajax and will submit a patch there when I have time. I will at least wait to see if that is accepted before committing this.

Jonathan Peterson’s picture

Had essentially the same issue -- it wasn't a free shipping tier but a different flat rate tier -- and the patch in #2 worked for me. Thanks so much for your hard work here; it is very much appreciated.

athanor’s picture

Nothing is going with #1419160: uc_quote doesn't play well with other checkout pane ajax, so I also tested the patch from #2 to a good result. Thank you, wodenx!