Forums / All Other Contributions/Addons / MultiSite Module Support Thread

MultiSite Module Support Thread

Started by gerome on 23 Apr 2007, 10:24 AM · Views: 581,866

Results 2,101 to 2,120 of 2,247
24 Apr 2020, 9:55 AM
#2101
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

MultiSite Module Support Thread

Koda:

Yes of course, I tried with just about every combination I could think of, the folder name, the template name, website name, what the templates are named in the config files, etc., just to be sure. Is there something additional that needs to be done to have the mod designate a url formatted such as this: http://site1.com/&template_dir=site_2_template_folder_name to display the site_2 theme while on site1? Or should this be able to do this out of the box? I noticed template_dir did not affect my websites that do not have this installed, so I just must be inputting something incorrectly is my thought, but no idea on the formatting. I have even tried going from public_html/includes/templates/site_2_template_folder_name but that didn't work either.

I have currently no test site available for testing this mod, but I can say (afeter reviewing the mod cod) that $template_dir is set in the config files for the sites (you probably already know this). The mod does as far as I know not use this variable to be used in the way you want. There is no $_GET['template_dir'] in this mod or in the default Zen Cart fileset set. So I also can not help you in why 'template_dir=template_default' does work. Maybe you have some other module in place that utilizes this$_GET variable?
The displaying of the templates you want can undoubtly be done, but will need custom coding.

27 Apr 2020, 3:23 PM
#2102
koda avatar

koda

New Zenner

Join Date:
Feb 2011
Posts:
57
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Thank you, I ended up just modifying the template_default settings which got me to where I wanted to be for the most part. I am pretty much done, just looking to finish up some UI finishing touches, and I did find some code that looks like it could be of great help for those looking to create an automatic return to their original page during a transition during checkout, however for the life of me I cannot seem to interpret how to implement it correctly. My formatting is correct, I am just not understanding how this code works. I feel there is a step missing between inserting this in my header_php.php file in checkout_process. Like setting the $_SESSION['been_here'] value on the originating website perhaps?

I am wanting my header_php.php file to be able to use an if statement to determine which code to process, however the only variables or values I can seem to easily utilize are SERVER_NAME or template_dir, both of which do not distinguish between the same website (one version has &template_dir attached to the url which causes the template_default files to load, but $template_dir is still listed as that of which website the url is associated with in the config_sites file, so putting ```

<? php if ($template_dir =='website3') { ```isn't going to work in this instance.) Perhaps there is a simpler way to go about this, although I did not find anything on calling specific modules/pages functions outside of php if statements in the file itself. If there could be a way to set different modules/pages to be called per template (including a template default one, that would be the easiest solution I think. Or a way to just define a different $template_dir to the default_template system.) Surely there is a solution that doesn't require me to actually learn to code :shocking: ``` if (isset($_SESSION['been_here'])) { $server_name=$_SERVER['SERVER_NAME']; $len=(strlen($server_name)); $domain=substr($server_name,strpos($server_name,'.'),$len); $origin='www'.$domain; if ($server_name != $origin) { zen_redirect('https://www'.$domain.'/index.php?main_page=checkout_process'); $_SESSION['been_here']=1; } } ``` > Hi again, > > OK I managed to get mine the way I wanted. Tell me if it's what you wanted to do, or if anyone else is interested in this. > > Motivation: My CC charges me a flat monthly fee (+ percentage of course) for every https:// site I ask him to approve. Since I have several stores, I would have to, pay him extra for each one. > > Note: All my domains are sub-domains of the main domain. i.e. <https://www.domain.tld>, store1.domain.tld, store2.domain.tld, etc. > > Solution: Added some lines of code to checkout process to see if the transaction is originating from the main site. If not, remember which sub-domain it came from -> switch to the main site -> process -> switch back to the sub-domain. > > If anyone is interested, it's generic code provided you use the main domain/sub-domain approach. I wouldn't want to do it any other way, since it would be a security risk if it worked for just any domain. > > Here's the doctored header_php file for checkout_process. Comments welcome! > > <?php > > ``` // Added by Dov Zamir on 6/4/2009 - saves the original sub-domain and goes to the main site for processing if (isset($_SESSION['been_here'])) { $server_name=$_SERVER['SERVER_NAME']; $len=(strlen($server_name)); $domain=substr($server_name,strpos($server_name,'.'),$len); $origin='www'.$domain; if ($server_name != $origin) { zen_redirect('https://www'.$domain.'/index.php?main_page=checkout_process'); $_SESSION['been_here']=1; } } // End of addition ``` > > // This should be first line of the script: > $zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_PROCESS'); > > require(DIR_WS_MODULES . zen_get_module_directory('checkout_process.php')); > > // load the after_process function from the payment modules > > $payment_modules->after_process(); > > $_SESSION['cart']->reset(true); > > // unregister session variables used during checkout > unset($_SESSION['sendto']); > unset($_SESSION['billto']); > unset($_SESSION['shipping']); > unset($_SESSION['payment']); > unset($_SESSION['comments']); > > $order_total_modules->clear_posts();//ICW ADDED FOR CREDIT CLASS SYSTEM > // This should be before the zen_redirect: > > $zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_PROCESS'); > > ``` // Changed by Dov Zamir - 6/4/2009 - Return to original site after processing. if (isset($_SESSION['been_here'])) { unset($_SESSION['been_here']); zen_redirect('https://'.$server_name.'/index.php?main_page=checkout_success'); } else { zen_redirect(zen_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); } ``` > > > > > require(DIR_WS_INCLUDES . 'application_bottom.php'); > > ?>
27 Apr 2020, 4:26 PM
#2103
koda avatar

koda

New Zenner

Join Date:
Feb 2011
Posts:
57
Plugin Contributions:
0

Re: MultiSite Module Support Thread

I may have figured out a solution, although I am going to have to backtrack a little. Posting it here to save others the time wasted (although I learned a lot in the process of trial & error). Use the Template_Switch mod with Multi Site and you can have the same url providing different themes based on the addition of &template_switch_id=responsive_classic to your urls. So you can easily have site 1 and site 2 both checkout on site 3, and have site 3 show different templates based on if it is accessed by &template_switch_id=template1 or not. I think, but have not verified that the template switch also updates the &template_switch_id= code as well, so even if site3 is displaying site2's layout, site2 will be what is referenced when pulling this variable. I think I can use this to get header_php.php to call the specific code I want now and have the transitions look more seamless as the user bounces about from one to the other. I would still be more than happy to hear about the above code as well if anyone wanted to contribute some info on how to get that to work too. I think my problems have all been solved however.

16 May 2020, 3:40 PM
#2104
smokinjo avatar

smokinjo

New Zenner

Join Date:
Apr 2020
Location:
Hogan
Posts:
65
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Hello,

I am looking t set up a site to service 2, maybe 3 online stores.

The general idea:

domain.com
domain2.com
domain3.com

They all three share the same shopping card, and they can switch between websites via the links on the top of the screen, allowing seemless switching between sites.

I wanted to know what considerations one must take in account before trying to set up set a site?

Is the installation description from the pluf in fairly straight forward and works? Or, there bumps a long the way?

If there are bumps, is there an unofficial guideline or maybe examples in this forum thread to allow one to get through some of them?

Thanks for your feedback. As this gets moving, I will be back to ask for more assistance an dguidance on this project:)

Joseph

4 Jun 2020, 3:49 AM
#2105
koda avatar

koda

New Zenner

Join Date:
Feb 2011
Posts:
57
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Hello,

I have SSL enabled and working for my multi-sites, however I notice if I visit the domain fresh from a browser, the initial page is not https:// enabled until I click on a link. My main webpage is fine, however I feel it would be best if the additional shared domains had SSL enabled from the get go. What did I miss?

4 Jun 2020, 1:35 PM
#2106
koda avatar

koda

New Zenner

Join Date:
Feb 2011
Posts:
57
Plugin Contributions:
0

Re: MultiSite Module Support Thread

And I am sorry for being a pest, but what would be the needed additions made to config_sites as to send order confirmation emails from a secondary address?

5 Jun 2020, 7:45 PM
#2107
carbonless avatar

carbonless

Zen Follower

Join Date:
Jan 2007
Location:
Illinois, USA
Posts:
329
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Koda:

Hello,

I have SSL enabled and working for my multi-sites, however I notice if I visit the domain fresh from a browser, the initial page is not https:// enabled until I click on a link. My main webpage is fine, however I feel it would be best if the additional shared domains had SSL enabled from the get go. What did I miss?

I would check your SSL installation through cPanel to ensure it has been installed correctly. Secondly, check your .htaccess file to make sure the statement for having it display SSL by default is included. For example:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L,NE]

I'm running 4 stores using multi-store and each has ssl enabled.

Hope this helps.

NTO: building a better network thru collaboration
www.needtoorder.com | www.coffeewitheinstein.com

5 Jun 2020, 8:13 PM
#2108
carbonless avatar

carbonless

Zen Follower

Join Date:
Jan 2007
Location:
Illinois, USA
Posts:
329
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Koda:

Hello,

I have SSL enabled and working for my multi-sites, however I notice if I visit the domain fresh from a browser, the initial page is not https:// enabled until I click on a link. My main webpage is fine, however I feel it would be best if the additional shared domains had SSL enabled from the get go. What did I miss?

Under Configuration>>Email Options --> select the store and then configure the email to use, for example if you want to change the sent from, change the email address in that field.

NTO: building a better network thru collaboration
www.needtoorder.com | www.coffeewitheinstein.com

15 Jun 2020, 10:29 AM
#2109
koda avatar

koda

New Zenner

Join Date:
Feb 2011
Posts:
57
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Thank you for the timely reply! I do not however see the option to select which store the emails come from under Configuration-> e-mail options. I tried changing the template selection in Tools -> Template Selection, however regardless which is selected I am given the same page, which has the changes performed globally. I am using Version 1.0 - Release Date: 2013-01-21 of the Multi-Site module, and using Zen-cart 1.55e as well. Attached is a screenshot of my Configuration- e-mail options:

Attachment 19046

Larger image:

15 Jun 2020, 10:46 AM
#2110
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: MultiSite Module Support Thread

Koda:

Thank you for the timely reply! I do not however see the option to select which store the emails come from under Configuration-> e-mail options. I tried changing the template selection in Tools -> Template Selection, however regardless which is selected I am given the same page, which has the changes performed globally. I am using Version 1.0 - Release Date: 2013-01-21 of the Multi-Site module, and using Zen-cart 1.55e as well. Attached is a screenshot of my Configuration- e-mail options:

Attachment 19046

Larger image:
Carbonless is confusing the free Multi site module with the paid Multi Store module he is using.
For the free Multi site module you need to edit the site config files by adding the correct database defines, or go to admin=>tools=>Multisite Tools, and edit/add the defines there.

15 Jun 2020, 10:56 AM
#2111
koda avatar

koda

New Zenner

Join Date:
Feb 2011
Posts:
57
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Thank you so much! I assume that would mean adding:

$EMAIL_SMTPAUTH_MAILBOX=[email protected]
$EMAIL_SMTPAUTH_PASSWORD=*******

to the template_info.php file under templates/template2?

Ok I see all the lists in tools-multisite tools, this was formatted off with my admin so I did not realize all the variables are listed here, this can definitely make life A LOT EASIER!

15 Jun 2020, 11:11 AM
#2112
koda avatar

koda

New Zenner

Join Date:
Feb 2011
Posts:
57
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Hmm, doesn't seem to be working, not sure what I did incorrect. I tried adding both:

define('EMAIL_SMTPAUTH_MAILBOX','[email protected]');
and
$EMAIL_SMTPAUTH_MAILBOX=[email protected] but the email still sends from the one listed in the admin->email settings page. :huh::eek:

Oh I was editing the wrong file... will try again now with sites_config, oops!

Yup that did it! Now to figure out how to get gmail to actually send the darn email...

15 Jun 2020, 3:26 PM
#2114
koda avatar

koda

New Zenner

Join Date:
Feb 2011
Posts:
57
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Thank you I got it figured out, was editing the wrong file, woops!

10 Aug 2020, 4:12 PM
#2115
carbonless avatar

carbonless

Zen Follower

Join Date:
Jan 2007
Location:
Illinois, USA
Posts:
329
Plugin Contributions:
0

Re: MultiSite Module Support Thread

@Design75 Would like to pick up where you left off on the MSM/Migration.

NTO: building a better network thru collaboration
www.needtoorder.com | www.coffeewitheinstein.com

18 Aug 2020, 10:54 AM
#2116
carbonless avatar

carbonless

Zen Follower

Join Date:
Jan 2007
Location:
Illinois, USA
Posts:
329
Plugin Contributions:
0

Re: MultiSite Module Support Thread

@Design75 my current hosting Expires at the end of this month. Are you going to be able to complete the migration by then? I don’t want to have to pay for to renew hosting on my old account.

NTO: building a better network thru collaboration
www.needtoorder.com | www.coffeewitheinstein.com

22 Aug 2020, 1:46 PM
#2117
carbonless avatar

carbonless

Zen Follower

Join Date:
Jan 2007
Location:
Illinois, USA
Posts:
329
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Anyone heard from Design75??

NTO: building a better network thru collaboration
www.needtoorder.com | www.coffeewitheinstein.com

27 Aug 2020, 12:32 PM
#2118
carbonless avatar

carbonless

Zen Follower

Join Date:
Jan 2007
Location:
Illinois, USA
Posts:
329
Plugin Contributions:
0

Re: MultiSite Module Support Thread

DESIGN75 - I Need BatMan! Tried reaching you every way I could think of. Losing my hosting in 3 days and Need the migration finished!!! 😬

NTO: building a better network thru collaboration
www.needtoorder.com | www.coffeewitheinstein.com

29 Aug 2020, 11:27 PM
#2119
noppie avatar

noppie

Zen Follower

Join Date:
Mar 2004
Posts:
210
Plugin Contributions:
0

Re: MultiSite Module Support Thread

i am trying to get this working with 157 and i get this error in debug files the site is coming up, but the different template is not coming up,, just wondering if this was the problem.

naomi

[29-Aug-2020 22:54:09 UTC] Request URI: /shop/index.php, IP address: 209.85.238.214
#1 cat_filter() called at [/includes/modules/pages/index/main_template_vars.php:119]
#2 require(/includes/modules/pages/index/main_template_vars.php) called at [/includes/templates/template_default/common/tpl_main_page.php:136]
#3 require(/includes/templates/template_default/common/tpl_main_page.php) called at [/index.php:94]
--> PHP Warning: Use of undefined constant SITE_NAME - assumed 'SITE_NAME' (this will throw an Error in a future version of PHP) in /includes/functions/extra_functions/cat_filter.php on line 111.

My Multi_Site Zen Carts
http://herasonlinemarket.com

30 Aug 2020, 12:34 AM
#2120
royaldave avatar

royaldave

Zen Follower

Join Date:
Aug 2013
Location:
Perth, WA, AU
Posts:
285
Plugin Contributions:
1

Re: MultiSite Module Support Thread

noppie:

i am trying to get this working with 157 and i get this error in debug files the site is coming up, but the different template is not coming up,, just wondering if this was the problem.

naomi

[29-Aug-2020 22:54:09 UTC] Request URI: /shop/index.php, IP address: 209.85.238.214
#1 cat_filter() called at [/includes/modules/pages/index/main_template_vars.php:119]
#2 require(/includes/modules/pages/index/main_template_vars.php) called at [/includes/templates/template_default/common/tpl_main_page.php:136]
#3 require(/includes/templates/template_default/common/tpl_main_page.php) called at [/index.php:94]
--> PHP Warning: Use of undefined constant SITE_NAME - assumed 'SITE_NAME' (this will throw an Error in a future version of PHP) in /includes/functions/extra_functions/cat_filter.php on line 111.

just guessing here, but do you have your config_sites directory and sites_switch.php setup correctly?