My website is with Three different Stores
and I'd like to disable the cart sharing
feature between stores. So when I switch from one store to the other store, the product in my cart shouldn't be valid or not display to another store.
Product added to the specific store should be displayed on the specific store only.
Best Answer
I'm not sure if this works, it's just an idea: The quote has the functionality to specify the stores which are sharing the quote. By default this are all stores of a website. Anyway if it is possible to set a list of spefic stores before loading the quote, I think it is possible to restrict the quote to a subset of all stores of a website, in your case just to the actual store.
One idea could be to set the store restriction in a plugin before the
get
method inMagento\Quote\Model\QuoteRepository
, which should always be called when a quote is loaded.Again, it's just an idea which might not work and the code is not tested and just to demonstrate my thoughts.
Looking forward to hearing what you think about this approach.