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

Display All Subcat Products in Parent Cat

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-28-2006, 06:05 PM
 
tedski tedski is offline
 

Newbie
  
Join Date: Sep 2006
Posts: 4
 

Default Display All Subcat Products in Parent Cat

I am trying to display all products under a subcategory when a user opens its parent category. Let me illustrate: If we have CategoryA with SubcategoryA1 and SubcategoryA2 and they have SubcategoryA1i and SubcategoryA1ii. In addition we have CategoryB with SubcategoryB1 and SubcategoryB2 and they have SubcategoryB1i and SubcategoryB1ii.

I would like when a user clicks on CategoryA, it shows all products in all categories beneath it (SubcategoryA1, SubcategoryA2, SubcategoryA1i, and SubcategoryAii), but not any under CategoryB. I hope this makes sense.

I realize the easy way out would be to add all categories to their parent category as an additional category. Is there any loop I could create that would automatically display all products in subcategories beneath the current level?
__________________
X-Cart Gold v4.1.3
Reply With Quote
  #2  
Old 11-02-2006, 06:24 AM
 
showoff showoff is offline
 

Member
  
Join Date: Apr 2004
Posts: 27
 

Default Re: Display All Subcat Products in Parent Cat

I╢m trying to do the same thing but i╢m running into a lot of problems. I thought I got it to work but it was listing all items in my store...
Any help please?
__________________
Showoff Imports.nl - Largest Tuning Store of Europe
-----------------------------------
Currently using X-Cart 4.1.3
Reply With Quote
  #3  
Old 11-09-2006, 06:00 PM
 
fogelka fogelka is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 83
 

Default Re: Display All Subcat Products in Parent Cat

I, too, am looking for a solution to this. Anyone have any ideas?

Thanks.
__________________
xcart v4.0.18 [linux]

Loyalty Points, DSEFU, Easy Checkout, Featured Product Manager, Remember Me, Relevant Search, Vertical Flyouts, Multiple Category Templates. Loads of other tweaks and mods learned in forums.
Reply With Quote
  #4  
Old 11-09-2006, 06:04 PM
 
tedski tedski is offline
 

Newbie
  
Join Date: Sep 2006
Posts: 4
 

Default Re: Display All Subcat Products in Parent Cat

I did a Search and Modify and just added all categories to their root category. It adds an extra step to product adding, but it works.
__________________
X-Cart Gold v4.1.3
Reply With Quote
  #5  
Old 11-09-2006, 06:33 PM
 
fogelka fogelka is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 83
 

Default Re: Display All Subcat Products in Parent Cat

Thanks for the tip. I'll have to try that out.
__________________
xcart v4.0.18 [linux]

Loyalty Points, DSEFU, Easy Checkout, Featured Product Manager, Remember Me, Relevant Search, Vertical Flyouts, Multiple Category Templates. Loads of other tweaks and mods learned in forums.
Reply With Quote
  #6  
Old 07-18-2007, 09:04 PM
  1CNS's Avatar 
1CNS 1CNS is offline
 

Advanced Member
  
Join Date: Mar 2004
Location: Los Angeles, CA, USA
Posts: 45
 

Default Re: Display All Subcat Products in Parent Cat

I'm another person who's been looking for this solution. I'm not sure I understand the solution posted. The idea is, when a root category (a) is clicked, and that category has subcategories (a1) and (a2), the site generates a page like:

Category A Heading

Subcategory A1 Heading
A1 Item 1
A1 Item 2
A1 Item 3

Subcategory A2 Heading
A2 Item 1
A2 Item 2
A2 Item 3

Basically instead of a page of subcategory links for root category (a), those subcategories and their products are all displayed under headings on one page.

Any tips would be greatly appreciated.
__________________
www.funkymart.com
x-cart 4.2.1 [linux]
Reply With Quote
  #7  
Old 08-06-2007, 05:11 AM
 
liquid liquid is offline
 

Member
  
Join Date: Jul 2006
Posts: 14
 

Default Re: Display All Subcat Products in Parent Cat

I'm also looking for this solution. Has anyone had any luck?
__________________
lite commerce 2.2 [unix]
x-cart -gold 4.1.4 [unix]
canada
Reply With Quote
  #8  
Old 12-05-2008, 11:17 AM
 
shorelineoftahoe shorelineoftahoe is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 30
 

Default Re: Display All Subcat Products in Parent Cat

Actually, it's really easy.

in products.php modify this line:
$search_data["products"]["search_in_subcategories"] = "";

to

$search_data["products"]["search_in_subcategories"] = "Y";

If you want to show all products in all subcategories on the home page you need to modify these lines in home.php:

if (!empty($cat))
include "./products.php";

to

#if (!empty($cat))
include "./products.php";

That's all. I haven't tested this too much so I don't know about unforeseen consequences. I'll refer back if there is a problem.
__________________
xcart v. 4.18-4.4
Reply With Quote

The following user thanks shorelineoftahoe for this useful post:
timbrrr (04-06-2012)
  #9  
Old 01-10-2009, 11:38 AM
 
albertchui albertchui is offline
 

Senior Member
  
Join Date: Aug 2005
Posts: 163
 

Default Re: Display All Subcat Products in Parent Cat

wow, that is what i want, but how can i just show the products only in product page without the subcategory.

In order to show the subcategory, i wish the subcategory will show in the left hand column when click the root category, like www.art.com, many thanks
__________________
X-Cart Gold 4.6
Reply With Quote
  #10  
Old 01-30-2009, 08:09 AM
 
shorelineoftahoe shorelineoftahoe is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 30
 

Default Re: Display All Subcat Products in Parent Cat

That's a configuration setting you can change in the backend of xcart here:
http://www.YOURSITE.com/admin/configuration.php?option=General

Uncheck the box that says:
If ticked, the categories list always shows root categories
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


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 11:28 AM.

   

 
X-Cart forums © 2001-2020