Question

I am getting requested store not found error while registration does anyone have idea about this ?

Was it helpful?

Solution

It can be solved by modifying StoreManager.php (/vendor/magento/module-store/Model/StoreManager.php)

If $storeId is not defined: It retrieve data from COOKIE first, otherwise return the default store code.

so what you need to do is just replace these lines of codes

if (!isset($storeId) || '' === $storeId || $storeId === true) {
     if (null === $this->currentStoreId) {
\Magento\Framework\Profiler::start('store.resolve');
         $this->currentStoreId = $this->storeResolver->getCurrentStoreId();    \Magento\Framework\Profiler::stop('store.resolve');
     }
     $storeId = $this->currentStoreId;
 }

with this

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

i hope this will solve your issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top