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

Subcategory Mods on 4.2.0

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #21  
Old 05-06-2009, 06:40 AM
 
artmatt artmatt is offline
 

Member
  
Join Date: Aug 2006
Posts: 12
 

Default Re: Subcategory Mods on 4.2.0

Not far off for 4.2.0. I've just come to need this mod again, and I needed the sorting to work so took a look into it.

As benz says in the first bit of code I posted change
Code:
$a =func_get_categories_list("", true, "all");

to
Code:
$a =func_get_categories_list("", true, "sub_orderby");

Then you need to add the bit from benz's last post but it's not on line 68 of categories.php anymore it's now on line 533ish of /include/func/func.category.php

Add the two lines of code and it seems to work perfectly.

Hope this helps someone
__________________
Xcart Pro Version 4.1.2
Reply With Quote
  #22  
Old 06-11-2009, 03:35 PM
  buckyreal2's Avatar 
buckyreal2 buckyreal2 is offline
 

Member
  
Join Date: Jul 2003
Location: Minneapolis, Minnesota
Posts: 11
 

Default Re: Subcategory Mods on 4.2.0

Anybody know how to make this work with sub- subcategories?
__________________
X-Cart 4.2
Reply With Quote
  #23  
Old 06-11-2009, 11:15 PM
 
artmatt artmatt is offline
 

Member
  
Join Date: Aug 2006
Posts: 12
 

Default Re: Subcategory Mods on 4.2.0

I've made it work with sub-sub cats, will post how it's done when I get time.

But if I remember correctly all the data is there, so you just have to add the code to the categories.tpl file to display the sub-sub-cats.

Have a play you just need to make a sub loop in the same format, it can then be extended again and again for each further level you require.

Hope that makes sense

Sorry I haven't got time to post it at the moment
__________________
Xcart Pro Version 4.1.2
Reply With Quote
  #24  
Old 06-14-2009, 07:01 PM
  wmreich's Avatar 
wmreich wmreich is offline
 

Member
  
Join Date: Jan 2003
Location: Arizona
Posts: 20
 

Thumbs up Re: Subcategory Mods on 4.2.0

Thank you artmatt
__________________
X-Cart Gold v4.2.1
Reply With Quote
  #25  
Old 06-18-2009, 11:00 AM
 
buckyreal buckyreal is offline
 

Newbie
  
Join Date: Apr 2003
Posts: 5
 

Default Re: Subcategory Mods on 4.2.0

Thank you artmatt! The code you posted worked great!

I hope you can find time to post the sub-sub category sub-loop. I understand what you are saying, but I don't know where to start to implement it.
__________________
Tobias Ross
Ineye.com

Xcart 4.2.2
Reply With Quote
  #26  
Old 06-22-2009, 10:33 AM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Subcategory Mods on 4.2.0

How can you make this only show subcategories in a certain category? Victor if you can help I would really appreciate this.

Also, can you limit the amount of results shows for subcategories and maybe leave it with another one called 'More...'?
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #27  
Old 07-02-2009, 09:23 PM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Subcategory Mods on 4.2.0

Bump any ideas how to show like 5 random subcategories in a main category? Any help would be greatly appreciated.
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #28  
Old 07-13-2009, 01:14 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Subcategory Mods on 4.2.0

Quote:
5 random subcategories in a main category?
These categories should be from the root level or from any level?
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #29  
Old 07-13-2009, 09:23 AM
  pairodimes's Avatar 
pairodimes pairodimes is offline
 

Advanced Member
  
Join Date: Dec 2007
Posts: 50
 

Default Re: Subcategory Mods on 4.2.0

Quote:
Originally Posted by artmatt
Not far off for 4.2.0. I've just come to need this mod again, and I needed the sorting to work so took a look into it.

As benz says in the first bit of code I posted change
Code:
$a =func_get_categories_list("", true, "all");

to
Code:
$a =func_get_categories_list("", true, "sub_orderby");

Then you need to add the bit from benz's last post but it's not on line 68 of categories.php anymore it's now on line 533ish of /include/func/func.category.php

Add the two lines of code and it seems to work perfectly.

Hope this helps someone

I tried this method - found the line in the /include/func/func.category.php - patched it - but the categories still show up in the wrong order once we get to the Sub category level. Its weird how it shows up in the correct order when we are on the Parent Category (which dsiplays the subcategory list). Any corrolation?

Also - another question - is it possible to Not Show the <UL> for Categories that do NOT HAVE Sub categories.

The way the code is written - It runs a loop on all Categories - then runs an IF - the Category has a parent ID of the same number - then display the Sub Category list.

But I wish I could run a loop that only displayed Categories that had a ParentID of '0' (root) then ran an IF - the Category has a parent ID of the same number - then display the Sub Category list.

The reason is - this is creating unncessary UL tags and shifting my css design. Anybody know how to do this?

Is there any way to run an IF statement on the $allcategories array to check if it returns Nothing (null - no value)? Then print the UL only if the value was NOT Null?
__________________
------
Brian

Portland web design / development
X-Cart 4.1.9 (a few carts)
X-Cart 4.2.0 (1 cart so far)
Reply With Quote
  #30  
Old 08-18-2009, 04:01 PM
 
iDC Photography iDC Photography is offline
 

Member
  
Join Date: Jun 2009
Posts: 13
 

Default Re: Subcategory Mods on 4.2.0

This mod is freakin awesome!

I needed something to get me half way to making an accordion menu, and this did the job.

I have followed all the directions I could, but am having a strange problem.

Menu works GREAT on the homepage, no problems at all.

But every other page doesn't load the subcategories. I tried with the original code and my "tweaked" version to display as an accordion.

Why would the subcats not display on the child pages? Any ideas?

The shop isn't open for business yet, and I am in the styling stages.

If you need to see it, send me a PM.

THX!
__________________
X-Cart version 4.2.1
Product Configurator 4.2.1
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 12:51 AM.

   

 
X-Cart forums © 2001-2020