Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

V4 - keeping first level subcategories viewable at all times

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #51  
Old 10-25-2006, 09:50 AM
  Pantalonas's Avatar 
Pantalonas Pantalonas is offline
 

Member
  
Join Date: Aug 2006
Posts: 28
 

Default 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
Reply With Quote
  #52  
Old 02-08-2007, 09:11 PM
 
jaimwolfe jaimwolfe is offline
 

Advanced Member
  
Join Date: Jan 2007
Posts: 57
 

Default 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
__________________
http://premiumpowersports.com
Xcart gold Version 4.1.6
Reply With Quote
  #53  
Old 02-21-2007, 10:08 AM
  chris2002's Avatar 
chris2002 chris2002 is offline
 

Advanced Member
  
Join Date: Mar 2006
Location: French Polynesia
Posts: 30
 

Default 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.
----------------------------------------
Reply With Quote
  #54  
Old 02-21-2007, 05:39 PM
  chris2002's Avatar 
chris2002 chris2002 is offline
 

Advanced Member
  
Join Date: Mar 2006
Location: French Polynesia
Posts: 30
 

Default 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.
----------------------------------------
Reply With Quote
  #55  
Old 02-25-2007, 01:11 PM
 
onlineweb onlineweb is offline
 

Newbie
  
Join Date: Dec 2006
Posts: 4
 

Default 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
Reply With Quote
  #56  
Old 05-07-2007, 11:33 AM
 
himerus himerus is offline
 

Newbie
  
Join Date: Mar 2007
Posts: 1
 

Default 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
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:06 AM.

   

 
X-Cart forums © 2001-2020