Bug: Shipping costs (variable rate) not recalculated when cart changed

Marco Nguitragool, modified 11 Months ago.

Bug: Shipping costs (variable rate) not recalculated when cart changed

New Member Posts: 6 Join Date: 9/13/24 Recent Posts

Short description

Shipping costs may depend on weight or other conditions. Liferay calculates the shipping costs correctly, when performing a checkout, but does not recalculate them, if the user aborts the checkout, modifies the data and then returns to the checkout. Instead, the shipping costs seem to be cached and the cache becomes stale.

How to reproduce

Back-office

Configure variable rate shipping costs via Commerce => Channel => Edit => General => Shipping methods.


As you see in the screenshot above, I have disabled the "Flat rate" and use only the "Variable rate" shipping-engine.

There you click "Edit" and you configure multiple options (I guess it also works with a single option, but this is the configuration I have):


...and you configure the "Shipping Option Settings" accordingly:


Each of these settings defines a different price and a different weight-range. Here's an example:


This means, I have now 3 different shipping options applicable to 3 different weight-ranges:

  • 0g-490g => 52 THB
  • 491g-990g => 82 THB
  • 991g-1990g => 150 THB

Of course, your products need to be configured with the correct weight. So for example, this piece of chocolate has a weight of 110g:


 

Web-shop

As a customer, you add said product with quantity 10 to the cart. 10 * 0.11kg = 1.1 kg. Hence, we expect the delivery costs to be 150 THB. Starting a checkout shows exactly this expected result in the "Order summary":


Now, you click on the cart icon or the "My Cart" menu item and change the quantity to 4. The weight is now 4 * 0.11 kg = 0.44 kg. We thus expect the delivery costs to drop to 52 THB. So we go into the checkout again, continue as a guest, click through the process until the order summary:


Now, it shows the delivery costs still to be 150 THB, which is wrong, and it does not show the "Method" on the right side, anymore.

If we delete the products from the cart, i.e. we make the cart completely empty. Then re-add the article with quantity 4 and go to the checkout, the delivery costs are calculated correctly and the "Method" is shown again (with the correct data):


​​​​​​​The same bug also appears when I change the prices depending on the destination-country. Once, the delivery costs are calculated, they are not updated. Even when going back to the shipping-address, switching to an address in another country, and then go forward to the order summary, again. The old value for the 1st country still stays.

This is fraud potential! This bug is IMHO urgent!

Liferay version

Liferay Community Edition Portal 7.4.3.120 CE GA120 (June 12, 2024)

 

thumbnail
Jamie Sammons, modified 10 Months ago.

RE: Bug: Shipping costs (variable rate) not recalculated when cart changed

Expert Posts: 367 Join Date: 9/5/14 Recent Posts

Bug Report Created: https://liferay.atlassian.net/browse/LPD-39418

thumbnail
Jamie Sammons, modified 9 Months ago.

RE: RE: Bug: Shipping costs (variable rate) not recalculated when cart changed

Expert Posts: 367 Join Date: 9/5/14 Recent Posts

Hi Marco,

This should be fixed with https://liferay.atlassian.net/browse/LPD-34409 and will be available in the next CE quarterly release.

Thanks,
​​​​​​​Jamie

Marco Nguitragool, modified 7 Months ago.

RE: RE: Bug: Shipping costs (variable rate) not recalculated when cart changed

New Member Posts: 6 Join Date: 9/13/24 Recent Posts

Thanks a lot! 🙏 I gave it a short test and it seems to work fine, now. 🥳 I'll let you know, if a more thorough test still reveals any problem.

Wish you a great, healthy, successful and fulfilled new year 2568!

Community
Company
Feedback