My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
I was looking for the answer to this issue but couldn't find it. On my site, the sub-category is running into the Parent category. How do I resolve this?
http://www.sunfluersjewelrydesigns.com
Apologies if this is a duplicate post.....
Thanks in advance
Tony
Your stylesheet has
stylesheet_header_menu.css (line 82)
div#dropMenu ul.level3, div#dropMenu ul.level4, div#dropMenu ul.level5, div#dropMenu ul.level6, div#dropMenu ul.level7, div#dropMenu ul.level8 {
background: none repeat scroll 0 0 #4F4F4F;
left: 12em;
top: 0;
}
Change the 12em to 100% and the submenus will move all the way to the right edge of their parent.
That did it...tnx so much.....
Hi
Thank you very much for this great script, i run it and it works fine, however it made my sidebox categories disappear! i was using script for the sidebox categories calls Click-Show-Hide Category Menu.
when i research it, i found out that the issue is coming from file called categories_ul_generator.php as yours override it,
below is that script i had running in that file, is there any way way we can integrate both script in way both works?
Thank you
Adam
// Showing category counts will use default Zen function, which generates massive
// recusive database queries. Could be improved by instead retrieving in a single
// query all products to categories and then using recursive PHP to fetch counts.
class zen_categories_ul_generator {
var $root_category_id = 0,
$max_level = 6,
$data = array(),
$root_start_string = '',
$root_end_string = '',
$parent_start_string = '',
$parent_end_string = '',
$parent_group_start_string = '%s<ul>',
$parent_group_end_string = '%s</ul>',
$child_start_string = '%s<li>',
$child_end_string = '%s</li>',
$spacer_string = '',
$spacer_multiplier = 1;
var $document_types_list = ' (3) '; // acceptable format example: ' (3, 4, 9, 22, 18) '
function zen_categories_ul_generator() {
global $languages_id, $db, $request_type;
$this->server = ((ENABLE_SSL == true && $request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER);
$this->base_href = ((ENABLE_SSL == true && $request_type == 'SSL') ? DIR_WS_HTTPS_CATALOG : DIR_WS_CATALOG);
$this->data = array();
$categories_query = "select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd " .
"where c.categories_id = cd.categories_id and c.categories_status=1 and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
"order by c.parent_id, c.sort_order, cd.categories_name";
$categories = $db->Execute($categories_query);
while (!$categories->EOF) {
$products_in_category = (SHOW_COUNTS == 'true' ? zen_count_products_in_category($categories->fields['categories_id']) : 0);
$this->data[$categories->fields['parent_id']][$categories->fields['categories_id']] = array('name' => $categories->fields['categories_name'], 'count' => $products_in_category);
$categories->MoveNext();
}
// DEBUG: These lines will dump out the array for display and troubleshooting:
// foreach ($this->data as $pkey=>$pvalue) {
// foreach ($this->data[$pkey] as $key=>$value) { echo '['.$pkey.']'.$key . '=>' . $value['name'] . '<br>'; }
// }
}
function buildBranch($parent_id, $level = 0, $cpath = '') {
global $cPath;
$result = "\n".sprintf($this->parent_group_start_string, str_repeat(' ', $level*4))."\n";
if (isset($this->data[$parent_id])) {
foreach ($this->data[$parent_id] as $category_id => $category) {
$result .= sprintf($this->child_start_string, str_repeat(' ', $level*4+2));
if (isset($this->data[$category_id])) {
$result .= $this->parent_start_string;
}
if ($level == 0) {
$result .= $this->root_start_string;
$new_cpath = $category_id;
} else {
$new_cpath = $cpath."_".$category_id;
}
if ($cPath == $new_cpath) {
$result .= '<a href="javascript:void(0)" class="on">'; // highlight current category & disable link
} else {
$result .= '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $new_cpath) . '">';
}
$result .= $category['name'];
if (SHOW_COUNTS == 'true' && ((CATEGORIES_COUNT_ZERO == '1' && $category['count'] == 0) || $category['count'] >= 1)) {
$result .= CATEGORIES_COUNT_PREFIX . $category['count'] . CATEGORIES_COUNT_SUFFIX;
}
$result .= '</a>';
if ($level == 0) {
$result .= $this->root_end_string;
}
if (isset($this->data[$category_id])) {
$result .= $this->parent_end_string;
}
if (isset($this->data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) {
$result .= $this->buildBranch($category_id, $level+1, $new_cpath);
$result .= sprintf($this->child_end_string, str_repeat(' ', $level*4+2))."\n";
} else {
$result .= sprintf($this->child_end_string, '')."\n";
}
}
}
$result .= sprintf($this->parent_group_end_string, str_repeat(' ', $level*4))."\n";
return $result;
}
function buildTree() {
return $this->buildBranch($this->root_category_id, 0);
}
}
?>
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Apparently both mods have a version of categories_ul_generator.php, so they would somehow need to be merged. Not sure that is even possible; it would take an expert examination of both files to know for sure.
Hi,
I'm trying to target the first and last item in the lower level category submenus (i.e. level2) so i can put a top border on the first item & a bottom border on the last item. Any idea how I can accomplish this?
I know I can use css -- I just don't know how to target the first and last <li>'s in the code.
Does that make sense?
Nevermind! I just put a border around the whole UL & that did what I needed it to. : )
I posted this in reference to the upgrade to v. 1.3.9h that I'm currently trying to install.
I am using this mod. BEAUTIFUL...
Except...
My ZC is installed in a subfolder (on instructions from my server, so as to not interfere with the smooth functioning of my live care),
Anyway the problem is here: http://www.peppermaster.com/peppermaster-shop
As you can see the menus work beautifully... Except that the products are NOT in the subfolder but rather the live site products!
Is there a call to the DB somewhere that needs to be adjusted for the mod so it pulls the products from the subdirectory's db? I can't for the life of me figure out where it is and I don't have time to read through 225 pages of Q&A.
Bookmarks