New Zenner
- Join Date:
- Aug 2008
- Posts:
- 23
- Plugin Contributions:
- 1
MultiSite Module Support Thread
Is this what you are looking for?
I looked on each page until I found this buried back a bit and took me all of 15 minutes to find.
Views: 580,356
New Zenner
Is this what you are looking for?
I looked on each page until I found this buried back a bit and took me all of 15 minutes to find.
New Zenner
i m new to multisite module. the link
/dev/multisite_instructions_4.0.html"]Instruction[/URL] is not working .plz help me. i have searched for the instruction manual but did not find
I have tried to install but not getting the result.
Thanks in advance.
Zen Follower
Step 1. Backup your database and files.
VERY IMPORTYANT: Make a full backup of your files and your database in order to rollback any changes if necessary.
**
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.
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
Step 4. Add the ‘MODIFIED’ files
Now we need to add all the files contained in the folder: 'MODIFY_FILES'.
If this is a fresh Zen-Cart Install and no other modifications have been made then you can just copy these files over the top of the existing Zen-Cart files.
In the event that your's is an existing Zen-Cart that has been heavily modified, you will need to wait for the more detailed instructions coming in the not too distant future. These more detailed instructions will tell you which code to add to which file and where to add it.
Before we proceed there are a couple of things to note. The files in the 'MODIFIED_FILES' folder are of two types. The first type of file CANNOT be over-ridden by the use of templates, the second type is of course the opposite and CAN be overridden by the use of Zen-Cart templates. You can read more about Zen-Cart templates on the Zen-Cart website here. The files in the box below titled 'GROUP 1' are the files which CANNOT be overridden. The files listed in the box titled 'GROUP 2' are the files which CAN be overridden by the use of templates.
GROUP 1.
admin/orders.php (Allow the admin's to know where the order come from)
includes/classes/category_tree.php
includes/classes/order.php (add the SITE_NAME to the order table)
includes/classes/site_map.php
The next files have to replace the existing zencart by the use of the templates but it would mean creating these files for each site and you will see that it is more really convenient... so I advice you to just modify the files.
GROUP 2.
includes/modules/sideboxes/best_sellers.php
includes/modules/sideboxes/categories.php
includes/modules/sideboxes/featured.php
includes/modules/sideboxes/manufacturers.php
includes/modules/sideboxes/reviews.php
includes/modules/sideboxes/whats_new.php
includes/modules/categories_tabs.php
includes/modules/featured_products.php
includes/modules/new_products.php
includes/modules/product_listing.php
includes/modules/specials_index.php
includes/modules/pages/featured_products/header_php.php
includes/modules/pages/index/main_template_vars.php
includes/modules/pages/products_all/header_php.php
includes/modules/pages/products_new/header_php.php
includes/modules/pages/reviews/header_php.php
includes/templates/template_default/sideboxes/tpl_categories.php
WARNING: You can replace your existing files ONLY if you haven't modified them before your install of Zen-cart !
(I'll try to make a Modify process help file later for those who can't replace their modified files...)
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.
**
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');
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:
$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).
You can add constants for overriding of the default configuration from the database or from the configure.php, the following lines are only exemples:
//Do not display the categories at the main page for this site:
define('SHOW_CATEGORIES_ALWAYS','0');
//Display the categories of ID 5 as the main category of the website: define('CATEGORIES_START_MAIN','5');
//Change the Contact us email address:
define('STORE_OWNER_EMAIL_ADDRESS','[email protected]')
//Enable the SSL only for this site:
define('ENABLE_SSL', 'true'); //assuming as 'false' in configure.php
Remember that the code above is only here as exemple and do not always need to be use.
If you don't know what is the name of the constants of a configuration setting, you can execute this query:
UPDATE configuration
SET configuration_description = CONCAT(configuration_description,"<br /> ",configuration_key)
WHERE configuration_description NOT LIKE CONCAT("%<br /> ",configuration_key);
This does not really change anything in the functionning but allow you to see the name of the constants in the description of the configuration setting in the admin section.
Step 7. Category Filter
The MultiSite module works by filtering the categories with the function cat_filter. It only displays the categories that have the name of the site (constant SITE_NAME) in html comment in the categories descriptions. Therefore, you need to add this description to EVERY categories description that have to be display in a shop. Sub categories Included!
Example of html comment:
<!--site1-site2-site3--> Description of a category that will be displayed in site1, site2 and site3.This comment will allow this category for the shops site1 site2 and site3. the site names HAVE to be separated by "-".
If you have Lots of categories, you can use a query that will do that for all of them, like the following:
REMEMBER OF ENTERING YOUR SITE_NAME INSTEAD OF your_site_name1 AND your_site_name2 !
This SQL query anable you to add sites to all your categories but you can also do that by writing the <!--site1-site2-site3--> to the categories descriptions one by one. Do not for get the subcategories !
UPDATE categories_description
SET categories_description = CONCAT("<!--your_site_name1-your_site_name2-->",categories_description)
WHERE categories_description NOT LIKE "%-your_site_name1-your_site_name2-%"
once you have put your html comments in your categories, they should appear on the front end of your shop. If a category has no html comment, it won't be displayed in any sites.
Step 8. Site Links
If you want to allow the shoppers to have a cross-sites cart (orders products from different websites in the same cart),
You have to display the sidebox called "site_links.php" and you have to add the sites that you want to be link by editing the file
"includes\modules\sideboxes\site_links.php".
In this file, you have to add as many add_site_link(...); as you want of site links.
Example:
add_site_link('Shop Site1','http://www.site1.com');
add_site_link('Shop Site2','http://www.site2.com');
This works too:
add_site_link('www.site1.com');
add_site_link('www.site2.com');
PS: these shops Should be Your multi-sites. You can also add some other sites there but the cross-site cart won't work (and so might confused the shoppers ...)
add_site_link('Zen Cart','http://www.zen-cart.com',false);
By adding false as third parameter (false), it won't add the zenid to the link. It can be use either for a shop in the same domain (cookie will work for it) or an external link (cross-site cart won't work anyway....)
That's it, if you manage to understand these explanations, you should have installed this module correctly.
New Zenner
I put the instructions above on my website so we can reference it in the future without looking in such a large forum. There are also basic instructions about the SSL.
http://www.thisdomain.net/dev/
I plan to update these pages when new and relevant information comes out. This module is very useful to myself and many others.
Sean
New Zenner
Thanks Louis for ur great response and thanks Staft for preserving the script. I have one query regarding the instructions. I have downloaded the module mfrom this link. the files i found in the folder are more as compared to the files discussed in the instruction manual.
For example: The file admin/multisite.php in (NEW_FILES but here it named ADD_FILES) any many more in other folder. Should i skip these files or include.
Thanks zen-cart forum and thanks all the contributors of this forum for the great response.:smile:
Totally Zenned
You can see the ADD_FILES and MODIFY_FILES there. The ADD_FILES are simply to be added, nothing will overwrite. And the MODIFY_FILES can be a little tricky. If you have a standard zencart installation without any modifications, you can simply add these files overwriting the existing ones. But, if you had installed addons, altered some files or in any way modified files that are in the MODIFY_FILES, you should change these files manually. You could use BeyondCompare or winmerge or any other compare tool or do it the hard way - manually, file by file as explained in the install.txt inside the package.
If you don't include all files from ADD_FILES and modify all from MODIFY_FILES, your multisite module will not work.
New Zenner
Thanks for the response. I have one query.
Suppose i have two domain https://www.example1.com and https://www.example2.com then i have to install zen cart on both sites?
or
i have just to install zen-cart in https://www.example1.com only. if this is the case then what are the files do i have to put in https://www.example2.com.
Please clarify this. Thanks again for the support.:smile:
Totally Zenned
The whole point of this module is to have ONE zc installation only.
So, install zen cart in your root or subdomain. Configure everything you need to get it working. Go to your cpanel and create an ADDON domain. When creating it, it will ask you for the document root - just point it to the folder where you've installed zencart.
Look at the screenshot attached. Let's say you've installed zencart in your site1 folder and it opens with site1.com and now you need to configure site2.com
Of course, nameservers should be set before doing this...
Now you need to setup your config_sites folder with the appropriate _config.php files. Keep in mind that you'll need both www.site1.com_config.php and site1.com_config.php if you want your site to open with both addresses. Or, do a 301 redirect for site1.com to https://www.site1.com. The same goes for site2.
Have fun!
New Zenner
Please can anyone help me, I would like to set up multistore on localhost, prior to uploading to live domains. I want to test it out, and add a few more mods etc.
I have searched for this info in this forum, and several people have asked before, but always seem to say something like "Oh I found out how to do it"... before guidance was posted.
I have installed v1.3.9d, and have added Multistore to that.., all on localhost/site1. Admin is fine, but if I navigate to localhost/site1/ I get this error message "the domain localhost does not exist".. I assume that is because I need to sort out config files...
Does anyone have a set of instructions I could borrow on how to set things up on localhost (I want main store plus 2)... then how to transfer to live environment later.
Apologies if this has been answered before, but I just couldn't find it.
Thanks in advance for all/any help you are able to provide.
New Zenner
You need to have the domains pointing at the proper location for the files to be called upon. The script is using the fact that domain1.com has all the files and domain2.com is parked. So if you do not have the domains pointing to the sites, the site knows nothing is happening.
I am not a programmer, but this makes sense why it doesn't work. I may be incorrect on this. Hopefully someone will let us know that has more knowledge than I.
Sean
http://www.thisdomain.net/dev/
lipton:
Please can anyone help me, I would like to set up multistore on localhost, prior to uploading to live domains. I want to test it out, and add a few more mods etc.
I have searched for this info in this forum, and several people have asked before, but always seem to say something like "Oh I found out how to do it"... before guidance was posted.
I have installed v1.3.9d, and have added Multistore to that.., all on localhost/site1. Admin is fine, but if I navigate to localhost/site1/ I get this error message "the domain localhost does not exist".. I assume that is because I need to sort out config files...
Does anyone have a set of instructions I could borrow on how to set things up on localhost (I want main store plus 2)... then how to transfer to live environment later.
Apologies if this has been answered before, but I just couldn't find it.
Thanks in advance for all/any help you are able to provide.
Totally Zenned
this is hou i did it
one file is callled : localhost_config.php
with the following in it:
<?php
$template_dir = "nifty_zen";
define('SITE_NAME','Design 75 webshop');
define('HTTP_SERVER', 'http://localhost');
define('HTTPS_SERVER', 'https://localhost');
define('CATEGORIES_ROOT','1'); //root categories is 1 for this site
?>
the second is called : nifty_zen_config.php
with the following in it:
<?php
define('DIR_WS_CATALOG', '/zen139d');
define('DIR_WS_HTTPS_CATALOG', '/zen139d');
$template_dir = "nifty_zen";
define('SITE_NAME','example');
?>
New Zenner
Ok...I have SSL working across the multiple domain names, Super Orders is working and most of the modules I need are installed (including FEC from Numinix).
The issue I am having is the order invoices and packing slips do not show the SITE_NAME, STORE_NAME or STORE_NAME_ADDRESS as defined in the config_site file. It only shows the street address and the city/state, but not the top line with the business name. Is there a trick to this?
Great module and is not really hard to install.
Thanks!
Sean
New Zenner
Thanks for the comments re:localhost...
Design - just so I understand how yours is set up, in your example, what URLs do you use to navigate to each of your stores? Thanks
and
New Zenner
Hello. I have a nice clean install of Zen to play around with, so I installed this great mod. (Thanks, by the way.) I have it working right for the most part, but could use a hand on a portion which I only recently became aware was an issue.
I currently have it running for a primary domain and two subdomains. The templates seem to be working as they should.
When logging in to the admin area the title is coming up as a subdomain title instead of the main domain name, and I believe that is related to why when I change options (such as sideboxes) in the admin panel the changes only happen to that subdomain, and not to the primary or other subdomain. All of the templates are edited versions of the classic template, with nearly nothing changed, so it should not relate to the templates.
Did I somehow define the subdomain as the primary?
http://www.printdealz.com
http://jakesburgers.printdealz.com <--- Admin changes modify this one.
http://wellsfargo.printdealz.com
Running latest version of Zen.
New Zenner
byoriginaldesign:
Did I somehow define the subdomain as the primary?
I sure did...:D
Sometimes you forget the common sense stuff after looking at code... If anyone else has this issue, check you selected template in admin -> Tools -> Templates
New Zenner
hai friends,
I have tried to install this module but couldn't installed properly because I heavily modified my site and I don't know clearly which code to add to which file and where to add it.
so, please give the detailed instructions that is which code to add to which file and where to add it.
any assistance would be appreciated.
Thank you.
New Zenner
hi all,
is the link http://www.medea.co.uk/dev/ where the instructions reside working for anyone?
i am stuck half way and it gives me page does not exist error.
Please help
New Zenner
Hi guys
been reading this forum since a year now, and never found it necessary to sign up because answers to all questions easily found.
However, the Multisites module is of little use, if the instructions have disappeared. medea.co.uk/dev/ is still down.
Please, could anyone who by chance has saved them locally post them here?
Thanks
Dieter
New Zenner
Another issue:
If I have a domain called some-domainname.com and want to add it to the module, the "-" in the domain name appears to be treated as a divider causing two domain entries "some" and "domainname.com" in the modul...
New Zenner
thewhiz01:
hi all,
is the link http://www.medea.co.uk/dev/ where the instructions reside working for anyone?
i am stuck half way and it gives me page does not exist error.
Please help
Try this link.. I believe staft has saved them:
Fields marked required must be completed.
Tell staff why this post should be reviewed.