| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
How do I display all subcategories along with all products | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
How do I display all subcategories along with all products
How do I display all subcategories along with all products under each subcategory on one page, here is what I want to do:
1 root category, has 2 subcategories, when customer clicks on root category, the subcategories.tpl displays 2 lines listed 2 subcategories, which is pretty ugly, I want it to dispaly like the following: subcategory1 product1 under subcategory1 product2 under subcategory1 product3 under subcategory1 .... subcategory2 product1 under subcategory2 product2 under subcategory2 ..... Thanks in advance if you can point me into a right direction
__________________
XCart 4.0.18 Gold X-Giftregistry Neon light Fashion mosaic Tabbed product menu |
|||||||
#2
|
|||||||
|
|||||||
TTT. I am looking for the same exact thing. Did anyone contact you prvately by chance with a aolution? Or were you able to find something in another threads that solved this for you? Thanks!
Brian
__________________
X-Cart Gold v4.0.18 [unix] - Easy Checkout module - ezUpsell module - CDSEO module X-Cart Gold v4.1.11 [unix] ***38,000+ active products! - CDSEO module - Address Book module - Reorder module - Smart Search module X-Cart Gold v4.4.2 [unix] - in development now! |
|||||||
#3
|
|||||||
|
|||||||
:: EDIT ::
Okay here's what I did and so far it seems to work: The $products array gets defined in a code snippet at the bottom of $xcart_dir/products.php. I moved that code snippet into a new file $xcart_dir/products_by_catid.php and modified products.php to include the new file. Now I have the freedom to load a $products array any time I want. I simply set $cat then include products_by_catid.php. After I verified that this small change worked (i.e. hit reload and page still there), I then modified products.php to cycle through the $subcategories array and, for each subcategory, grab the products list and store it in a "products" field. What would make this mod really nice would be a simple way to enable/disable it from the admin console. Any Ideas? Also, the code snippet that I added to products.php could just as easily be placed in $xcart_dir/home.php instead, which may actually be a more appropriate place for it. Feeback appreciated. Thanx -D PS: Oh, and it would be nice to have another mod that would add the subcats for the subcats I might try that one later. --- Here's a small test snippet and the file changes for the mod: Test Snippet To Try In: $xcart_dir/skin1/customer/main/subcategories.tpl Code:
Create New File: $xcart_dir/products_by_catid.php Code:
Modify File: $xcart_dir/products.php Code:
=== Original Post === I could really use a response to this if anyone is out there? It looks like "products.php" finds the product list via a specialized search. I was thinking we could do a similar thing within the loop that cycles through the sub-cats. I was also thinking of trying to modify home.php and/or categories.php and/or products.php to create "subcat_products[subCatId]" (and possibly subcat_subcats[]) My concern with these is the extra function calls or includes changing variables that aren't needed for this mod but might be needed by other pages. Ideas?
__________________
X-Cart v4.1.10 Gold |
|||||||
#4
|
|||||||
|
|||||||
Re: How do I display all subcategories along with all products
I needed to add
Code:
Code:
Here's why: If the category has no products but has multiple subcategories, and if the last category of those subcategories has products, the page would display these products twice. Once within the sub category and once underneath the category.
__________________
X-Cart Gold 4.2.2 - 3.1.19 |
|||||||
#5
|
|||||||
|
|||||||
Re: How do I display all subcategories along with all products
Do you guys have a sample URL I could take a look at to see what this would look like?
__________________
Version 4.1.11 |
|||||||
#6
|
|||||||
|
|||||||
Display SubCategory titles with products
I have searched through the forum and could not find anyone who has been able to implement this:
SubCategory Title ------------------------------------------- product1 product2 product3 product4 SubCategory Title2 ------------------------------------------- product1 product2 product3 product4 Right now, it only shows products in the root category with all the SubCategory Titles above.
__________________
Version 4.1.11 |
|||||||
#7
|
|||||||||
|
|||||||||
Re: Display SubCategory titles with products
Do you mean on the crumb trail ?
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!) Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x Multiple Instances of X-Cart MySQL 5.6.37 CentOS 7.4 Chamber Internet - Lancashire, United Kingdom http://www.chamberelancs.co.uk |
|||||||||
#8
|
|||||||
|
|||||||
Re: How do I display all subcategories along with all products
Here's a store that utilizes this custom mod: View Example Live Store
The store owner hasn't added many products yet but you should still be able to get a good idea of how it looks.
__________________
X-Cart Gold 4.2.2 - 3.1.19 |
|||||||
#9
|
|||||||
|
|||||||
Re: How do I display all subcategories along with all products
Do you have the mod instructions for installation? I am using 4.1.8 and it does not apear to work for me with the instructions above.
__________________
Version 4.1.11 |
|||||||
#10
|
|||||||
|
|||||||
Re: Display SubCategory titles with products
No, on the actual page.
I need it to appear like this sample: http://www.jackmansfabrics.com/Bridal-Fabrics-p-1-c-294.html
__________________
Version 4.1.11 |
|||||||
|
|||
X-Cart forums © 2001-2020
|