I have a different store when I am changing the store it redirects to the home page but I want to redirect to the same page where store changed in Magento 2 I have written this code

?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $conf = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue("web/unsecure/base_url");

through this code it redirects to home page

  • That's default magento2 behavior and working fine for me on latest magento 2.3.1, however if you are using older version there's a bug for that. Please, check that answer magento.stackexchange.com/a/259996 . – electroid May 4 '19 at 10:12
  • Did you create corresponding pages for each store? – soofz May 4 '19 at 10:16
  • no pages are same only store will different – Ashish Ramchandani May 4 '19 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.