Multiple stores in Magento

Hi guys,

I am trying to setup another website/storefront for my Magento website. The website will share all products and categories etc..

I have a template and have created the modules etc and everything is showing in my admin. The problem is I am not sure how to assign the new website/storefront to the template and then have it direct to the url example.com/drtv. I would really like some assistance please.

Are there any good tutorials for doing this in Magento CE 1.7.0.2?

Thanks guys...
rafique12Asked:
Who is Participating?
 
GaryCommented:
Weird...
Can you change $mageFilename  to the full path which I believe in your case is (with the proper site address)
MAMP/htdocs/example.com/app/Mage.php

and see if there is any more errors.
0
 
GaryCommented:
In Admin goto Sytem/Design
Select your new store and set the design

This is a subdirectory of your main site?
0
 
rafique12Author Commented:
Yes its a subdirectory that will only be available to sales staff...
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
rafique12Author Commented:
I will need to be able to browse to the new store using example.com/drtv but I am not sure how to do this?!?!
0
 
GaryCommented:
Under Configuration/Web set the url's there
0
 
rafique12Author Commented:
I'm just getting redirected to 404 error page...!
0
 
GaryCommented:
Just to be clear have you installed a seperate installation of magento in a sub directory?
0
 
rafique12Author Commented:
No, I just the one Magento installation. I require a seperate website which shares the same products etc as the main site.

The new website will only be accessed by staff to place orders etc...
0
 
GaryCommented:
Have you copied the index and .htaccess file to the subdirectory? If not do this.
Amend the following lines in this copied index.php

$mageRunCode = 'store_code';
$mageRunType = 'website';

So they represent your new store_code and website name
0
 
rafique12Author Commented:
Still get a 404 error, page not found
0
 
GaryCommented:
access the folder and use index.php
0
 
rafique12Author Commented:
MAMP/htdocs/example.com/drtv/app/Mage.php was not found

That's the message I get when I access: example.com/drtv/index.php

I have no idea about how to get this to work. I've created a 'website' , 'store' and 'store view'
changed the base urls for the new store and copied the index.php file into the folder underneath the root folder 'example.com' so it should be 'example.com/drtv/index.php'

This isn't working :-(
0
 
rafique12Author Commented:
Quick update:

I'm no longer getting the error message. There was an option in magento admin to add store code to urls which got it working.

However, I've assigned the theme for the new store but I am getting a blank screen...?!?!?
0
 
GaryCommented:
Thought i had already said this (but I didn't) but in index.php in your subfolder change

$mageFilename = 'app/Mage.php';
to
$mageFilename = '../app/Mage.php';
0
 
rafique12Author Commented:
Thanks I have already done this I had to make the path:
'/../includes/config.php'

and

'/../app/Mage.php'

I no longer get the message but just a blank screen now that I have assigned the theme for the new website... Not sure why?
0
 
GaryCommented:
Go into your main admin, clear cache and reindex.
0
 
rafique12Author Commented:
I'm pretty sure that the path is incorrect:

example.com/drtv/index.php/drtv_eng/cca/index/login/
0
 
GaryCommented:
In index.php (in the subfolder) add
error_reporting(E_ALL | E_STRICT);

ini_set('display_errors', 1);

That will show any errors.
What is this?
example.com/drtv/index.php/drtv_eng/cca/index/login/

You login to admin from your main site url not the sub folder.
0
 
rafique12Author Commented:
That's the url to the new website. Users have to login to access the catalog that is shared with the main site...
0
 
GaryCommented:
Have you added the error code above? Cleared cache?
What errors do you get?
0
 
rafique12Author Commented:
No errors... I'm sure its a path issue or summick. There isn't an error in sight it just renders a blank page
0
 
GaryCommented:
Can you attach your new index.php file, remove anything sensitive
0
 
rafique12Author Commented:
I've tried applying a blank magento theme for the 'new' store/website which gets rendered without the styling...

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   Mage
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

if (version_compare(phpversion(), '5.2.0', '<')===true) {
    echo  '<div style="font:12px/1.35em arial, helvetica, sans-serif;">
<div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;">
<h3 style="margin:0; font-size:1.7em; font-weight:normal; text-transform:none; text-align:left; color:#2f2f2f;">
Whoops, it looks like you have an invalid PHP version.</h3></div><p>Magento supports PHP 5.2.0 or newer.
<a href="http://www.magentocommerce.com/install" target="">Find out</a> how to install</a>
 Magento using PHP-CGI as a work-around.</p></div>';
    exit;
}

/**
 * Error reporting
 */
error_reporting(E_ALL | E_STRICT);

/**
 * Compilation includes configuration file
 */
define('MAGENTO_ROOT', getcwd());

$compilerConfig = MAGENTO_ROOT . '/../includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;
}

$mageFilename = MAGENTO_ROOT . '/../app/Mage.php';
$maintenanceFile = 'maintenance.flag';

if (!file_exists($mageFilename)) {
    if (is_dir('downloader')) {
        header("Location: downloader");
    } else {
        echo $mageFilename." was not found";
    }
    exit;
}

if (file_exists($maintenanceFile)) {
    include_once dirname(__FILE__) . '/errors/503.php';
    exit;
}

require_once $mageFilename;

#Varien_Profiler::enable();

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    Mage::setIsDeveloperMode(true);
}

#ini_set('display_errors', 1);

umask(0);

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : 'cca_eng';

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';

Mage::run($mageRunCode, $mageRunType);

Open in new window

0
 
GaryCommented:
$mageFilename = MAGENTO_ROOT . '/../app/Mage.php';
Just needs to be
$mageFilename =  '../app/Mage.php';

Ditto for
$compilerConfig = MAGENTO_ROOT . '/../includes/config.php';
to
$compilerConfig =  'includes/config.php';

Uncomment this line
#ini_set('display_errors', 1);

cca_eng is your new store - correct?


Run the page again and report the errors.
0
 
GaryCommented:
Also in admin/configuration under design set your theme name
0
 
rafique12Author Commented:
changing to: $mageFilename =  '../app/Mage.php';

gives the error: htdocs/example.com/cca../app/Mage.php was not found

Because the new store is under the directory example.com/NEWSTORE

cca_eng is the store code...

theme name has been set
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.