3

I think you have to look into the core Magento unit test code how they use and get base URL. I am not sure about this is what I shared is exactly you want, but I think it will help you. Look into the Magento core test module. vendor/magento/module-cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php Find the function public function testGetBaseUrl() inside this ...


3

namespace Star\Trek\Test\Unit\Model; class BeyondTest extends \PHPUnit\Framework\TestCase { protected $_storeManager; public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, ) { $this->_storeManager = $storeManager; } /** * Prining URLs using StoreManagerInterface ...


3

I think before calling getBaseUrl() you need to set your current store then you can get correct URL. $this->storeManager->setCurrentStore($storeId); Where $storeId is your store Id which you want the base URL.


2

http://localhost/phpmyadmin/index.php Open core_config_data table in database web/unsecure/base_url => http://127.0.0.1/magento232/ web/secure/base_url = > https://127.0.0.1/magento232/ see attched image Then run command in terminal/putty php bin/magento cache:clean php bin/magento cache:flush php bin/magento indexer:reindex php bin/magento setup:...


2

I know maybe this isn't the answer you are expected but I have a different docker compose file for each project. Once I've finished working on one project I docker-compose down -v project, switch to my working copy in my other project and docker-compose up -d Each project has it's own set of containers which build up a lamp stack. So own db container. But ...


2

For question number 1: — You can go to docker-compose file and look for apache service then change port to something like 8085:80 then your project baseURL would be like 127.0.0.1:8085 or http://localhost:8085/ For question number 2: — I believe, 1 docker file for 1 project only. Otherwise, you need to create another docker file for another project.


2

mage/url widget is not used to fetch backend base URL in Magento 2. You need to create a template file using layout XML and define the base URL of backend under the template file. You can define any Global variable and set your URL in it. Create a simple layout XML file to fetch backend URL of the site using JS, Create default.xml file for global ...


1

In phtml file add this code: <input type="hidden" id="testUrl" value="<?php echo $this->getUrl(); ?>"/> By using Id we can get base url in JS file $("#testUrl").val(); Hope it will help


1

See table (core_config_data) in your database. Search below paths under path column: (web/unsecure/base_url) and set Url without https. (web/secure/base_url) and set Url with https. After that your website will work fine.


1

all you need is to create your store/website in magento, define base url. add DNS record and point to your ip address. in nginx or htaccess write store code assigned to your new shop view: https://devdocs.magento.com/guides/v2.3/config-guide/multi-site/ms_over.html https://devdocs.magento.com/guides/v2.3/config-guide/multi-site/ms_websites.html Each ...


1

Please check all below steps: First off all see that the database is exported to the new server. Then transfer the magento root files to the new server. In the root folder, change to the new database. You can do this by going to app/etc/env.php and changing the DB array information. change the host, dbname, username and password to the new one. Then you ...


1

Sometime it is a hosting settings issue - its try to find "static" folder directly in magento root "/" but not in "pub/" To fast fix it try to make symbol link in magento root directory $ ln -s pub/static static


Only top voted, non community-wiki answers of a minimum length are eligible