The MDVA-34469 Magento patch solves the issue where users get the error message: Wrong store code specified for cart when adding a product to the cart after switching store views.
This patch is available when the Quality Patches Tool (QPT) 1.0.15 is installed. Please note that the issue is scheduled to be fixed in Magento 2.4.2.
Affected products and versions
The patch is created for Magento version:
Magento Commerce Cloud 2.4.1.
Compatible with Magento versions: Magento Commerce Cloud and Magento Commerce 2.4.1, 2.4.1-p1.
Note: the patch might become applicable to other versions with new QPT tool releases. To check if the patch is compatible with your Magento version, run
./vendor/bin/magento-patches status .
The user sees a cart query error, "Wrong store code specified for cart", when trying to switch store views.
Steps to reproduce:
- Magento 2.4.0.
- Single website with a single store and two store views is configured.
- A customer account is created.
- Magento backend is configured to have 2 store views (with store codes: default, second).
- The user creates a shopping cart using the default store code.
- The user tries to retrieve this cart using the second store code in theStorerequest header.
Actual result: The cart query returns an error and the cart does not display.
The cart displays because switching the store (sending the new code in the
Store request header) associates the cart to the requested store.
Apply the patch
For instructions on how to apply an QPT patch, use the following links depending on your Magento product:
- Magento Commerce: DevDocs Apply patches using Quality Patches Tool .
- Magento Commerce Cloud: DevDocs Upgrades and Patches > Apply patches .
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool released: a new tool to self-serve quality patches .
- Check if patch is available for your Magento issue using Quality Patches Tool .
For info about other patches available in QPT tool, refer to the Patches available in QPT tool section.