| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Display All Subcat Products in Parent Cat | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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 |
|||||||
#2
|
|||||||
|
|||||||
![]() 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 |
|||||||
#3
|
|||||||
|
|||||||
![]() 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. |
|||||||
#4
|
|||||||
|
|||||||
![]() 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 |
|||||||
#5
|
|||||||
|
|||||||
![]() 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. |
|||||||
#6
|
|||||||||
|
|||||||||
![]() 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. |
|||||||||
#7
|
|||||||
|
|||||||
![]() 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 |
|||||||
#8
|
|||||||
|
|||||||
![]() 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 |
|||||||
|
#9
|
|||||||
|
|||||||
![]() 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 |
|||||||
#10
|
|||||||
|
|||||||
![]() 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 |
|||||||
|
|||
X-Cart forums © 2001-2020
|