0

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

asked Jun 24, 2020 at 6:55

1 Answer 1

1

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.

answered Jun 24, 2020 at 7:26
3
  • Thanks , it is working , but for my second website this code redirect to default website page Commented Jun 24, 2020 at 10:54
  • i think you need to customize store according to your requirements sir Commented Jun 24, 2020 at 11:03
  • refer my ans here may be this could be a help for you magento.stackexchange.com/questions/292933/… Commented Jun 24, 2020 at 11:23

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.