How to setup stores and website using config.php file Magento 2?

config.php file in Magento contains the list of installed modules, Website, Store related setup, Locales, and system configuration settings.

You can see the config.php file location at the given path, app/etc/config.php

I will just highlight the Scopes section of the config file.

There will be different sections to be used within the config.php file.h

1. modules (Out of the box modules section contains the List of Modules available.)
2. scopes (This section contains the stores, store groups, and websites related information.)
3. system (This section is used to set system configuration value.)
4. themes (This section is used to setup themes related information.) Continue reading “How to setup stores and website using config.php file Magento 2?”

How to Retrieve Store code by cookie Magento 2?

You can get the current store code from the browser cookie using Magento.

Sometimes you required to detect store code before any request generated in a store and that time you will help this article. You can check the current store code in beforeDispatch() method of the request and verify for the current store code. Continue reading “How to Retrieve Store code by cookie Magento 2?”

Retrieve Store data by code programmatically Magento 2.

You can retrieve the store details by store code using Magento 2.

You required only store code to fetch data of the store. If store code is not valid throws the error,

The store that was requested wasn’t found. Verify the store and try again2.

Continue reading “Retrieve Store data by code programmatically Magento 2.”