If I add to cart a product and go ahead to the checkout, the price in relation to the quantity set is correct. If I go back to the cart, and change the quantity, the price is initially being correctly calculated (in the cart section), but If I go ahead to the checkout again, I will get the previous price, set in according to the old quantity and not to the updated quantity.

Does someone have the same issue ? if it's so, a patch would be awesome.

Thanks

Comments

rolfo85 created an issue. See original summary.

TR’s picture

Assigned: rolfo85 » Unassigned
Issue tags: -checkout panes, -cart, -total product quantity
rolfo85’s picture

I noticed that this issue happens only if you click on the "back" browser button.
If you go back using the button "cancel" in the bottom of the page, then you can update your quantity and go ahead again and the price is being correctly updated in according to the new quantity.

The point is that almost everyone uses the back button.

Can someone fix this ?

rolfo85’s picture

Version: 8.x-4.x-dev » 8.x-4.0-alpha4
TR’s picture

I have not yet looked at this issue or tried to reproduce it. The first thing I would suggest is to update your site to -dev to see if the issue has been fixed.

rolfo85’s picture

I've just tried it with your test installation.
There is still that problem, only when you're using the browser button.

That's why I wanted to use the PayPal express checkout.

TR’s picture

Version: 8.x-4.0-alpha4 » 8.x-4.x-dev
Priority: Critical » Normal

Yes, I'm able to reproduce this. It looks like a caching problem - Drupal 8 caches everything by default unless you explicitly tell it not to, which means applications like e-commerce which use volatile data are subject to this kind of problem.

rolfo85’s picture

So could it be fixable?

david.czinege’s picture

Status: Active » Needs review
FileSize
532 bytes

I created a patch, which set senssion's uc_cart_order_rebuild parameter to TRUE in the cart form's submitForm method. After that the checkout page will be rebuilt.

longwave’s picture

This should fix it for now, though we should perhaps refactor much of the cart -> order code.

longwave’s picture

Hah, great timing, and an identical fix!

The last submitted patch, 10: 2787509-cart-update-qty-test-only.patch, failed testing.

longwave’s picture

Status: Needs review » Fixed

Committed - @david.czinege I gave you author credit as you posted first.

david.czinege’s picture

Haha :) Thank you!

rolfo85’s picture

Thank so much

Status: Fixed » Closed (fixed)

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

rakun’s picture

This is issue for D7 and ubercart 3.x also. Problem can be reproduced as anonymous user with steps mentioned above.
Should I create new post for this issue on D7, or reopen this one?

TR’s picture

Version: 8.x-4.x-dev » 7.x-3.x-dev
Status: Closed (fixed) » Patch (to be ported)

Patch in #10 (including test) should be backported to 7.x-3.x. I'm not sure why this wasn't done before ...