Solved: Opencart 3.0.2.0 Multi store with multi domain
Posted: Mon Mar 26, 2018 5:31 am
Hi guys, I thought this would be easy, but I'm 3 hours in with no luck whatsoever. the problem:
I have a second domain (domainB.com) and wish to use it on my existing open cart shop installation with it's own store front (domainA.com)
I added the dns records, to point the domain to my vps
I edited added it's own virtual host file, with the document root pointing to the installation of domainA.com
I added the second store url & config in the opencart backend, created a category specially for domainB.com and added one of the products to that category.
I would expect when I now visit domainB.com that I get to see the same theme (for now) with 1 category with 1 product. but I keep seeing the domainA.com content.
It looks like for some reason it doesn't recognise me being on the new domainB.com url and just presenting me the domainA.com site
(I can confirm this when I print config_store_id which = 0)
I have been browsing the opencart code for 2 hours, looking where the config_store_id is being set, to try and trackback why it isn't recognizing my new domain, but I can't seem to find the right location, the only code I find is in catalog/controller/startup/startup.php but that code never seems to get called.
If anyone can tell me where the config_store_id is being set that would help out a lot.
I have a second domain (domainB.com) and wish to use it on my existing open cart shop installation with it's own store front (domainA.com)
I added the dns records, to point the domain to my vps
I edited added it's own virtual host file, with the document root pointing to the installation of domainA.com
I added the second store url & config in the opencart backend, created a category specially for domainB.com and added one of the products to that category.
I would expect when I now visit domainB.com that I get to see the same theme (for now) with 1 category with 1 product. but I keep seeing the domainA.com content.
It looks like for some reason it doesn't recognise me being on the new domainB.com url and just presenting me the domainA.com site


I have been browsing the opencart code for 2 hours, looking where the config_store_id is being set, to try and trackback why it isn't recognizing my new domain, but I can't seem to find the right location, the only code I find is in catalog/controller/startup/startup.php but that code never seems to get called.
If anyone can tell me where the config_store_id is being set that would help out a lot.