I think this happens because on clicking the "Shopping Cart" button the controller Adminhtml/Index/Cart is called. But Adminhtml/Index/Carts handles the shared account config and create multiple grids with the correct website id.

Hi @bernd-reindl. Thank you for your report.
To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance - upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
@bernd-reindl do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
@magento give me 2.4-develop instance
Hi @bernd-reindl. Thank you for your request. I'm working on Magento 2.4-develop instance for you
Hi @bernd-reindl, here is your Magento instance.
Admin access: https://i-26921-2-4-develop.instances.magento-community.engineering/admin_f5f1
Login: 71b4736a Password: 89854edda769
Instance will be terminated in up to 3 hours.
Additionaly if a customer has products in his quote with store_id > 1 this cart is not shown in backend.
See Customer 2 in instance https://i-26921-2-4-develop.instances.magento-community.engineering/admin_f5f1. This customer has products in quote with store_id 2. But the shopping cart Tab shows only an empty cart.


Already argued with the Enterprise support about it. Debugging clearly shows it cannot work for a multiwebsite/store setup with shared customers.
Only one active cart could be handled by the code, but it actually tries to load the quote for store id 0, for which no active quote exists, so in the aftermath getAllItems() is called on a mostly unfiltered quote item collection and returns all quote items given in the database.
I have solved it by three modifications.
return $this->getUrl('customer/*/carts', ['_current' => true]);
not
return $this->getUrl('customer/*/cart', ['_current' => true]);
customer/*/cart(s) handle all store_ids
I also think that ShoppingCartsTab should be part of module-quote not module-sales.
$this->quote = $this->quoteFactory->create()->setId(-1)->setSharedStoreIds($storeIds);
not
$this->quote = $this->quoteFactory->create()->setSharedStoreIds($storeIds);
If getId() return null, $quote->getItemsCollection(false) returns a collection with no quote filter and all QuoteItems are shown. See _prepareCollection()
The if block in _prepareCollection() is not required, because $this->getQuote() allways return a qoute.
If the cache key is only the customerId, and the function was called with diferent sharedStoreIds, always the quote with the first requested storeIds is returned.
So the cache key has to contain the sharedStoreIds.
E.G.
$cacheKey = $customerId.'-'.implode('-', $sharedStoreIds);
if (!isset($this->quotesByCustomerId[$cacheKey])) {
$quote = $this->loadQuote('loadByCustomer', 'customerId', $customerId, $sharedStoreIds);
$this->getLoadHandler()->load($quote);
$this->quotesById[$quote->getId()] = $quote;
$this->quotesByCustomerId[$cacheKey] = $quote;
}
return $this->quotesByCustomerId[$cacheKey];
Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
[ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop branchDetails
- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 5. Add label Issue: Confirmed once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hello @bernd-reindl
Thank you for your report
I have rechecked this issue on 2.4-develop, and I'm getting the same result you've mentioned in this screenshot, no cart at all.
This looks like another issue. But what about the initial one? If I understood your comment correctly, you were not able to reproduce the initial issue on 2.4-develop, is that correct?
Thank you in advance
Hello @bernd-reindl
Thank you for your report
I have rechecked this issue on 2.4-develop, and I'm getting the same result you've mentioned in this screenshot, no cart at all.
This looks like another issue. But what about the initial one? If I understood your comment correctly, you were not able to reproduce the initial issue on 2.4-develop, is that correct?Thank you in advance
Of course i can reproduce it on 2.4-dev.
And i already have solved the problem. See my comment from 20. February, 11:17 MEZ.
:white_check_mark: Confirmed by @engcom-Bravo
Thank you for verifying the issue. Based on the provided information internal tickets MC-32168 were created
Issue Available: @engcom-Bravo, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._
I have also faced same issue. But most easy and quick solution is overriding getQuote() function as below :
protected function getQuote()
{
if (null === $this->quote) {
$customerId = $this->getCustomerId();
$customer = $this->_customerRepository->getById($customerId);
$storeIds = $this->_storeManager->getWebsite($customer->getWebsiteId())->getStoreIds();
try {
$this->quote = $this->quoteFactory->create()->setSharedStoreIds($storeIds)->loadByCustomer($customerId);
} catch (NoSuchEntityException $e) {
$this->quote = $this->quoteFactory->create()->setSharedStoreIds($storeIds);
}
}
return $this->quote;
}
This issue was coming due to customer website is not getting correctly from backend and so the store Id.
Try this out!!!!
Most helpful comment
I can confirm we are having this issue too. On Magento 2.3.3 Multi Website / Multi Storeview