X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Has anyone found a good categories mod to show subs in 4.1.3 yet? (https://forum.x-cart.com/showthread.php?t=27296)

jasonroy 12-12-2006 07:33 AM

Has anyone found a good categories mod to show subs in 4.1.3 yet?
 
I haven't really seen anything I've been able to get to work.

I want to display one level of subcategories in the categories menu on version 4.1.3

I tried one mod that was posted but was unable to get it working, think it might have been for 4.0.x

If you know of anything, thanks in advance.

carpeperdiem 12-12-2006 10:37 AM

Re: Has anyone found a good categories mod to show subs in 4.1.3 yet?
 
How about PhilJ's CSS based mods?

Four level vertical flyout category menu

jasonroy 12-12-2006 01:17 PM

Re: Has anyone found a good categories mod to show subs in 4.1.3 yet?
 
It was suggested, but I was hoping for a freebie.

I've spent too much already on a site thats not making any money, I'm hoping on changing that of course, but until I do I've gotta cut back

chris2002 02-21-2007 10:14 AM

Re: Has anyone found a good categories mod to show subs in 4.1.3 yet?
 
Solution for 4.1.6

Cat A
--Cat A1
--Cat A2
Cat B
--Cat B1
--Cat B2

Only one modification in incude/categorie.php

Search for this in your code :
#
# Override subcategory_count for Admin area
#
if(!empty($subcategories) && ($current_area == 'A' || ($current_area == 'P' && $active_modules['Simple_Mode']))) {
$product_counts = func_query_hash("SELECT categoryid, COUNT(*) FROM $sql_tbl[products_categories] WHERE categoryid IN ('".implode("','", array_keys($subcategories))."') GROUP BY categoryid", "categoryid", false, true);
foreach($subcategories as $k => $v) {
$subcategories[$k]['subcategory_count'] = func_query_first_cell("SELECT COUNT(subcat.categoryid) as subc FROM $sql_tbl[categories] USE INDEX (PRIMARY) LEFT JOIN $sql_tbl[categories] as subcat ON subcat.categoryid_path LIKE CONCAT($sql_tbl[categories].categoryid_path, '/%') WHERE $sql_tbl[categories].categoryid = '$k' GROUP BY $sql_tbl[categories].categoryid");
$subcategories[$k]['product_count_global'] = $subcategories[$k]['product_count'];
$subcategories[$k]['product_count'] = isset($product_counts[$k]) ? intval($product_counts[$k]) : 0;
}
}



then add this just below the line :


//Subcategories in menu
function func_getallsubcat()
{
$raj =func_get_categories_list("", true, "all");
$raj1=$raj['all_categories'];
$ll=array();
foreach ($raj1 as $k=>$val)
{
if($val['parentid']!="0")
{
$ll[$val['parentid']][]=$val;
}
}
return $ll;
}
$smarty->assign("allsubcategories", func_getallsubcat());
//Subcategorie in menu - end

thank you

chris2002 02-21-2007 05:37 PM

Re: Has anyone found a good categories mod to show subs in 4.1.3 yet?
 
I forget this line too

in skin1/customer/categories.tpl

Where you need to show the subcategorie
{assign var=in value=$c.categoryid}
{foreach from=$allsubcategories.$in item=c }

and the link to show subcategories
<a href="home.php?cat={$c.categoryid}" class="yourclassforsub">{$c.category}<br></a>

thank you I was forogotten it in my previous post

Thank you


All times are GMT -8. The time now is 11:49 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.