ACP2E-4973: Switching from In-Store Delivery to another delivery method does not clear store address from cart
The ACP2E-4973 patch fixes the issue where switching from In-Store Delivery to another delivery method doesn’t clear the store address from the cart. This patch is available when the Quality Patches Tool (QPT) 1.1.86 is installed. The patch ID is ACP2E-4973. Please note that this issue is scheduled to be fixed in Adobe Commerce 2.4.10.
Affected products and versions
The patch is created for Adobe Commerce version:
- Adobe Commerce (all deployment methods) 2.4.8-p5
Compatible with Adobe Commerce versions:
- Adobe Commerce (all deployment methods) 2.4.8-p1 - 2.4.8-p5
magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.Issue
Switching from In-Store Delivery to another delivery method doesn’t clear the store address from the cart.
Prerequisites:
Inventory Management (Multi-Source Inventory) and In-Store Pickup.
Steps to reproduce:
-
In the Admin, go to Stores > Inventory > Sources and click Add New Source. Enter a Name and Code, enable Use as Pickup Location, enter the Phone under Contact Info, enter the Country, State/Province, City, Street, and Postcode under Address Data, and save the source.
-
Go to Stores > Inventory > Stocks and click Add New Stock. Enter a Name, select the website under Sales Channels, assign the new source under Sources, and save the stock.
-
Go to Catalog > Products and create a simple product. In the Sources section, click Assign Sources, select the new source, enter a positive Qty, and save the product.
-
Go to Stores > Settings > Configuration > Sales > Delivery Methods, expand In-Store Delivery, set Enabled to Yes, and click Save Config.
-
Using GraphQL as a registered customer, generate a customer token (
generateCustomerToken), get the cart ID (customerCart), and add the product to the cart (addProductsToCart). -
Set the cart shipping address to the pickup location by sending only the source code in
pickup_location_code:code language-none mutation { setShippingAddressesOnCart(input: { cart_id: "<cart_id>" shipping_addresses: [{ pickup_location_code: "<source_code>" }] }) { cart { shipping_addresses { pickup_location_code firstname lastname street city postcode } } } } -
Switch the cart to Flat Rate and check
shipping_addressesin the response:code language-none mutation { setShippingMethodsOnCart(input: { cart_id: "<cart_id>" shipping_methods: [{ carrier_code: "flatrate", method_code: "flatrate" }] }) { cart { shipping_addresses { pickup_location_code firstname lastname street city postcode } } } } -
Set a billing address (
setBillingAddressOnCart) and a payment method (setPaymentMethodOnCart, for examplecheckmo), then runplaceOrderwithout setting a new shipping address.
Expected results:
- After the switch to Flat Rate,
pickup_location_codeand the pickup store address are removed from the cart shipping address. - You can’t place the order until you set a valid home delivery shipping address with
setShippingAddressesOnCart.
Actual results:
- After the switch to Flat Rate, the cart shipping address still contains
pickup_location_codeand the pickup store address. - The order is placed. In Sales > Orders, the shipping address of the order is the pickup store address, although the delivery method is Flat Rate.
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- Adobe Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide
- Adobe Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in the Commerce on Cloud Infrastructure guide
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool: A self-service tool for quality patches in the Tools guide