OK, assuming that the answer to my above post is not going to be favorable, I decided to move forward with the Multi Site Mod. Are you ready... Here we go...
I AM TRYING TO INSTALL THE MULTI_SITE MOD in Zen Cart v1.5.0 and after reading all 155 pages of this thread, and spending 4 fifteen hour days at it, I've just about given up.
FYI: I have just recently started working with Zen Cart. I know little to nothing about programming php script, but I am fluent in HTML, Graphic Design and really good at following directions. These directions are VERY difficult to follow. Once I figure this out I will create the "MULTI-SITE FOR DUMMIES" (MSFD) version.
For now I have many questions PLEASE HELP!
To start with I installed a copy of Zen Cart into my 'public_html directory and called it 'store1'. (folder = "public_html/store1") This is were I'm making all modifications.
(URL = mysite.com/store1).
I then created a sub domain and called it 'store2' and installed another copy of Zen Cart.
(folder = "public_html/store2") (URL = "www.store2.mysite.com").
THE DIRECTIONS:
Step 1. Backup your database and files. (No Problem, I got this one.)
Step 2. Execute SQL:
In order to know which site orders originate from, it is necessary to add the column ‘order_site’ to the ‘Orders’ Table. To achieve this run the following SQL command:
ALTER TABLE orders ADD order_site varchar(30) NOT NULL DEFAULT 'no';
This is the only change that has to be made to the database structure.
RESPONSE: (what I did and for anyone who needs help)
Copy the SQL command in the directions above.
Go to the Zen Cart Admin > 'Tools' > 'Install SQL Patches'.
Paste the SQL command into the 'Enter the query to be executed' window.
Click 'Send'. That's it, you should see a message at the top of the page '1 statement processed.'
QUESTION:
2a) Is this correct?
Step 3. Add the ‘NEW’ files.
You need first to add the extra files that you will find in the folder: 'NEW_FILES'. The files are listed below.
admin/includes/languages/english/extra_definitions/order_site.php
includes/config_sites/help.txt
includes/config_sites/sites_switch.php
includes/config_sites/www.example.com_config.php (This is only an example config file)
includes/functions/extra_functions/cat_filter.php
includes/init_includes/overrides/init_sessions.php
includes/init_includes/overrides/init_templates.php
includes/modules/sideboxes/site_links.php
QUESTION:
3a) I believe the folder is called 'ADD_FILES', not NEW_FILES?
3b) I imported all the files shown above from my Multi Site Module Download 'ADD_FILES' folder, to the corresponding directories in 'Store1'?
3c) Are the files in the directions above, the only files I'm suppose to copy over? I ask because there are many other folders/files in the Multi Site Download that do not appear to be used, I don't understand why they are there?
3d) Am I only suppose to add these files to 'Store1', or am I suppose to add them to EVERY store that interfaces/accesses the Store1 Data Base, Store1, Store2, etc?
Step 4. Add the ‘MODIFIED’ files:
QUESTION:
4a) This step I completely skipped and went directly to the 'install.txt' file that came with the Multi Site Module. i,e, ("This is the modification that you have to do if you which to apply it to a customized version of Zen-Cart.") I do not have a customized version but I am using v1.5.0 so I thought this was the way to go. Is this correct?
4b) I went through the entire .txt file and painstakingly modified every line of code they suggested except for one:
FILE includes/modules/sideboxes/reviews.php ###
Line 30:
$random_review_sidebox_product = zen_random_select($random_review_sidebox_select);
Replace by:
$random_review_sidebox_product = zen_random_select(cat_filter($random_review_sidebox_select));
This file did not exist, but does not appear to be all that important in getting this beast up and running?
4c) Again, I am not sure if I am ONLY suppose to add these files to 'Store1', or am I suppose to add them to EVERY store that interfaces/accesses the Store1 Data Base, Store 1, Store2, etc.?
Step 5: Make a Template for each site:
We assume that you already have a Zen-cart shop installed with some categories and products.
You need to have a 2nd template that will be use for your 2nd shop. You can simply copy and past the one from your folder "includes/template/[YOUR_TEMPLATE]" Or you can download some from https://www.zen-cart.com.
TIP: In order to make the things easy, I highly advice you to rename the template to the name of
each of your site. In this way, you will find easily the folder of the shop you want to modify...
When you rename your template's name, think of renaming every overriding folder too !
These folders should be:
includes/templates/[YOUR_TEMPLATE]
includes/languages/english/[YOUR_TEMPLATE]
includes/languages/english/extra_definitions/[YOUR_TEMPLATE]
includes/languages/english/html_includes/[YOUR_TEMPLATE]
includes/languages/english/modules/order_total/[YOUR_TEMPLATE]
includes/languages/english/modules/payment/[YOUR_TEMPLATE]
includes/languages/english/modules/shipping/[YOUR_TEMPLATE]
includes/languages/english/modules/[YOUR_TEMPLATE]
includes/languages/english/modules/sideboxes/[YOUR_TEMPLATE]
Do not use a template for two sites, otherwise, you will be obliged to have the same language files too (same shops' name and same sideboxes position).
In the includes/templates/[YOUR_TEMPLATE]/template_info.php, change the template_name to the name of your site that uses the template:
$template_name = 'mysite';
So, if your sites are called https://www.site1.com and https://www.site2.net Then your should rename your
template to site1 and site2
the file includes/templates/site1/template_info.php should have the line
$template_name = 'site1';
the file includes/templates/site2/template_info.php should have the line
$template_name = 'site2';
This will help you later in the admin section; the template selector is now only use for choose the
site for which you want to change the sidebox setting.
QUESTION:
5a) Now I'm really confused... the directions say; "You need to have a 2nd template that will be use for your 2nd shop". Does this mean I need to have a second template in the same store, 'Store1'. Or is this referring to a second template TO BE INSTALLED IN THE SECOND STORE, 'Store2'?
I totally get the renaming structure - no problem there.
Step 6. Create the configuration files of your sites.
Add this line at the beginning of your "includes/configure.php":
include_once('includes/config_sites/sites_switch.php');
QUESTION:
6a) I know it says "at the beginning" but, does it matter where I add this, line 1,2,3 etc.?
6b) Again, I am not sure if I'm ONLY suppose to add these files to 'Store1', or am I suppose to add them to EVERY store in my network; Store1, Store 2, Store 3 etc?
Or, am I suppose to add them to that new template I just created in step 5 above?
**
Step 6. CONTINUED: **
How to change the configuration for a specific shop ?
The Zen-cart configuration is contained in the database and declared in constants at runtime.
The configuration in the admin section stands for the "default configuration". You can override this configuration by defining the constants of the setting that you want to change directly in the config file related to one of your site (folder "includes/config_sites")
You now have to create a config file for each one of your sites !
The name of the file has to be:
"www.site1.com_config.php" (for the site targeted by the domain name https://www.site1.com)
This file "www.site1.com_config.php" has to contain:
<?php
$template_dir = "site1";
define('SITE_NAME','site1');
?>
$template_dir is the template that you want to use for this site, SITE_NAME is the name of your site (use for the category filter and for the order page in admin; column site).
QUESTION:
6c) I'm assuming that since the first paragraph of this section leads us to the (folder "includes/config_sites") that this is where the "config file that we create will be placed. Is this correct?
6d) The directions state, "You now have to create a config file for each one of your sites". Again, were do these config files go... in the includes/config_sites folder? ALL config files on one site? ALL config files on ALL sites? Or one config file on each site - the site it was created for?
6e) Naming the config file:
For Store1, I installed a copy of Zen Cart in my 'public_html directory and called it 'store1'. (folder "public_html/store1") Link to store = (https://www.mysite.com/store1)
Thus, I believe my config file should be named, ("www.mystore.com_config.php") is this correct or do I need to have 'store1' in there somewhere?
6f) For Store2 I created a Sub Domain and called it 'store2'. I then installed another copy of Zen Cart in the Store2 Sub Domain. (folder "public_html/store2"). Domain name = ("www.store2.mysite.com").
So, I believe my config file should be named (www.store2.mysite.com_config.php) is this correct?
6g) The directions state that the config file needs to contain:
<?php
$template_dir = "site1";
define('SITE_NAME','site1');
?>
But after reading all 155 post, and looking at the sample file, I'm thinking that it might need a little more information than what was stated.
For my main site, Store1, I came up with...
<?php
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
$template_dir = "store1";
define('SITE_NAME','store1');
define('HTTP_SERVER', 'http://www.mysite.com');
define('HTTPS_SERVER', 'https://www.mysite.com');
?>
And for my Sub Domain, Store2, I came up with...
<?php
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
$template_dir = "store2";
define('SITE_NAME','store2');
define('HTTP_SERVER', 'http://www.store2.mystore.com');
define('HTTPS_SERVER', 'https://www.store2.mystore.com');
?>
Is this correct?
Step 7. Category Filter
COMMENT: Seems pretty self explanatory.
Step 8. Site Links
COMMENT: I don't need cross-site carts but I will add this to my MSFD "MULTI-SITE FOR DUMMIES" manual when I sort this thing out.
Love this...
"That's it, IF you manage to understand these explanations, you should have installed this module correctly." : )
Sorry for the lengthy post, but I'm in a bit of a hurry, I need this like yesterday, and the responses seems to be a little slow on this thread. So I figured, What the Hell, I'll through it out there and see what comes back.
Peace out,
Thanks for the support
Bill