Skip to content

collect-totals API call not updating the selected shippingMethod #18508

Closed
@rikterbeek

Description

@rikterbeek

If you use the API endpoint

PUT /V1/guest-carts/{cartId}/collect-totals
{code}
 on an empty quote it all goes fine. But if you want to update the endpoint again to update the shippingMethod the old ShippingMethod is used for the totals.

### Preconditions
2.2.3

### Steps to reproduce
1. Call the PUT /V1/guest-carts/{cartId}/collect-totals endpoint with this data:
{code}
{"shippingMethodCode":"flatrate","shippingCarrierCode":"flatrate","paymentMethod":{"method":"checkmo"}}
{code}
1. Call the PUT /V1/guest-carts/{cartId}/collect-totals endpoint with this data:
{code}
{"shippingMethodCode":"freeshipping","shippingCarrierCode":"freeshipping","paymentMethod":{"method":"checkmo"}}

Expected result

  1. Totals are updated with the new shippingMethod

Actual result

  1. Totals are from the old shippingMethod.

It looks like it has to do that on the second call the setShippingAssignments() is not updated and this causes that the totals are using the old shippingMethod.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: Framework/ApiUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog Service Contracts use just CatalogComponent: Framework/WebapiUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just CatalogComponent: WebapiUse with concrete module component label E.g. "Component: Webapi" + "Catalog"Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions