OpenCart Multi-Store setup on localhost

Hi Everyone,

Have you ever used OpenCart script for shopping cart? Its really fantastic I liked it. Anyway if you have ever used it do you know it provides the multi-store functionality (i.e. you can setup multiple store using a single instance).

Now for the first time offcourse many of us (web developers) will try to install it on our local machine rather than server. But how to setup multiple stores on localhost. No idea? okay here we go:

I assume that you have
XAMPP for Windows
XAMPP installation directory is : C:\xampp
OpenCart Store directory: C:\xampp\htdocs\store
and the Main Store URL is: http://localhost/store

1. So first you have to do is edit Apache Configuration File (to create Alias for each store)

Open the Apache configuration file (C:\xampp\apache\conf\extra\httpd-xampp.conf) and find the section that starts with “”, and insert the following lines inside this section:-

Alias /store1 "C:/xampp/htdocs/store/"
Alias /store2 "C:/xampp/htdocs/store/"

Then restart your Apache server from the XAMPP control panel or xampp_restart.exe.

Here you can see both aliases point to the same directory – your main store’s directory. This would be the same for any other “sub” store you may wish to create.

2. OpenCart Configuration
Now Log in to your administration (http://localhost/store/admin) and from the menu, select “System->Settings” and create 2 new stores. You can call them whatever you want.
Give one a Store URL of “http://localhost/store1/” and the other a Store URL of “http://localhost/store2/”.

That’s it.

You should now be able to access your new stores at “http://localhost/store1” and “http://localhost/store2”, with your main store still at “http://localhost/store”.

Have fun!