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,870

Results 761 to 780 of 2,247
26 Mar 2009, 4:08 PM
#761
thegoodlifestore avatar

thegoodlifestore

New Zenner

Join Date:
Oct 2007
Location:
North Carolina
Posts:
102
Plugin Contributions:
0

MultiSite Module Support Thread

Shoreham1:

After another "wonderful" afternoon trying to get my head around this, I've actually found that each site_config file doesn't actually work, even though they are configured as per the instructions. I REALLY need a fresh pair of eyes to look at this guys........so if anyone feels like a challenge (and I'm sure it'll take someone apart 10 secs to resolve!), I'm happy to give someone admin access/ftp access etc and pay them for their time......its actually got to the stage where I simply need a small nudge in the right direction and I'll be fine........
So if anyone wants to make a few bucks (payable via PayPal) PLEASE LET ME KNOW ASAP :-)
Many thanks

I was having trouble with the config_sites files as stated in the intsall instructions.

I actually made TWO site_config files and that made it work (somehow).
YOURDOMAIN.com_config.php
www.YOURDOMAIN.com_config.php

30 Mar 2009, 7:53 AM
#762
ebaysoho avatar

ebaysoho

New Zenner

Join Date:
Feb 2009
Posts:
8
Plugin Contributions:
0

Re: MultiSite Module Support Thread

:flex: I have a question, when I try use multisite links 3 webs with one cart,the shopper have to login for each website,is there any way only login one time?:unsure:
Thanks you for attention and I am waitting for reply!

1 Apr 2009, 2:32 AM
#763
rwerksman avatar

rwerksman

New Zenner

Join Date:
Sep 2007
Posts:
23
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Ok, I believe that I've solved the issue with linked products showing up more than once. Here is what you need to do:

/includes/classes/split_page_results.php

Find:

function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page', $debug = false) {

Replace:

function splitPageResults($query, $max_rows, $count_key = 'p.products_id', $page_holder = 'page', $debug = false) {

/includes/modules/pages/featured_products/header_php.php
(and pages/product_all, and pages/product_new)

Find the first SELECT statement. Add the word DISTINCT right after the SELECT.

This works for me, YMMV. Backup stuff first!

2 Apr 2009, 3:21 AM
#764
matt2397 avatar

matt2397

New Zenner

Join Date:
Apr 2009
Posts:
1
Plugin Contributions:
0

Re: MultiSite Module Support Thread

So I needed add support for ssl and wanted to have all of the store domains goto one main domain.

I did search a bit but didn't find too much besides getting a wildcard certificate.

I did found that in sites_switch.php if you update HTTPS_SERVER to your ssl domain like:

//The order for this site will be seen for ORDER_SITE from the admin section
define('ORDER_SITE',SITE_NAME);
define('HTTP_SERVER', "http://$default_server_name");
define('HTTPS_SERVER', "https://ssl.domain.com");
it seems to work using just the the one domain.

So just seeing if there are any know problems with doing this. Thanks!

3 Apr 2009, 2:55 PM
#765
dovzamir avatar

dovzamir

New Zenner

Join Date:
Mar 2009
Location:
Kibbutz Beit Kama, Israel
Posts:
6
Plugin Contributions:
0

Re: MultiSite Module Support Thread

matt2397:

So I needed add support for ssl and wanted to have all of the store domains goto one main domain.

I did search a bit but didn't find too much besides getting a wildcard certificate.

I did found that in sites_switch.php if you update HTTPS_SERVER to your ssl domain like:

it seems to work using just the the one domain.

So just seeing if there are any know problems with doing this. Thanks!

Although this sounds exactly like what I want to do, it doesn't work on anything other than the main domain. After going to ssl.domain.com, it just goes to the main domain when it goes back to http://

But if you come up with something which works...
I'm also trying to do this. I want the payment gateway to come from the same sub-domain no matter which store you come from, since my gateway charges me for each sub-domain he supports.
If I solve this, I'll post back...

5 Apr 2009, 11:27 PM
#766
johnnylazerball avatar

johnnylazerball

New Zenner

Join Date:
Aug 2008
Posts:
29
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Have been trying to get multisite working for 2 days now.

After all this time, when I click "online cataloge' I get an error message that says my site doesn't exist.

I am not a programming genius as a matter of fact not really good at all.

Can somebody please tell me what I am doing wrong as I really want to use this mod. I really makes sense for what I am doing.

thanks for any help
Johnny

the site is https://www.zencart-programming.info if that will help

6 Apr 2009, 9:08 AM
#767
heimskr75 avatar

heimskr75

Zen Follower

Join Date:
Apr 2007
Posts:
106
Plugin Contributions:
3

Re: MultiSite Module Support Thread

but....yet....... you........ have a domain that is zencart programming. :rotflmao:

2 words for ya

config files

6 Apr 2009, 1:10 PM
#768
johnnylazerball avatar

johnnylazerball

New Zenner

Join Date:
Aug 2008
Posts:
29
Plugin Contributions:
0

Re: MultiSite Module Support Thread

I thank you for your gracious reply.

It always helps when you know "we're all in this together".

I will go over my config files again, that is where I have had my problems and still don't know what is wrong.

Although I will point out, that after reading 60 plus pages on this forum, I don't feel too bad for trying to get some help, for I am not the only one who has had problems trying to figure out how to make this module work.

The concept is of multi site is very good, just a little hard for some of us to figure out on out own.

6 Apr 2009, 7:06 PM
#769
dovzamir avatar

dovzamir

New Zenner

Join Date:
Mar 2009
Location:
Kibbutz Beit Kama, Israel
Posts:
6
Plugin Contributions:
0

Re: MultiSite Module Support Thread

matt2397:

So I needed add support for ssl and wanted to have all of the store domains goto one main domain.

I did search a bit but didn't find too much besides getting a wildcard certificate.

I did found that in sites_switch.php if you update HTTPS_SERVER to your ssl domain like:

it seems to work using just the the one domain.

So just seeing if there are any know problems with doing this. Thanks!

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 /** * Checkout Process Page * * @package page * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: header_php.php 4276 2006-08-26 03:18:28Z drbyte $ */ // Added by Dov Zamir on 6/4/2009 - saves the original sub-domain and goes to the main site for procssing 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'); ?>
10 Apr 2009, 1:08 AM
#770
margecc avatar

margecc

Zen Follower

Join Date:
Feb 2007
Location:
Ontario, Canada
Posts:
234
Plugin Contributions:
0

Re: MultiSite Module Support Thread

This fix worked GREAT on the customer side. It put the subdomain in so the links in the email perfectly.

Problem comes when I try and get into my order section through admin. This is the error I get:

Parse error: syntax error, unexpected T_CASE in /home/actforms/public_html/cart/admin/orders.php on line 176

**I suck at php, so any ideas??

**> cablesimple:

MotoDelta,
Ok here's what I did. It works for me.

Create a file in your admin folder called "multisite_order_settings.php". You have to change YOUR_DOMAIN.COM to your domain name of course. So for "mystore.example.com" you would just use example.com. If you look through this the idea is that it should accomodate one domain with a bunch of subdomains *.example.com and if, like me, you have some FQDN's that you use with Multisite ex. www.mystore.com

<?php if (isset($_GET['oID'])) { $oID = zen_db_prepare_input(trim($_GET['oID'])); $domain_name = "YOUR_DOMAIN.COM"; $orders = $db->Execute("select order_site from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); if ($orders->RecordCount() > 0) { $order_template = $orders->fields['order_site']; $config_folder = DIR_FS_CATALOG . DIR_WS_INCLUDES . 'config_sites/'; $subdomain = $order_template .".". $domain_name ."_config.php"; $dotcom = "www.". $order_template . ".com_config.php"; if (file_exists($config_folder . $subdomain)) { include($config_folder . $subdomain); $store_url = $order_template .".". $domain_name; $store_name = $store_url; } else if (file_exists($config_folder . $dotcom)) { include($config_folder . $dotcom); $store_url = "www.". $order_template .".com"; $store_name = $store_url; } else { echo "Error pulling site config file. Is the config file using a non-standard domain name or filename? Can't find:<br>"; echo $config_folder . $subdomain . "<br>"; echo $config_folder . $dotcom. "<br>"; } $invoice_link = "https://". $store_url . DIR_WS_HTTPS_CATALOG . "index.php?main_page=account_history_info&order_id=". (int)$oID ."\n\n"; $store_image = "http://". $store_url . DIR_WS_HTTPS_CATALOG . DIR_WS_INCLUDES . "templates/". $order_template . "/images/email_header.gif"; $email_from_name = EMAIL_FROM; $email_from_name = $store_url; } } ?>
> 
> Then include that file from admin/orders.php.  Make sure it's after the other require/include statements
> ```php
  
  require("multisite_order_settings.php");
```finally look for the email code in orders.php starting with this:
> ```php
        //send emails
          $message = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" .
etc etc...
```replace it with this:
> ```php
          //send emails
          $message = $store_name . "\n" . EMAIL_SEPARATOR . "\n" .
          EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n\n" .
          EMAIL_TEXT_INVOICE_URL . ' ' . $invoice_link . "\n\n" .
          EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']) . "\n\n" .
          strip_tags($notify_comments) .
          EMAIL_TEXT_STATUS_UPDATED . sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ) .
          EMAIL_TEXT_STATUS_PLEASE_REPLY;

          $html_msg['EMAIL_CUSTOMERS_NAME']    = $check_status->fields['customers_name'];
          $html_msg['EMAIL_STORE_NAME'] = $store_name;
          $html_msg['EMAIL_HEADER_IMAGE'] = $store_image;
          $html_msg['EMAIL_TEXT_ORDER_NUMBER'] = EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID;
          $html_msg['EMAIL_TEXT_INVOICE_URL']  = '<a href="' . $invoice_link .'">'.str_replace(':','',EMAIL_TEXT_INVOICE_URL).'</a>';
          $html_msg['EMAIL_TEXT_DATE_ORDERED'] = EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']);
          $html_msg['EMAIL_TEXT_STATUS_COMMENTS'] = nl2br($notify_comments);
          $html_msg['EMAIL_TEXT_STATUS_UPDATED'] = str_replace('\n','', EMAIL_TEXT_STATUS_UPDATED);
          $html_msg['EMAIL_TEXT_STATUS_LABEL'] = str_replace('\n','', sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ));
          $html_msg['EMAIL_TEXT_NEW_STATUS'] = $orders_status_array[$status];
          $html_msg['EMAIL_TEXT_STATUS_PLEASE_REPLY'] = str_replace('\n','', EMAIL_TEXT_STATUS_PLEASE_REPLY);
          $html_msg['EMAIL_FOOTER_COPYRIGHT'] = 'Copyright (c) ' . date('Y') . ' <a href="http://'. $store_url .'" target="_blank">'. $store_url .'</a>.';

          $customer_notified = '0';
          if (isset($_POST['notify']) && ($_POST['notify'] == 'on')) {
            zen_mail($check_status->fields['customers_name'], $check_status->fields['customers_email_address'], EMAIL_TEXT_SUBJECT . ' #' . $oID, $message, $email_from_name, $email_from, $html_msg, 'order_status');
```Let me know..

Thanks, Colleen
www.af-company.com
To err is human, but to really foul things up requires a computer. Farmers' Almanac, 1978

10 Apr 2009, 3:53 PM
#771
thegoodlifestore avatar

thegoodlifestore

New Zenner

Join Date:
Oct 2007
Location:
North Carolina
Posts:
102
Plugin Contributions:
0

Re: MultiSite Module Support Thread

I have the multisite thing working pretty well now .... BUT ... when we go in to view the orders it isn't giving us which site the order came from. We are just getting a simple "no" where the site name should be (see below).

I have looked back over my files ...
I have re-read the install instructions to make sure I didn't miss anything ...
I used the helpful info found in post #636 on this thread ...

And now I am at a loss!
:blink:

Any pointers would be oh-so greatly appreciated.

Charles
swingcardstore.com
swingcards.com
moonrivercardstore.com

13 Apr 2009, 10:05 PM
#772
hipctech avatar

hipctech

Totally Zenned

Join Date:
Oct 2004
Location:
Surrey, BC, Canada
Posts:
1,466
Plugin Contributions:
1

Re: MultiSite Module Support Thread

Thank you RWerksman for that fix! It solved my problems!
May God bless you,
Iasmin

RWerksman:

Ok, I believe that I've solved the issue with linked products showing up more than once. Here is what you need to do:

/includes/classes/split_page_results.php

Find:

function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page', $debug = false) {

> 
> Replace:
> 
> ```
function splitPageResults($query, $max_rows, $count_key = 'p.products_id', $page_holder = 'page', $debug = false) {

/includes/modules/pages/featured_products/header_php.php
(and pages/product_all, and pages/product_new)

Find the first SELECT statement. Add the word DISTINCT right after the SELECT.

This works for me, YMMV. Backup stuff first!

16 Apr 2009, 9:45 AM
#773
ebaysoho avatar

ebaysoho

New Zenner

Join Date:
Feb 2009
Posts:
8
Plugin Contributions:
0

Re: MultiSite Module Support Thread

NONE of the settings for INDEX LISTING work from the config sites. Anyone with ideas? :blink:

23 Apr 2009, 6:50 AM
#774
klsi168 avatar

klsi168

New Zenner

Join Date:
Apr 2009
Posts:
15
Plugin Contributions:
0

Re: MultiSite Module Support Thread

I very lost right now.
After installed a fresh Zen Cart i was trying to install the multi-site module.

After i done everything till the step 5 in the installation tutorial from multisite. I went to check on my website. But i found out is only give me a blank page. I try the third time to redo everything over, and it still give me a blank page. Can any1 point me into the right direction what should i do?

I did everything in the installation. But i didn't really understand some part of the tutorial. like :

includes/classes/order.php (add the SITE_NAME to the order table)
i do not get what it mean by add the site name to the order table.

Is this what costing the problem.

Please check out what happening.

https://www.klenterprise.com

games.klenterprise.com

i did make new template and config for both site. But for games.klenterprise.com is not even showing. And https://www.klenterprise.com is showing me a blank page.

How can i fix this. and im using bluehost

Thanks. Please point me into a right direction.
Kelvin
:unsure::unsure::unsure::unsure:

1 May 2009, 1:20 AM
#775
lstensland avatar

lstensland

New Zenner

Join Date:
Mar 2009
Location:
California
Posts:
4
Plugin Contributions:
0

Re: MultiSite Module Support Thread

I have a site that was created by someone else. I have created sub domains, each with it's own cart. Now all I want to do is link the login and customers cart between the main site and sub domains.

I have tried following the directions to install this entire mod and my original site stopped working. I have restored the site and the sub domains.

Does anyone know how to link just what the customer uses, login, register, account history, shopping cart, etc.?

8 May 2009, 1:23 AM
#776
milobloom avatar

milobloom

Totally Zenned

Join Date:
Feb 2004
Posts:
1,267
Plugin Contributions:
1

Re: MultiSite Module Support Thread

Sorry if this has been asked before.
I couldn't find the answer.

How do I handle the Google Products feed when I have this module?

8 May 2009, 10:38 PM
#777
nyrad avatar

nyrad

New Zenner

Join Date:
Dec 2008
Posts:
44
Plugin Contributions:
0

Re: MultiSite Module Support Thread

i have copied all of my active zen cart files to a test folder, altered the appropriate config to point in to the test folder, and installed this mod. using my redirects i can get the pages to come up, but no side boxes. started to modify by selecting the template, but it change the layout (template) on the active site as well as the test site....is this because i did not do a fresh install for my test site, or did i miss a config step somewhere?

9 May 2009, 11:46 AM
#778
jkovar avatar

jkovar

New Zenner

Join Date:
Dec 2008
Location:
Cypress, Texas
Posts:
4
Plugin Contributions:
0

Re: MultiSite Module Support Thread

You have to create template "folder" for each site. Your config file points to the approprieate "template". You put your overrides in those folders (sideboxes, template themes, etc) An easy way to see an example is to install a second template and have your second site us that one. Read thru the instruction for multisite again. It give you direction on which folders are absolutely necessary.

9 May 2009, 2:04 PM
#779
nyrad avatar

nyrad

New Zenner

Join Date:
Dec 2008
Posts:
44
Plugin Contributions:
0

Re: MultiSite Module Support Thread

i have created all of the templates, but cannot see any sideboxes; tried dropping in the config info, but it is not happening

13 May 2009, 7:32 AM
#780
incredibody_com avatar

incredibody_com

New Zenner

Join Date:
May 2007
Posts:
42
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Is include_once('includes/config_sites/sites_switch.php'); supposed to go before or after <?php?

It says to put it at the top of the file but I wasn't sure if that actually meant at the very top or below the <?php

When I put it before I get the error below:

include_once('includes/config_sites/sites_switch.php'); 1054 Unknown column 'CATEGORIES_ROOT' in 'where clause'
in:
[select cd.categories_name from categories c, categories_description cd where cd.categories_description LIKE '%-SITE_NAME-%' AND cd.language_id=1 AND c.parent_id = CATEGORIES_ROOT and c.categories_id = cd.categories_id and cd.language_id='1' and c.categories_status=1]

When I put it after I get the error below:

the domain https://www.musclewithoutsupplements.com does not exist.

Any ideas on this?