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.
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.
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.p...als#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
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
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.configu ration_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
I just tried on my test site, and can not replicate your error.
In your post you say, this should beCode:<--heras, Kandi--->Maybe that's where things go wrong?Code:<!--heras-Kandi--->
Zen cart installation / maintenance / customisation / hosting
Supported Modules: Dutch language pack, Multi site, Dynamic Price Updater and more.
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
i made a small recording to show what is going on.https://youtu.be/g6-eAeYXIww
My Multi_Site Zen Carts
http://herasonlinemarket.com
Have tried using the plain text option, instead of ckEditor?
Zen cart installation / maintenance / customisation / hosting
Supported Modules: Dutch language pack, Multi site, Dynamic Price Updater and more.
this is probly the lamest question but.. How do i Triger the diff sites? I have followed the instructions (I think) I have 2 domains the initial install on 1 and the other to Triger the second store. I have done a domain redirect but all that comes up is the first store. how do i set up domain 2 to triger site 2?