I have set the different Base Url for different website views, so How to get the baseUrl for a different websites with getBaseUrl() function.
~~ Thank you in advance!
I have set the different Base Url for different website views, so How to get the baseUrl for a different websites with getBaseUrl() function.
~~ Thank you in advance!
Copyright © 2021 Jogjafile Inc.
You can get BaseUrl by store object. So you will have to first load the store from website. Check below generic code which will give all website's base URLs.
If you are using constructor you can directly use \Magento\Store\Model\StoreManagerInterface $storeManager instead of objectmanager.