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

Results 2,141 to 2,160 of 2,247
22 Oct 2020, 7:28 AM
#2141
royaldave avatar

royaldave

Zen Follower

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

MultiSite Module Support Thread

Hi

I might be prepared to update the module myself - it's crucial to my business and I think I have enough nous to pull if off.

That said, I haven't tried it on 157 yet so don't know what to expect - will report back when I get some time - business is crazy at present so finding spare time is difficult.

11 Nov 2020, 9:36 PM
#2142
noppie avatar

noppie

Zen Follower

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

Re: MultiSite Module Support Thread

does anyone using google merchant upload with this multi-site.. if you do, how do you send it to the separate sites.? so far I use the main store to up load, but i would like to send each store instead of the main store. thank you.

My Multi_Site Zen Carts
http://herasonlinemarket.com

11 Dec 2020, 1:50 AM
#2143
carbonless avatar

carbonless

Zen Follower

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

Re: MultiSite Module Support Thread

There are many core files to update if you are going to upgrade to 1.5.7... There were too many for me to even consider it worth my time. We're breaking our stores out into separate installations. ZC has made it so easy to upgrade the newer versions of the cart and SSL certs are so inexpensive, that the we are finding the multi-store mod is not worth the investment of time or money any more.

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

24 Dec 2020, 7:14 PM
#2144
leowald avatar

leowald

New Zenner

Join Date:
Jul 2006
Posts:
35
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Hi,
I'm a little confused at how this works. I see that you can purchase in one cart from different sites. What if each site has a different payment options for example different paypal addresses?
Is it at all possible to have categories on one site that combines all products of the same category on all sites?

Thanks.

25 Dec 2020, 4:29 AM
#2145
noppie avatar

noppie

Zen Follower

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

Re: MultiSite Module Support Thread

I am working on this as we speak.. I had it installed a few years ago.. and now i have need for it again.

how it work. you can create as many stores as you want.. the front-in.. what the customer see's depends on what URL they use. but the you only have one admin for all the stores.. and when you get the multi-site working right it is really cool.

the is a tool under admin/tools called multi-site.
this where you decide which categories show up on which site you created.
if you have one site that sells clothes and a different site that sell paintings.. you want two different sites but don't want to deal with a more than one admin.
now if you want different payments options for different stores.. that would be a lot of extra work to create that.
and would be possible if you know coding and how the zen cart works. the area that all the carts (different sites you created) share are payment options, shipping options, account creation that is all i can think of at this time. and you can use different templates for each store.
YOu need to use the 156c verison of zencart.. there are way too many changes using the lastest zencart.
if you have any questions.. you can pm me.. and i will do my best to help.

Leowald:

Hi,
I'm a little confused at how this works. I see that you can purchase in one cart from different sites. What if each site has a different payment options for example different paypal addresses?
Is it at all possible to have categories on one site that combines all products of the same category on all sites?

Thanks.

My Multi_Site Zen Carts
http://herasonlinemarket.com

25 Dec 2020, 8:45 AM
#2146
leowald avatar

leowald

New Zenner

Join Date:
Jul 2006
Posts:
35
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Thanks so much for your reply. It seems that this is not what I'm looking for then. I was under the impression that with it, I could have different payment and shipping options per site - I was pretty sure I read that somewhere.
Thanks again.

25 Dec 2020, 1:28 PM
#2147
carbonless avatar

carbonless

Zen Follower

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

Re: MultiSite Module Support Thread

Leowald:

Thanks so much for your reply. It seems that this is not what I'm looking for then. I was under the impression that with it, I could have different payment and shipping options per site - I was pretty sure I read that somewhere.
Thanks again.

You CAN have different payment and shipping methods.

HOWEVER, it is currently not a supported mod with current versions of ZC.

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

25 Dec 2020, 8:03 PM
#2148
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: MultiSite Module Support Thread

Disclaimer: I've done very limited testing with this, and definitely have not used it on a live site.

However, that said, attached is an updated beta of the multisite mod with the v157 updates merged into it.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

25 Dec 2020, 8:12 PM
#2149
noppie avatar

noppie

Zen Follower

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

Re: MultiSite Module Support Thread

thank you 'dr byte. I will have to try it out down the road.

My Multi_Site Zen Carts
http://herasonlinemarket.com

29 Dec 2020, 1:37 AM
#2150
cpt_tom avatar

cpt_tom

New Zenner

Join Date:
Aug 2012
Location:
Corning, NY
Posts:
8
Plugin Contributions:
0

Re: MultiSite Module Support Thread

That is an amazing thing! I was just trying to figure out how I was going to continue the two V1.5.1 stores we have that got nuked by our hosting company upgrading PHP to 5.6 (of course with out notice).

I will try this as soon as I get our test site up and running...I will report if I can get it working. Merry Christmas indeed!

DrByte:

Disclaimer: I've done very limited testing with this, and definitely have not used it on a live site.

However, that said, attached is an updated beta of the multisite mod with the v157 updates merged into it.

29 Dec 2020, 3:06 AM
#2151
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,890
Plugin Contributions:
20

Re: MultiSite Module Support Thread

I'm racking my brain at how to say this nicely but, those looking at posts for answers need to realize that (as in this case) some of the folks shoot themselves in the foot and then want to complain.

Unfortunately, you were using a ZC version released over eight years ago using a PHP version that was End Of Life over six years ago.

And then, that nasty host had the audacity to upgrade to PHP 5.6 which was EOL two years ago.:P They could have updated to PHP 7.2 BUT, that was EOL a month ago. Even PHP 7.3 will go EOL in a year. The good news is that you can get 1.5.7b going with PHP 5.6. However, I'd be concerned about when the host is going to be able to provide for your newer needs.

It depends on the terms and conditions of your host as to whether or not they were required to notify you of the changes in hosting. We keep track of who's using what and would never drop their coverage without notifying them ahead of time. Fortunately, other features of our servers allow us to do this without losing security.

I'm not saying everyone has to jump with every release of MySQL, PHP or Zen Cart. However, in the world of the internet and e-commerce, just two years behind can make a huge difference in the operation of your store.

One case in point was an upgrade to 1.5.7b from 1.5.3. The store owner was concerned that business was getting slower and slower. Had no idea that there were nearly 100,000 debug files in the logs folder. In 1.5.7#, it's just a simple click to have Zen Cart let you know when something goes bump in the night.

Bottom line here is that I fear you are going to try to run two stores with neither having a solid foundation. Please find a way to get to 1.5.7b with PHP 7.4 and make your foundation solid before putting two stores on it. Leave the old store running and build with the new. Don't make matters worse trying to continually put bandaids on your site.

This mod can be very helpful and, with DrByte's efforts, you'll more than likely have a working solution IF you get the foundation repairs completed.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

29 Dec 2020, 12:46 PM
#2152
IDEASLady avatar

IDEASLady

Totally Zenned

Join Date:
Aug 2005
Location:
Trujillo Alto, Puerto Rico
Posts:
1,455
Plugin Contributions:
4

Re: MultiSite Module Support Thread

However, that said, attached is an updated beta of the multisite mod with the v157 updates merged into it.
I will definitely install in sandbox and try it.

I'm racking my brain at how to say this nicely but, those looking at posts for answers need to realize that (as in this case) some of the folks shoot themselves in the foot and then want to complain.
Great advice!

Some people will not even delete old folders and/or installations and then they get hacked. They don't understand there's an open door in their server, when they do that.

IDEASLady
IDEAS Creative Studio

Your image... our business!

1 Jan 2021, 2:25 AM
#2153
cpt_tom avatar

cpt_tom

New Zenner

Join Date:
Aug 2012
Location:
Corning, NY
Posts:
8
Plugin Contributions:
0

Re: MultiSite Module Support Thread

Indeed. Good advice and taken.. Oh I am NOT asking for any sympathy or understanding...it was entirely within our power to avoid the disaster. It was entirely self inflicted. It just sucked worse because it happened on the holiday weekend.

Currently, the primary store has been rebuilt with Zen Cart 1.5.7b, with PHP 7.4,13 and MySQL 5.6. Just sorting out some weirdness that has occurred because of other issues that appeared. We aren't even going to try multisite until everything shakes out for a time.

10 Jan 2021, 7:45 AM
#2154
noppie avatar

noppie

Zen Follower

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

Re: MultiSite Module Support Thread

ok I am using zencart 156c
of have ceon url mapping.. (latest one)

i am trying to use the fluorspar 6.1

cookies mod.
and multi-site
and i got a blank front page and the debug file below. and i have reloaded and reloaded and keep getting this debug error and blank front page.

now i put the line the code says.. hopefully it helps. and what else i need just let me know.

[10-Jan-2021 07:18:44 UTC] PHP Fatal error: Uncaught Error: Call to a member function add() on null in /home/herasonl/public_html/shop/includes/init_includes/overrides/init_sessions.php:15
$breadcrumb->add(HEADER_TITLE_CATALOG, zen_href_link(FILENAME_DEFAULT)); line 15 of init_sessions.php

Stack trace:
#0 /home/herasonl/public_html/shop/includes/autoload_func.php(48): require()
/**
* include an init_script as specified by autoloader array
*/
require($baseDir . $entry['loadFile']); line 40 of autoload

#1 /home/herasonl/public_html/shop/includes/application_top.php(170): require('/home/herasonl/...')

require('includes/autoload_func.php'); line 170

#2 /home/herasonl/public_html/shop/index.php(26): require('/home/herasonl/...')
#3 {main}
thrown in /home/herasonl/public_html/shop/includes/init_includes/overrides/init_sessions.php on line 15
require('includes/application_top.php');

[10-Jan-2021 07:18:44 UTC] Request URI: /shop/index.php?main_page=index&cPath=21, IP address: 24.113.216.190
--> PHP Fatal error: Uncaught Error: Call to a member function add() on null in /home/herasonl/public_html/shop/includes/init_includes/overrides/init_sessions.php:15
Stack trace:
#0 /home/herasonl/public_html/shop/includes/autoload_func.php(48): require()
#1 /home/herasonl/public_html/shop/includes/application_top.php(170): require('/home/herasonl/...')
#2 /home/herasonl/public_html/shop/index.php(26): require('/home/herasonl/...')
#3 {main}
thrown in /home/herasonl/public_html/shop/includes/init_includes/overrides/init_sessions.php on line 15.

My Multi_Site Zen Carts
http://herasonlinemarket.com

10 Jan 2021, 2:31 PM
#2155
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: MultiSite Module Support Thread

noppie:

PHP Fatal error: Uncaught Error: Call to a member function add() on null in /includes/init_includes/overrides/init_sessions.php:15
$breadcrumb->add(HEADER_TITLE_CATALOG, zen_href_link(FILENAME_DEFAULT)); line 15 of init_sessions.php
That means $breadcrumb hasn't been initialized/created yet, which is expected because init_sessions loads at order 70 whereas breadcrumbs at 160.

I'm not sure why line 15 of your init_sessions would be setting a breadcrumb yet.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

10 Jan 2021, 9:18 PM
#2156
noppie avatar

noppie

Zen Follower

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

Re: MultiSite Module Support Thread

DrByte:

That means $breadcrumb hasn't been initialized/created yet, which is expected because init_sessions loads at order 70 whereas breadcrumbs at 160.

I'm not sure why line 15 of your init_sessions would be setting a breadcrumb yet.

the multi-site has the init_sessions.php in the overrides file.. and it is below.. thank you

<?php /** * create the breadcrumb trail * see {@link <http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem> wikitutorials} for more details. * * @package initSystem * @copyright Copyright 2003-2019 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: Zen4All 2019 Jul 07 Modified in v1.5.6c $ */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } $breadcrumb->add(HEADER_TITLE_CATALOG, zen_href_link(FILENAME_DEFAULT)); /** * add category names or the manufacturer name to the breadcrumb trail */ if (!isset($robotsNoIndex)) $robotsNoIndex = false; // might need isset($_GET['cPath']) later ... right now need $cPath or breaks breadcrumb from sidebox etc. if (isset($cPath_array) && isset($cPath)) { for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) { // bof Multi site $categories_query = "select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and categories_id!='".CATEGORIES_ROOT."' and language_id = '" . (int)$_SESSION['languages_id'] . "'"; // bof Multi site $categories = $db->Execute($categories_query); if ($categories->RecordCount() > 0) { $breadcrumb->add($categories->fields['categories_name'], zen_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1))))); } elseif(SHOW_CATEGORIES_ALWAYS == 0) { // if invalid, set the robots noindex/nofollow for this page $robotsNoIndex = true; break; } } } /** * add get terms (e.g manufacturer, music genre, record company or other user defined selector) to breadcrumb */ $sql = "select * from " . TABLE_GET_TERMS_TO_FILTER; $get_terms = $db->execute($sql); while (!$get_terms->EOF) { if (isset($_GET[$get_terms->fields['get_term_name']])) { $sql = "select " . $get_terms->fields['get_term_name_field'] . " from " . constant($get_terms->fields['get_term_table']) . " where " . $get_terms->fields['get_term_name'] . " = " . (int)$_GET[$get_terms->fields['get_term_name']]; $get_term_breadcrumb = $db->execute($sql); if ($get_term_breadcrumb->RecordCount() > 0) { $breadcrumb->add($get_term_breadcrumb->fields[$get_terms->fields['get_term_name_field']], zen_href_link(FILENAME_DEFAULT, $get_terms->fields['get_term_name'] . "=" . $_GET[$get_terms->fields['get_term_name']])); } } $get_terms->MoveNext(); } /** * add the products model to the breadcrumb trail */ if (isset($_GET['products_id'])) { $productname_query = "select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$_GET['products_id'] . "' and language_id = '" . $_SESSION['languages_id'] . "'"; $productname = $db->Execute($productname_query); if ($productname->RecordCount() > 0) { $breadcrumb->add($productname->fields['products_name'], zen_href_link(zen_get_info_page($_GET['products_id']), 'cPath=' . $cPath . '&products_id=' . $_GET['products_id'])); } } ?>

My Multi_Site Zen Carts
http://herasonlinemarket.com

11 Jan 2021, 2:13 AM
#2157
noppie avatar

noppie

Zen Follower

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

Re: MultiSite Module Support Thread

i just give up trying to get this to work with the fluorspar template.
i am going to use the template that came with the software.. and that is working so far..
thank you Doc byte with the multi-site update.. i used that one and so far so good. thank you for all your work.

My Multi_Site Zen Carts
http://herasonlinemarket.com

28 Apr 2021, 2:46 AM
#2158
noppie avatar

noppie

Zen Follower

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

Re: MultiSite Module Support Thread

hi you all, I am back..
I tried to add new pictures to my categories and here is what happens,.. when i put in the new pictures in and saved it.. the <--heras, Kandi---> disappears.. and when I went to the multi site tool the heras, kandi is missing also..

here is the debug

28-Apr-2021 02:34:21 UTC] Request URI: /shop/angRy-SZm-trusT/index.php?cmd=multisite&action=categories_sites, IP address: 24.113.216.190
#1 sizeof() called at [/angRy-SZm-trusT/multisite.php:209]
#2 require(/angRy-SZm-trusT/multisite.php) called at [/angRy-SZm-trusT/index.php:11]
--> PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /angRy-SZm-trusT/multisite.php on line 209.

(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((

<?php /** * Multisite for Zen-Cart * * This file should be in includes/admin/multisite.php * */ require('includes/application_top.php'); $action = (isset($_GET['action']) ? $_GET['action'] : ''); /** * Save cats/sites */ if (isset($action) && ($action == 'categories_sites') && isset($_GET['mode']) && ($_GET['mode'] == 'save')) { if (isset($_GET['site'])) { $site_param = '&site=' . $_GET['site']; } else { $site_param = ''; } if (isset($_POST['site'])) { foreach ($_POST['site'] as $multisite_cat_id => $multisite_sites) { $multisite_query = $db->Execute("SELECT categories_description, language_id FROM " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE categories_id = " . (int)$multisite_cat_id); foreach ($multisite_query as $site) { $multisite_cat_desc = preg_replace('/<!--(.|\s)*?-->/', '', $site['categories_description']); while ($multisite_cat_desc['0'] == "\n") { $multisite_cat_desc = substr($multisite_cat_desc, 1); } if ($multisite_sites != '') { $multisite_cat_desc = "<!--$multisite_sites-->\n$multisite_cat_desc"; } //echo $multisite_cat_id.' -> '.$multisite_cat_desc."\n"; $sql = "UPDATE " . TABLE_CATEGORIES_DESCRIPTION . " SET categories_description = :multisiteCategoriesDescription WHERE language_id = " . (int)$site['language_id'] . " AND categories_id = " . (int)$multisite_cat_id; $sql = $db->bindVars($sql, ':multisiteCategoriesDescription', $multisite_cat_desc, 'string'); $db->Execute($sql); } } } zen_redirect(zen_href_link(FILENAME_MULTISITE, 'action=' . $_GET['action'] . $site_param)); exit; } ?> <!doctype html> <html <?php echo HTML_PARAMS; ?>> <head> <meta charset="<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <link rel="stylesheet" href="includes/stylesheet.css"> <link rel="stylesheet" href="includes/cssjsmenuhover.css" media="all" id="hoverJS"> <script src="includes/menu.js"></script> <script src="includes/general.js"></script> <script type="text/javascript"> function init() { cssjsmenu('navbar'); if (document.getElementById) { var kill = document.getElementById('hoverJS'); kill.disabled = true; } }
  function add_to_all_cats() {
      var new_site = $('#txt_site').val();
      if (new_site != '') {
          var form_elements = document.forms["save_multisite"].elements;
          for (var element_id in form_elements) {
              if ((form_elements[element_id].name) && (form_elements[element_id].name.substr(0, 5) == " site[")) {
                  if (form_elements[element_id].value == '') {
                      form_elements[element_id].value = new_site;
                  } else {
                      var split_sites = form_elements[element_id ].value.split("-");
                      var found = false;
                      for (var i in split_sites) {
                          if (split_sites\[i] == new_site) {
                              found = true;
                          }
                      }
                      if (!found) {
                          split_sites[split_sites.length] = new_site;
                      }
                      split_sites.sort();
                      form_elements[element_id].value = split_sites.join('-');
                  }
              }
          }
          $('#txt_site').val('');
      }
  }
  function remove_from_all_cats() {
      var rmv_site = $('#txt_site').val();
      if (rmv_site != '') {
          var form_elements = document.forms['save_multisite'].elements;
          for (var element_id in form_elements) {
              if ((form_elements[element_id].name) && (form_elements[element_id].name.substr(0, 5) == 'site[')) {
                  var split_sites = form_elements[element_id].value.split("-");
                  var split_result = new Array();
                  var j = 0;
                  for (var i  in split_sites) {
                      if (split_sites\[i] != rmv_site) {
                          split_result[j] = split_sites\[i];
                          j++;
                      }
                  }
                  split_result.sort();
                  form_elements[element_id].value = split_result.join('-');
              }
          }
          $('#txt_site').val('');
      }
  }
</script>
</head> <body onLoad="init()"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //-->
<!-- body //-->
<div class="container-fluid">
  <!-- body_text //-->
  <h1><?php echo MULTISITE_TITLE; ?></h1>
  <?php

//Display menu ...
?>
<div class="row text-center">
<a href="<?php echo zen_href_link(FILENAME_MULTISITE, 'action=display_config'); ?>" class="btn btn-default" role="button"><?php echo MULTISITE_CONFIG_LINK; ?></a> - <a href="<?php echo zen_href_link(FILENAME_MULTISITE, 'action=categories_sites'); ?>" class="btn btn-default" role="button"><?php echo MULTISITE_RELATIONS_LINK; ?></a>
</div>
<?php if (isset($action)) { switch ($action) { case 'display_config': ?>
<div class="row text-center">
<?php echo MULTISITE_CONFIG_TEXT; ?><br><br>
<textarea name="code" class="php form-control" cols="100" rows="40" style="width:90%;">
<?php $config_query = $db->Execute("SELECT cg.configuration_group_title,c.configuration_key,c.configuration_value,c.configuration_title FROM " . TABLE_CONFIGURATION . " c LEFT JOIN " . TABLE_CONFIGURATION_GROUP . " cg ON c.configuration_group_id = cg.configuration_group_id ORDER BY cg.sort_order, c.sort_order"); $current_group_title = ''; foreach ($config_query as $config) { if ($config['configuration_group_title'] != $current_group_title) { $current_group_title = $config['configuration_group_title']; echo "\n/**\n"; echo " * $current_group_title\n"; echo " */\n"; } echo "define('" . ($config['configuration_key'] . "','" . $config['configuration_value'] . "'); //" . str_replace("\n", ' ', $config['configuration_title']) . "\n"); } ?>
</textarea>
</div>
<?php break; case 'categories_sites': if (!isset($_GET['mode']) || ($_GET['mode'] != 'save')) { ?>
<div class="row">
<div class="text-center">
<h4><?php echo MULTISITE_CATEGORIE_TITLE; ?></h4>
<p><?php echo MULTISITE_CATEGORIE_TEXT; ?></p>
</div>
<?php echo zen_draw_label(MULTISITE_CATEGORIE_ADD_LABEL, 'txt_site', ' class="control-label col-sm-3"'); ?>
<div class="col-sm-9 col-md-6">
<?php echo zen_draw_input_field('txt_site', '', 'id="txt_site" size="32" class="form-control"'); ?>
</div>
<div class="col-sm-offset-3 col-sm-9 col-md-6 text-right" style="margin-top: 5px;">
<button type="button" onclick="add_to_all_cats()" class="btn btn-default"><?php echo MULTISITE_BUTTON_ADD_ALL; ?></button>
<button type="button" onclick="remove_from_all_cats()" class="btn btn-default"><?php echo MULTISITE_BUTTON_REMOVE_ALL; ?></button>
<span class="help-block"><?php echo MULTISITE_CATEGORIE_REMINDER_TEXT; ?></span>
</div>
<?php $multisite_category_tree = zen_get_category_tree(); //print_r($multisite_category_tree);exit; $multisite_list = array(); if (isset($_GET['site'])) { $filter = ' AND cd.categories_description LIKE "%-' . $_GET['site'] . '-%" '; $site_param = '&site=' . $_GET['site']; } else { $filter = ''; $site_param = ''; } $total_cats = sizeof($multisite_category_tree) - '1'; foreach ($multisite_category_tree as $multisite_key => $multisite_category) { if ($multisite_category['id'] == '0') { unset($multisite_category_tree[$multisite_key]); //remove the top category } else { $multisite_query = $db->Execute("SELECT cd.categories_description,c.categories_status FROM " . TABLE_CATEGORIES_DESCRIPTION . " cd INNER JOIN " . TABLE_CATEGORIES . " c ON cd.categories_id = c.categories_id WHERE c.categories_id = " . $multisite_category['id'] . " " . $filter); $sites = array(); if ($multisite_query->EOF) { unset($multisite_category_tree[$multisite_key]); } else { foreach ($multisite_query as $item) { $multisite_cat_desc = $item['categories_description']; preg_match_all('/<!--(.|\s)*?-->/', $multisite_cat_desc, $multisite_comments, PREG_PATTERN_ORDER); $multisite_cat_sites = array(); foreach ($multisite_comments['0'] as $multisite_comment) { this is line 209 -----> $multisite_comment = preg_replace('/\s\s+|/', '', $multisite_comment); $multisite_cat_sites[] = substr($multisite_comment, 4, sizeof($multisite_comment) - 4); //remove html comment } //Add to the list of all sites $multisite_cat_sites = implode('-', $multisite_cat_sites); $new_sites = explode('-', $multisite_cat_sites); foreach ($new_sites as $site) { if ($site != '') { $sites[$site] = '1'; } } } //print_r($sites);exit; ksort($sites); $multisite_cat_sites = array(); foreach ($sites as $site => $value) { $multisite_cat_sites[] = $site; } $multisite_category_tree[$multisite_key]['sites'] = implode('-', $multisite_cat_sites); $multisite_category_tree[$multisite_key]['status'] = $multisite_query->fields['categories_status']; $multisite_category_tree[$multisite_key]['cPath_parent'] = MultisiteGetcPath($multisite_category['id']); if ($multisite_category_tree[$multisite_key]['cPath_parent'] == '0') { $multisite_category_tree[$multisite_key]['cPath'] = $multisite_category['id']; } else { $multisite_category_tree[$multisite_key]['cPath'] = $multisite_category_tree[$multisite_key]['cPath_parent'] . '_' . $multisite_category['id']; } foreach ($sites as $site => $value) { if (!isset($multisite_list[$site])) { $multisite_list[$site] = '1'; } else { $multisite_list[$site] ++; } } } } } arsort($multisite_list); $display_sites = array(); $display_sites[] = '<a href="' . zen_href_link(FILENAME_MULTISITE, 'action=' . $action) . '" class="btn btn-default btn-sm" role="button">' . MULTISITE_CATEGORIE_ALL_TEXT . '</a> (' . $total_cats . ')'; foreach ($multisite_list as $site => $cat_number) { $display_sites[] = '<a href="' . zen_href_link(FILENAME_MULTISITE, 'action=' . $action . '&site=' . $site) . '" class="btn btn-default btn-sm" role="button">' . $site . '</a> (' . $cat_number . ')'; } ?>
<div class="col-sm-12 text-center">
<?php echo implode(' - ', $display_sites) . "<br><br>\n"; ?>
</div>
<div class="col-sm-12">
<?php echo zen_draw_form('save_multisite', FILENAME_MULTISITE, 'action=' . $action . '&mode=save' . $site_param, 'post', 'enctype="multipart/form-data" class="form-horizontal"'); ?>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary"><?php echo IMAGE_SAVE; ?></button>
</div>
<table class="table table-striped">
<thead>
<tr>
<th><?php echo TABLE_HEADING_MULTISITE_CATEGORIE; ?></th>
<th><?php echo TABLE_HEADING_MULTISITE_SITE; ?></th>
<th><?php echo TABLE_HEADING_ACTION; ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($multisite_category_tree as $multisite_category) { ?>
<tr>
<td>
<a href="<?php echo zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $multisite_category['cPath']); ?>">
<?php echo str_replace(' ', ' ', str_replace('   ', '_ ', $multisite_category['text'])); ?>
</a>
</td>
<td>
<?php echo zen_draw_input_field('site[' . $multisite_category['id'] . ']', $multisite_category['sites'], 'class="form-control"'); ?>
</td>
<td>

                        <?php
                        if ($multisite_category['status'] == '1') {
                          ?>
                          <a target="_blank" href="<?php echo zen_href_link(FILENAME_CATEGORIES, 'action=setflag_categories&flag=0&cID=' . $multisite_category['id'] . '&cPath=' . $multisite_category['cPath_parent']); ?>'"><?php echo zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON); ?></a>
                          <?php
                        } else {
                          ?>
                          <a target="_blank" href="<?php echo zen_href_link(FILENAME_CATEGORIES, 'action=setflag_categories&flag=1&cID=' . $multisite_category['id'] . '&cPath=' . $multisite_category['cPath_parent']); ?>"><?php echo zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF); ?></a>
                          <?php
                        }
                        ?>
                         <a href="<?php echo zen_href_link(FILENAME_CATEGORIES, 'action=edit_category&cPath=' . $multisite_category['cPath_parent'] . '&cID=' . $multisite_category['id']); ?>">
                          <?php echo zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT); ?></a>
                      </td>
                    </tr>
                    <?php
                  }
                  ?>
                </tbody>
              </table>
              <div class="form-group">
                <button type="submit" class="btn btn-primary"><?php echo IMAGE_SAVE; ?></button>
              </div>
              <?php echo '</form>'; ?>
            </div>
            <?php
          }
          ?>
        </div>
        <?php
        break;
    }
  }
  ?>
  <!-- body_text_eof //-->
</div>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

My Multi_Site Zen Carts
http://herasonlinemarket.com

28 Apr 2021, 7:16 AM
#2159
design75 avatar

design75

Totally Zenned

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

Re: MultiSite Module Support Thread

I just tried on my test site, and can not replicate your error.
In your post you say <--heras, Kandi--->, this should be ```
<!--heras-Kandi--->

Maybe that's where things go wrong?
28 Apr 2021, 9:39 PM
#2160
noppie avatar

noppie

Zen Follower

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

Re: MultiSite Module Support Thread

you would not be able to because it is on the admin side. when I go to add a new photo for the categories.. the<!--heras-Kandi---> disappears.. and no photo will show.

My Multi_Site Zen Carts
http://herasonlinemarket.com