Post by Tomit » 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.

Image


New member

Posts

Joined
Sat Sep 14, 2013 9:54 pm
Location - Netherlands

Post by Tomit » Mon Mar 26, 2018 5:59 am

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 = 'domainB.com/'

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...

Image


New member

Posts

Joined
Sat Sep 14, 2013 9:54 pm
Location - Netherlands

Post by nudylady » Sat Mar 07, 2020 1:21 am

yes, you helped

New member

Posts

Joined
Sun Feb 19, 2012 12:14 am
Who is online

Users browsing this forum: No registered users and 121 guests