Forums / Templates, Stylesheets, Page Layout / Urgent: Subcategories don't display when products exist

Urgent: Subcategories don't display when products exist

Locked

Views: 2,859

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
10 Jul 2006, 10:39 PM
#1
cfe avatar

cfe

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Urgent: Subcategories don't display when products exist

If you quickly browse a little in my cart here, then you'll see that whenever you navigate to a category that contains products, no subcategories are displayed. They can still be seen by referring to the sidebox on the left, but I really need to have then in the main window.

Also it might be noted that when a category with no immediate products is opened, any subcategories there in are visible as they should be.

This cart recently went live, please help!

10 Jul 2006, 11:07 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Urgent: Subcategories don't display when products exist

Categories should contain Categories ...

--- OR ---

Categories should contain Products ...

Categories are NOT designed to contain both Categories and Products at the same time ...

You will get display errors, search erros, price errors, etc.

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

10 Jul 2006, 11:27 PM
#3
cfe avatar

cfe

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Re: Urgent: Subcategories don't display when products exist

Huh, thanks for the reply. I wasn't expecting that to be the case...this problem arises because I've transfered my entire Cube cart installation (which does use the subcat/product listing) functionality. It still seems that this would be a fairly simple modification, as the functionality exists to list both - I just need to do it at the same time.

Anyone point me towards the correct files? Thanks again!

10 Jul 2006, 11:30 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Urgent: Subcategories don't display when products exist

You can do:

Category
  Subcategory
    Product
    Product
  Subcategory
    Product
    Product
    Product
    Product
Category
    Product
    Product
    Product
    Product
Category
  Subcategory
    Product
    Product
    Product
    Product
  Subcategory
    Product
    Product
    Product
    Product
  Subcategory
    SubSubcategory
      Product
      Product
      Product
      Product
   Subsubcategory
      Product
      Product
Category
    Product
    Product

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

11 Jul 2006, 3:26 PM
#5
cfe avatar

cfe

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Re: Urgent: Subcategories don't display when products exist

I understand the functionality, it just becomes a problem in that the entire structure of my cart (some 1500 items) is already in place, and I'd rather not sift through the entire thing trying to find subcat's for products I know little about. If I can avoid it....

So, I'm thinking (probably naively) that since the cart can already list both, that my problem could be solved my copying the code that lists the subcategories (when no products are present), and pasting it in the code where products are listed. I'm currently pouring over code in he \includes\modules\product_listing.php file. Am I on the right track? Any tips?

Already backed-up btw, so no worries there. Thanks!

11 Jul 2006, 4:58 PM
#6
cfe avatar

cfe

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Re: Urgent: Subcategories don't display when products exist

Welp, I've tracked the sought functions to:

\includes\templates\template_default\templates\tpl_index_product_list.php
\includes\templates\template_default\templates\tpl_index_categories.php
-and most importantly-
\includes\modules\pages\index\main_template_vars.php

The lfinal makes a call to either of the first two, depending on whether it wants to list products OR subcategories. I want it to do both, but the obvious revisions didn't work. It seems that when one is called the page is cleared before listing, so just calling both won't work. I tried commenting out a few lines here and there and juggled some code to no avail.

Doesn't help that I know no php...

I may seek another solution (reorganizing), but if anyone has any suggestions it would be greatly appreciated. Thanks once more.

11 Jul 2006, 6:55 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Urgent: Subcategories don't display when products exist

Do not mix Categories and Products into the same Category or you will be doomed ... :eek:

See other post ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!