Results 1 to 10 of 2247

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Posts
    19
    Plugin Contributions
    0

    Idea or Suggestion Re: MultiSite Module Support Thread

    Hi everyone,

    First of all, I would like to thank Gerome to come up this wonderful ideal which solved one of my major problem. I took his ideal and modified it to meet my own need. I have a primary site which can list all products. I also have bunch of sub sites (sub-domains). Here is a list of what my site can do:

    1. one db shared by all sites
    2. one copy of zen cart code
    3. each site can define not only its own payment modules but also shipping modules - this is one thing I am really happy about and hoping this ideal can be used in the future release of zen cart (if they want to support multi-sites)
    4. each site only display and sell its own products; the primary site only display all products and does not sell them - this is due to my site's business logic and can be changed.
    5. each site has its own template
    6. only one copy of image per product need to be stored

    Thing I would like to have is to allow sub-site owners to access the admin for adding and modifying their own products, payment methods, and shipping methods.

    The primary site is http://YOUDOMAINNAME.com which is redirected to http://YOUDOMAINNAME.com/primarystorename
    The sub-site can be http://subsitename.YOUDOMAINNAME.com, http://www.subsitename.YOUDOMAINNAME.com, http://YOUDOMAINNAME.com/substename, or http://www.YOUDOMAINNAME.com/subsitename

    If any one would like to know how I did this, I be glad to share my experience. I made the changes about three months ago and moved on my other tasks. I have just put my site on air today for alpha test. After taking so many from others, I feel I should put my two dimes on the table.

    I am not including any codes here yet only because I don't know to post them. :O Should I just cut and paste them in this post. It looks messy.

    PS. I am re-testing my payment and shipping flow now (I did it 3 months ago) and working on my wordings. Please let me know if you find anything wrong.


    loop4ever
    ---------------------
    http://360square.com

  2. #2
    Join Date
    Aug 2005
    Location
    Trujillo Alto, Puerto Rico
    Posts
    1,550
    Plugin Contributions
    9

    Default Re: MultiSite Module Support Thread

    Apparently I posted my question where I wasn't supposed. I'm not trying to break the rules of double posting, just post where my questions will be attended. Here is my other post: Subdomain Redirection
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!

  3. #3
    Join Date
    Apr 2006
    Posts
    19
    Plugin Contributions
    0

    Default Re: MultiSite Module Support Thread

    This is what I did:

    Add a line in public_html/.htaccess

    RedirectMatch temp ^/$ http://www.yourdomain.com/yoursubdomain/

    There are other ways to redirect. This works for me.

    loop4ever

  4. #4
    Join Date
    Sep 2007
    Location
    Gold Coast, Oz
    Posts
    14
    Plugin Contributions
    0

    Default Re: MultiSite Module Support Thread

    Quote Originally Posted by loop4ever View Post
    If any one would like to know how I did this, I be glad to share my experience.
    Hi,
    If you do a product search on one site, do products from the other sites show up in the search?

    If not, can you advise what we need to change/where we need to apply the filter so that the search only returns the 'current' sites products.
    Thanks

  5. #5
    Join Date
    Feb 2005
    Posts
    19
    Plugin Contributions
    0

    Default Re: MultiSite Module Support Thread

    if you made improvements on the script. can you please zip it and upload to your site, and then inform all of us the download url.

    and also better if you can send it to [email protected].
    so, next version will include this too.

    otherwise if something changed it maybe need another modifications

    Thanks

  6. #6
    Join Date
    Apr 2006
    Posts
    19
    Plugin Contributions
    0

    Default Re: MultiSite Module Support Thread

    Quote Originally Posted by zark View Post
    Hi,
    If you do a product search on one site, do products from the other sites show up in the search?

    If not, can you advise what we need to change/where we need to apply the filter so that the search only returns the 'current' sites products.
    Thanks
    Sorry, I don't allow my sub-site to do search. It doesn't seem to be needed in my case. My sub-sites are very small (It is for each member artists). But I think you can apply cat_filter to the search sql to eliminate the products. Try to change line 439 to
    $listing_sql = cat_filter($select_str . $from_str . $where_str . $order_str); in modules/pages/advanced_search_reault/header.php.

    I re-wrote my cat_filter.php so I can filter the products based on the sitename. My filter will not be useful for any of you since I use my own product type, product_art, to do the job. I just don't want to go to each product's description to specify the critiria. Besides, it is not necessary in my case.

    Good luck!
    loop4ever

    360square.com

    Display & Sell Your Artwork for Free
    Buy Directly from Artists

  7. #7
    Join Date
    Jul 2007
    Location
    Minneapolis, MN, United States
    Posts
    71
    Plugin Contributions
    0

    Default Re: MultiSite Module Support Thread

    loop4ever,

    thanks so much. I think I looked everywhere to put the cat filter except there

    worked perfectly
    I dont care what it says next to my name. I've been Zenned!

  8. #8
    Join Date
    Apr 2006
    Posts
    19
    Plugin Contributions
    0

    Default Re: MultiSite Module Support Thread

    utomo,

    Here is the codes of my configuration. I don't know if my configuration will be suitable for others. If most people find that it is useful and workable to them, I can contact Gerome later to let him know my changes.

    Re: Please refer to my previous post in case you don't know why I am including my codes here.

    The primary site is http://YOUDOMAINNAME.com which is redirected to http://YOUDOMAINNAME.com/primarystorename
    The sub-site can be http://subsitename.YOUDOMAINNAME.com, http://www.subsitename.YOUDOMAINNAME.com, http://YOUDOMAINNAME.com/substename, or http://www.YOUDOMAINNAME.com/subsitename.

    One copy of zen-cart is installed under public_html/primarystorename.

    The file structure is like:

    Code:
    public_html
       |__primarystorename
             |__admin
             |__includes
                |__configure.php (3)
          |__includes
             |__config_sites
                |__sites_switch.php (1)
                |__yoursubsitename.YOURDOMAINNAME.com_config.php (2)
             |__templates
                |__tpl_subsitename1  (template for subsitename1) 
                |__tpl_subsitename2  (template for subsitename2)
                |__tpl_subsitename3  (template for subsitename3)
             |__configure.php (4)
       |__subsitename1
          |__.htaccess (6)
       |__subsitename2
          |__.htaccess
       |__subsitename3
          |__.htaccess
       |__.htaccess (5)
    NOTE: I don't know too much about .htaccess. I may have done something wrong. They worked fine on my website.

    The code for supporting different shippings and payments are not included yet.

    -----------------------------
    (1) code in my includes/config_sites/sites_switch.php:

    Code:
    /* Since I have set rules in .htaccess (included at the bottom of this page), my uri is guaranteed to have something like YOURDOMAINNAME.com/primarystorename or YOURDOMAINNAME.com/subsitename */
        $site_name = explode('/', $_SERVER['REQUEST_URI']);
        if ($site_name[1] == '' || $site_name[1] == 'primarystorename') {
            $template_dir = 'tpl_primarystorename';
            if(file_exists("includes/config_sites/www.YOURDOMAINNAME.com_config.php")) {
                include("includes/config_sites/www.YOURDOMAINNAME.com_config.php");
            }
            define('DIR_WS_CATALOG', '/primarystorename/');
            define('DIR_WS_HTTPS_CATALOG', '/primarystorename/');
            define('SITE_NAME', 'primarystorename');
        } else {
            $template_dir = 'tpl_' . $site_name[1];        /* set before 'include'; if you don't want to use the default template, you can overwrite it in yoursubsitename.YOURDOMAINNAME.com_config.php */ 
            if(file_exists("includes/config_sites/$site_name[1].YOURDOMAINNAME.com_config.php")) {
      include("includes/config_sites/$site_name[1].YOURDOMAINNAME.com_config.php");
            }
            /* define DIR_WS_CATALOG, DIR_WS_HTTPS_CATALOG and SITE_NAME after 'include';  If you don't want to use the default settings, you can overwrite tehm in yoursubsitename.YOURDOMAINNAME.com_config.php; If the file was not found, the default settings are used. */
            define('DIR_WS_CATALOG', '/'. $site_name[1] . '/');
            define('DIR_WS_HTTPS_CATALOG', '/' . $site_name[1] . '/');
            define('SITE_NAME', $site_name[1]);
            define('STORE_OWNER_EMAIL_ADDRESS', $site_name[1] . '@YOURDOMAINNAME.com'); /* optional */
            define('CONTACT_US_LIST', STORE_OWNER . '<' . STORE_OWNER_EMAIL_ADDRESS .'>'); /* optional */
        }
        
        //The order for this site will be seen for ORDER_SITE from the admin section
        define('ORDER_SITE', SITE_NAME);
    -----------------------------
    (2) possible codes for each subsite - includes/config_sites/yoursubsitename.YOURDOMAINNAME.com_config.php; This file is optional. If you don't need to have different definitions, you don't have to have this file. The major definitions are done in the site_switch.php. If you want to have different db for each site, put your db settings here.

    Code:
        define('STORE_NAME','John Doe');                // used in tagline
        define('STORE_OWNER','John Doe');
        define('COLUMN_RIGHT_STATUS','1');
        define('COLUMN_LEFT_STATUS','0');
        define('COLUMN_WIDTH_LEFT', '200px');
        define('BOX_WIDTH_LEFT','200px');
        define('STORE_NAME_ADDRESS','<strong>'. STORE_OWNER . '</strong><br/>123 xyz Ave.<br/>New York, NY 12345<br/>');
    -----------------------------
    (3.1) In admin/includes/configure.php, insert the following code at the beginning of the file

    Code:
    $site_name = explode('/', $_SERVER['REQUEST_URI']);
      if ($site_name[1] == '' || $site_name[1] == 'primarystorename') {
       define('DIR_WS_ADMIN', '/primarystorename/admin/');
       define('DIR_WS_CATALOG', '/primarystorename/');
           define('DIR_WS_HTTPS_ADMIN', '/primarystorename/admin/');
           define('DIR_WS_HTTPS_CATALOG', '/primarystorename/');
           define('SITE_NAME', 'primarystorename');
      } else {
           define('DIR_WS_ADMIN', '/'. $site_name[1] . '/admin/');
           define('DIR_WS_CATALOG', '/'. $site_name[1] . '/');
           define('DIR_WS_HTTPS_ADMIN', '/' . $site_name[1] . '/admin/');
           define('DIR_WS_HTTPS_CATALOG', '/' . $site_name[1] . '/');
           define('SITE_NAME', $site_name[1]);
      }
      unset($site_name);
    (3.2) Change the definition of DIR_FS_ADMIN & DIR_FS_CATALOG

    Code:
      define('DIR_FS_ADMIN', '/whatever/whatever/public_html/primarystorename/admin/');
      define('DIR_FS_CATALOG', '/whatever/whatever/public_html/primarystorename/');
    ------------------------------
    (4.1) In includes/configure.php, add the following code at the beginning of the file

    Code:
    include_once('includes/config_sites/sites_switch.php');
    (4.1) Change the definition of DIR_FS_CATALOG

    Code:
    define('DIR_FS_CATALOG', '/whatever/whatever/public_html/primarystorename/');
    ------------------------------
    (5) In publc_html/.htaccess, add the following code.

    (5.1) # point "http://YOURDOMAINNAME.com/subsitename" to "http://YOURDOMAINNAME.com/subsitename/"

    Code:
    RewriteRule /subsitename$ /subsitename/ [R]
    (5.1) # redirect http://YOURDOMAINNAME.com or http://www.YOURDOMAINNAME.com to http://YOURDOMAINNAME.com/primarystorename/; There might be better way to do this. If so, please let me know.

    Code:
    RedirectMatch temp ^/$ http://YOURDOMAINNAME.com/primarystorename/
    RedirectMatch temp ^www.YOURDOMAINNAME.com$ http://YOURDOMAINNAME.com/primarystorename/
    ------------------------------
    (6) In publc_html/subsitename/.htaccess, add the following code. These point sub-site (sub-domain) to the primary site. Only one copy of code is needed!

    Code:
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} subsitename.YOURDOMAINNAME.com$ [OR]
    RewriteCond %{HTTP_HOST} www.subsitename.YOURDOMAINNAME.com$
    RewriteCond %{HTTP_HOST} !www.YOURDOMAINNAME.com$
    RewriteRule /(.*)$ http://www.YOURDOMAINNAME.com/subsitename/ [L,R=301]
    
    RewriteRule ^(.*)$ /primarystorename/$1 [L]
    -------------------------------

    A text file is attached.

    Attached Files Attached Files
    loop4ever

    360square.com

    Display & Sell Your Artwork for Free
    Buy Directly from Artists

  9. #9
    Join Date
    Sep 2007
    Location
    Gold Coast, Oz
    Posts
    14
    Plugin Contributions
    0

    Default Re: MultiSite Module Support Thread

    Quote Originally Posted by loop4ever View Post
    $listing_sql = cat_filter($select_str . $from_str . $where_str . $order_str); in modules/pages/advanced_search_reault/header.php.!
    loop4ever: Thank you for that... not sure how I would have tracked that down.. site based search filter works correctly now. Cheers.

  10. #10
    Join Date
    Aug 2005
    Location
    Trujillo Alto, Puerto Rico
    Posts
    1,550
    Plugin Contributions
    9

    Default Re: MultiSite Module Support Thread

    WOW! This module has eaten me alive.

    Now at least I'm closer to the success but not quite since my categories aren't displaying at all. I did the category thing.

    I get a bit lost because the shop is going to be on a subdirectory and not on main root, so things starts to get complicated when redirecting the subdomains.

    Can someone take my hand and walk me through this?

    Also would love to know if someone have tried this module in the new 1.3.8 (or if someone knows about incompatibility). Since this is going to be a new install/new store for the customer I will like to use the version with all those bug fixes.
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!

 

 

Similar Threads

  1. v154 WorldPay Module version 3.0 - Support thread
    By countrycharm in forum Addon Payment Modules
    Replies: 116
    Last Post: 31 Dec 2025, 11:36 AM
  2. Bambora/Beanstream Payment Module Support Thread
    By swguy in forum Addon Payment Modules
    Replies: 127
    Last Post: 26 Mar 2021, 04:13 PM
  3. WorldPay Module version 2.0 - Support thread
    By philip_clarke in forum Addon Payment Modules
    Replies: 729
    Last Post: 4 Nov 2017, 08:23 AM
  4. PC Configurator Module [Support Thread]
    By lebrand2006 in forum All Other Contributions/Addons
    Replies: 254
    Last Post: 22 Aug 2012, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg