You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Anil K Patel (Jira)" <ji...@apache.org> on 2026/07/01 13:38:00 UTC

[jira] [Commented] (OFBIZ-2741) Information of shipping method and sales tax are remove from cart when we update shopping cart item quantity.

    [ https://issues.apache.org/jira/browse/OFBIZ-2741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18092959#comment-18092959 ] 

Anil K Patel commented on OFBIZ-2741:
-------------------------------------

Reproduced on current trunk with fresh demo data, on the ecommerce store as DemoCustomer. Add one physical product (WG-1111) to the cart, go to checkout and pick a shipping address and a shipping method (UPS Ground), so the cart now has a selected method and a computed shipping and tax total. Then go back to the cart and change the item quantity. After the update the shipping method is no longer selected - you have to choose it again - and the shipping and tax amounts that were worked out for the old quantity are still sitting in the order total unchanged, rather than recomputed for the new quantity.

What happens is in ShoppingCartHelper.modifyCart: when the quantity changes on a product where shipping applies and the ship group already has a shipping address, it deliberately sets that ship group's shipmentMethodTypeId to null. The item quantity is then updated with resetShipGroup = false, so the existing ship group info - the shipping estimate and the tax adjustments - is left in place. So the selected method is dropped, but its shipping and tax figures are not, and they go stale.

One thing on the original report - I didn't find this to be about there being a single item in the cart. What actually triggers it is the ship group already having a shipping address when the quantity changes, which is the normal state once you've been to checkout. The behavior has also drifted since 2009: back then the info was removed outright, whereas today the method is cleared but the shipping and tax amounts are retained at their old values, which is arguably worse, because the total is quietly wrong until the customer runs the checkout again.

The reset itself looks intentional - a changed quantity does make the previous shipping estimate stale, so forcing a fresh selection is defensible. The real problem is that we clear the method but not its now-stale shipping and tax, so the cart is left inconsistent.

My recommendation is the other way round: keep the customer's selected shipping method on a quantity change, and clear only the now-stale shipping estimate and tax for that ship group so they get recomputed for the new quantity, which the checkout flow already does on the way to placing the order. The method the customer chose is still perfectly valid - only its price changes with quantity - so there is no reason to discard the selection and make them pick it again, and clearing the stale amounts keeps the total honest in the meantime.

If anyone sees a problem with that direction, please say so. Otherwise I'll put up a patch along these lines in a few weeks.


> Information of shipping method and sales tax are remove from cart when we update shopping cart item quantity.
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-2741
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2741
>             Project: OFBiz
>          Issue Type: Bug
>          Components: ecommerce
>    Affects Versions: Release Branch 09.04, Trunk, Upcoming Branch
>            Reporter: Arun Patidar
>            Priority: Minor
>         Attachments: OFBIZ-2741.2.patch, OFBIZ-2741.patch, OFBIZ-2741.patch, sci-patch.txt
>
>
> On update cart item quantity after selecting shipping method, Informations of shipping method and sales tax  removes if there is only one item in cart.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)