Page 1 of 1

Solved: Opencart Multi store with multi domain

Posted: Mon Mar 26, 2018 5:31 am
by Tomit
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 ( and wish to use it on my existing open cart shop installation with it's own store front (

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
I added the second store url & config in the opencart backend, created a category specially for and added one of the products to that category.

I would expect when I now visit that I get to see the same theme (for now) with 1 category with 1 product. but I keep seeing the content.

It looks like for some reason it doesn't recognise me being on the new url and just presenting me the 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.

Re: Solved: Opencart Multi store with multi domain

Posted: Mon Mar 26, 2018 5:59 am
by Tomit
ok, I found the solution, after hours of digging, the problem was catalog/controller/startup/startup.php was being cached in the storage/modification folder (but not in the public_html storage folder, where I look the first time, which was empty, but in the storage folder outside of the public root dir. ::) )

dumping the query that checks if the used domain is in the store table, showed me in the query there is a trailing slash after the domain for some reason...
SELECT * FROM store WHERE url = ''

for now I added it in the store url setting (opencart backend -> settings) and voila, opencart found my new store, and displayed the category I added...

Re: Solved: Opencart Multi store with multi domain

Posted: Sat Mar 07, 2020 1:21 am
by nudylady
yes, you helped