| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
V4 - keeping first level subcategories viewable at all times | ||||
|
|
Thread Tools | Search this Thread |
#51
|
|||||||||
|
|||||||||
Re: V4 - keeping first level subcategories viewable at all times
Did you get mine??
I've sended it right after you PM'ed me. Mark
__________________
X-Cart 4.2.2 / PHP 5.2.9 / Webserver Apache 2.0.63 (FreeBSD) / MySQL 5.0.77 http://www.hemmaplanet.eu |
|||||||||
#52
|
|||||||
|
|||||||
Re: V4 - keeping first level subcategories viewable at all times
Did anyone ever get this done or find out how to do this in 4.1.x?
Thanks, Jaim http://www.premiumpowersports.com |
|||||||
#53
|
|||||||||
|
|||||||||
Re: V4 - keeping first level subcategories viewable at all times
Solution for 4.1.6
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
__________________
Chris ---------------------------------------- X-Cart Gold 4.1.xx / 4.2.xx Need some Help in french Webdesign or else. ---------------------------------------- |
|||||||||
#54
|
|||||||||
|
|||||||||
Re: V4 - keeping first level subcategories viewable at all times
I forget this...
and 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
__________________
Chris ---------------------------------------- X-Cart Gold 4.1.xx / 4.2.xx Need some Help in french Webdesign or else. ---------------------------------------- |
|||||||||
#55
|
|||||||
|
|||||||
Re: V4 - keeping first level subcategories viewable at all times
hi
followed your instructions but it doesnt appear to work - changed the categories.php - then the categories.tpl ? im sure im missing something, can you help $subcategories[$k]['product_count_global'] = $subcategories[$k]['product_count']; $subcategories[$k]['product_count'] = isset($product_counts[$k]) ? intval($product_counts[$k]) : 0; } } //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 //if (!empty($subcategories)) // $smarty->assign("subcategories", $subcategories); //$smarty->assign("cat", $cat); ?>
__________________
Version 4.1.3 |
|||||||
#56
|
|||||||
|
|||||||
Re: V4 - keeping first level subcategories viewable at all times
Any solution to this??? I'm having the same issue... no subcats at all working here with last example
__________________
Version 4.1.6 |
|||||||
|
|||
X-Cart forums © 2001-2020
|