Magento Multistore Setup on Localhost

Often developers use local server to test before deploying the code in the real server. Magento multi-store configuration is one of the strengths of Magento that sets up itself apart from many other free e-commerce framework. Here is the configuration guide to setup Magento multistore under the same domain on the localhost.

1. Localhost Configuration – Follow the following instruction for your localhost (if you yet to set up Magento on localhost, see previous article on how to setup Magento on localhost using AMPPS.
A. Create a directory under root. Say the name of the directory is localSubstore1. Copy index.php and .htaccess from the parent folder (root) and place in the substore1. Make the following changes in the .htaccess file.

SetEnvIf Host localhost MAGE_RUN_CODE=localSubstore1
SetEnvIf Host localhost MAGE_RUN_TYPE=website

B. Open index.php (under localSubstore1) and change the mageFilename as :

$mageFilename = ‘../app/Mage.php';

2. Magento Multistore Setup using Magento Admin dash board

Follow the instruction to set up Magento Multistore:
A. Create Category – After logging into Magento Admin panel, go to Catalog -> Categories -> Manage Categories and can create a new root category for your store. Note that Magento does not show the root category. So any category that needs to be displayed on the menu, needs to be under root category.
B. Create website – Go to System -> Manage Stores, click on create website.
Name : Name of the store website (eg. localSubstore1.com)
Code : Needs to match Apache configuration and directory (eg. localSubstore1)

C. Create Store – Go to System -> Manage Stores, click on create store.
Website – select the website you created in step B (localSubstore1.com)
Name – Name of the store view (e.g. localSubstore1)
Root Category – Select the root category you created in Step A from the drop down menu.

D. Create Store View – Go to System -> Manage Stores, click on create store view.
Store – select the store you created in step C (localSubstore1)
Name – Name of the store view (e.g. English)
Code – Code for the store view (e.g. localSubstore1_en)
Status – select Enable

(This section has been created following the article http://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup)

3. Magento Multistore configuration – System Configuration

A. Go to System ->Configuration->web. The Base URL should be same as your localhost magenta setup.  You do not need to modify anything here.

B. Go to System->Configuration->Design.  Select the package and theme for your store website and store view.

4. Magento Multistore Homepage setup

Go to CMS->Pages.  Create a new home page for the store.

Select Page Information. Fill

Page Title – Name of your home page title (e.g. Home page-Local Store)

url key : url key of the store (e.g home/localSubstore1)

Store view : store view of the store (e.g. English)

Content – Add content you desire.

Design – Select the layout and the Custome theme you selected for your store.

You are all done.  Now you can access your store by going

http://localhost/your-localMainstore/localSubstore1/

Installing Magento on Local Server and AMPPS

Recently I decided to switch from MAMP to AMPPS for local development in Mac after reading various articles.

Installing/Uninstalling AMPPS in MAC is very easy and almost effortless. The AMPPS installation guide explains it very well. Uninstalling AMPPS on mac is just removing the directory AMPPS.

While working with AMPPS, I did run into the issue of mysql is not starting few times. After searching on this topic, I followed the following the thread and deleted mysql-bin.* mysql-bin.index, ib* from /Applications/AMPPS/var/ and restarted mysql
(http://www.softaculous.com/board/index.php?tid=4098&tpg=all&title=MySQL_not_starting_up)
In one occasion, it worked alright and I could start mysql.

However, in a different occasion, even after removing the above mentioned files, mysql will still not start (restarted apache, ampps). In this scenario, I had to delete AMPPS installation, re-install the AMPPS folder in the Application folder of mac and restarted mac. It worked like a charm.

While installing manually installing Magento, Magento expected php extension like php_ctype_alnum, php_iconv and php_mycrypt. I downloaded php_mycrypt.dll from http://www.nodevice.com/dll/php_mcrypt_dll/item13726.html , untared and unzipped and placed the .dll file in ampps/php/ext. Then I went to Ampps control center, clicked on php->Php Extension. In Php Extension, I enabled mcrypt.so.
The other two php extensions are available in Ampps. I needed to enable the php extensions ctype.so and iconv.so by going to Ampps->Php-> Php Extension.

After this, Magento installed without any issue.

Free Zen Cart E-commerce Template – Biki-kini – Go Green

Demo available at : Bikikini – Go green Demo

Download the plugin

Before installing please read carefully bikikini_readme.html file located at the readme folder.

Free support is available in Zen Cart Support thread. For more personalized support, contact us for a quote.
If you like our template, consider buying us a cup of tea.