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

ALWAYS display first level subcats beneath root cats

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #41  
Old 04-19-2007, 11:34 AM
 
nevets1219 nevets1219 is offline
 

eXpert
  
Join Date: Jun 2006
Posts: 351
 

Default Re: ALWAYS display first level subcats beneath root cats

Thanks for providing this! I found it extrememly helpful.
__________________
4.1.8
Reply With Quote
  #42  
Old 05-05-2007, 03:33 PM
 
Wambli Wambli is offline
 

Advanced Member
  
Join Date: Sep 2005
Posts: 52
 

Default Re: ALWAYS display first level subcats beneath root cats

kerbsp,
where do I put that css file or how do I attach it
__________________
Christmas
x-cart 4.1.6
Reply With Quote
  #43  
Old 05-06-2007, 10:12 AM
 
Kerbsp Kerbsp is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 95
 

Default Re: ALWAYS display first level subcats beneath root cats

Quote:
Originally Posted by Wambli
kerbsp,
where do I put that css file or how do I attach it

To keep things simple, I added it to my skin1.css file.

xcart admin > edit templates > skin1.css

or

/xcart_root/skin1/skin1.css
__________________
Xcart 4.0.17 - XAOM - XRMA - Special Offer - Sales & Stats
______
www.futurevis.com
Reply With Quote
  #44  
Old 05-11-2007, 12:37 AM
 
FueledMedia FueledMedia is offline
 

Member
  
Join Date: Jul 2005
Location: Phoenix, AZ
Posts: 12
 

Default Re: ALWAYS display first level subcats beneath root cats

A general note:

I have created a css template that does not use tables. For search engine optimization, the main content area is the first thing in the template - the sidebars appear after the main content area in the code...

The problem is that when I apply this mod for 4.1.6, any language variables that appear before the categories include do not work... for example, my sort function when viewing a cateogory displayed as "Sort by: Sort direction ~~~~|lbl_product| ||~~~~ ~~~~|lbl_price| ||~~~~ ~~~~|lbl_default| ||~~~~" as did my location.tpl info...

Anyone have any idea why this is? I would love to use this mod, but also do not want to sacrifice search engine rankings... I am guessing that it is related to the function added in categories.php...

Please help!
__________________
Chris
Fueled Media

X-Cart 4.1.6
Reply With Quote
  #45  
Old 05-11-2007, 01:54 AM
 
FueledMedia FueledMedia is offline
 

Member
  
Join Date: Jul 2005
Location: Phoenix, AZ
Posts: 12
 

Default Re: ALWAYS display first level subcats beneath root cats

Found the issue.. In Andrew's code for categories.tpl, he has the open capture tag, but not the closing one... If you want to use the menu.tpl template on this menu, you need to add the closing capture tag and the include for the menu.tpl at the end of the file. If you want this as a standalone menu (not inside the menu.tpl file) then remove the capture line near the top.
__________________
Chris
Fueled Media

X-Cart 4.1.6
Reply With Quote
  #46  
Old 05-11-2007, 03:02 AM
 
FueledMedia FueledMedia is offline
 

Member
  
Join Date: Jul 2005
Location: Phoenix, AZ
Posts: 12
 

Default Re: ALWAYS display first level subcats beneath root cats

Something else - the sub-categories do not display in order... to fix it, replace the code from post 32 with this code in your categories.php:

Code:
//Subcategories in menu function sort_by_order_by($a, $b) { if ($a['order_by'] == $b['order_by']) { return 0; } return ($a['order_by'] < $b['order_by']) ? -1 : 1; } function func_getallsubcat() { $raj =func_get_categories_list("", true, "all"); $raj1=$raj['all_categories']; usort($raj1 ,"sort_by_order_by"); $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
Fueled Media

X-Cart 4.1.6
Reply With Quote
  #47  
Old 06-09-2007, 06:04 PM
 
BornMunson BornMunson is offline
 

Advanced Member
  
Join Date: Jan 2005
Posts: 46
 

Default Re: ALWAYS display first level subcats beneath root cats

Im trying to display subcategories at all times... All the suggestions so far only seem to display subcategories after you have selected the parent category.

Anyone done this mod so that all subcategories show at all times?
__________________
X-Cart 4.7.3
Reply With Quote
  #48  
Old 06-11-2007, 04:41 PM
 
BornMunson BornMunson is offline
 

Advanced Member
  
Join Date: Jan 2005
Posts: 46
 

Default Re: ALWAYS display first level subcats beneath root cats

Anyone got any suggestions?? I've spent 5 hours trying to get it to display all the categories and subcatgegories on every page but can't figure this stuff out... I can only get it to display subcategories after I click on the category. Any help would be much appreciated.
__________________
X-Cart 4.7.3
Reply With Quote
  #49  
Old 06-12-2007, 01:47 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,055
 

Default Re: ALWAYS display first level subcats beneath root cats

Sounds like you have missed a bit out where you add code to include/categories.php. Have you done that, or just edited templates?
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #50  
Old 06-14-2007, 08:40 PM
 
BornMunson BornMunson is offline
 

Advanced Member
  
Join Date: Jan 2005
Posts: 46
 

Default Re: ALWAYS display first level subcats beneath root cats

Been trying to install this mod again and I am clueless as to why it only displays main and subcategories after the main category is clicked. I edited my /include/categories.php to include this code below, at about line 329 right under the code it mentioned in post #32.
//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


Then I have tried all of the different categories.tpl, copy and pasting them into my /skin1/customer/categories.tpl file... I have been able to get them to show subcategories only after you click the parent category. I have been trying this for over a week now and I am really stumped and out of ideas... I am also running cdseo and the new skin available in X-cart 4.1.7 which I think was called light something.... I dont think these 2 things would affect the subcategories not displaying on the main page, but maybe I am wrong... Anyone have any ideas what could possibly be wrong and is everyone running this in 4.1.7?
__________________
X-Cart 4.7.3
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 05:05 AM.

   

 
X-Cart forums © 2001-2020