Instagram

About Me

Photo Profile
Meetanshi Architecture Designer

Meetanshi is found based on providing the best Magento Extensions and Customized eCommerce Business Solutions perfected to the users’ needs. Our Happy users make us Happy. Complete satisfaction to our clients is what drives and motivates us to work hard. Read More

Tuesday, June 28, 2022

How to Get All Stores’ List by Website ID in Magento 2

Magento 2 supports building multiple stores and managing them using a single admin panel. If you are a developer working on a custom module, sometimes you may require to get all stores’ list by website ID in Magento 2 to implement store-wise functionalities.


Suppose you have created different stores for different countries in Magento 2 and want to show country-wise currencies. For example: You want to set the $USD as default currency for the US store and £ for the UK store. In such case, you may require to get all store’s list by website ID in Magento 2.


The solution is to use the getStoresList function in the root Data.php file to get the list of all stores by website ID. 


You can read the complete solution at https://meetanshi.com/blog/get-all-stores-list-by-website-id-in-magento-2/

No comments:
Write comments


Get more of our update !