Pergunta

In magento 2.2, I have 2 store in my website. When, I switch to default store to other store. Then, it will display error like this

1 exception(s): Exception #0 (Magento\Framework\Exception\NoSuchEntityException): Requested store is not found

How can I solve this??

Please help me.

Foi útil?

Solução

At line 164 add the below code of Magento\Store\Model\StoreManager:

    if(!$storeId){
        if(isset($_COOKIE['store']) && $_COOKIE['store'] !== ''){
            $storeId = $_COOKIE['store'];
        } else {
            $storeId = $this->getDefaultStoreView()->getCode();
        }           
    }

And then, change 155 line of Magento\Store\Model\StoreManager

=> FROM :

if (null === $this->currentStoreId) {

=> To :

if (null === $this->currentStoreId || '' === $this->currentStoreId) {

Outras dicas

You can see the notes on https://github.com/magento/magento2/issues/11453. I ran into same issue for magento 2.2.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange
scroll top