[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Multiple stores in Magento

Posted on 2012-09-12
26
Medium Priority
?
626 Views
Last Modified: 2012-09-28
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...
0
Comment
Question by:rafique12
  • 13
  • 13
26 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 38390576
In Admin goto Sytem/Design
Select your new store and set the design

This is a subdirectory of your main site?
0
 

Author Comment

by:rafique12
ID: 38390655
Yes its a subdirectory that will only be available to sales staff...
0
 

Author Comment

by:rafique12
ID: 38390667
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 58

Expert Comment

by:Gary
ID: 38390685
Under Configuration/Web set the url's there
0
 

Author Comment

by:rafique12
ID: 38390875
I'm just getting redirected to 404 error page...!
0
 
LVL 58

Expert Comment

by:Gary
ID: 38391239
Just to be clear have you installed a seperate installation of magento in a sub directory?
0
 

Author Comment

by:rafique12
ID: 38391400
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
 
LVL 58

Expert Comment

by:Gary
ID: 38391430
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
 

Author Comment

by:rafique12
ID: 38391627
Still get a 404 error, page not found
0
 
LVL 58

Expert Comment

by:Gary
ID: 38391668
access the folder and use index.php
0
 

Author Comment

by:rafique12
ID: 38394126
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
 

Author Comment

by:rafique12
ID: 38394308
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
 
LVL 58

Expert Comment

by:Gary
ID: 38394711
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
 

Author Comment

by:rafique12
ID: 38394756
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
 
LVL 58

Expert Comment

by:Gary
ID: 38394766
Go into your main admin, clear cache and reindex.
0
 

Author Comment

by:rafique12
ID: 38394771
I'm pretty sure that the path is incorrect:

example.com/drtv/index.php/drtv_eng/cca/index/login/
0
 
LVL 58

Expert Comment

by:Gary
ID: 38394810
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
 

Author Comment

by:rafique12
ID: 38395008
That's the url to the new website. Users have to login to access the catalog that is shared with the main site...
0
 
LVL 58

Expert Comment

by:Gary
ID: 38395117
Have you added the error code above? Cleared cache?
What errors do you get?
0
 

Author Comment

by:rafique12
ID: 38395667
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
 
LVL 58

Expert Comment

by:Gary
ID: 38395699
Can you attach your new index.php file, remove anything sensitive
0
 

Author Comment

by:rafique12
ID: 38396255
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
 
LVL 58

Expert Comment

by:Gary
ID: 38396503
$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
 
LVL 58

Expert Comment

by:Gary
ID: 38396642
Also in admin/configuration under design set your theme name
0
 

Author Comment

by:rafique12
ID: 38396743
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
 
LVL 58

Accepted Solution

by:
Gary earned 1500 total points
ID: 38396803
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question