Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Should sub-categories list on category page by default? - if not how to activate?

    v1.5.5f php7.1 harmonyballpendant.com

    Q1. are sub categories supposed to be listed on the main category page by default? .... if so then I have an issue ... if not then please see Q2.

    A category page with sub-categories is not listing the sub categories, i.e. page title shows and nothing else, not even the category description. If I add two products to that category using 'copy to' of products from another category then the category description shows up. Category number is 49, sub-categories are then numbered 49_50, 49_51 etc etc thru to 49_61 .... not sure if they should be 49_1, 49_2 etc so hence not sure if they were set up properly originally 3 versions ago? I understand that a main category is not designed to have products in it but I assume it should list the sub-categories, right? (Sub-categories do show in menu side box once main category is clicked - switching that on/off works fine)

    Q2. How do I get the sub-categories to show on the category page? I cannot find anything in admin/configuration/layout settings to switch sub-categories on or off (except for in menu) nor anything in FAQ's nor a specific topic in forums.

    cheers,
    Mike

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Should sub-categories list on category page by default? - if not how to activate?

    This appears to be a continuation of a previous thread on the same topic: https://www.zen-cart.com/showthread....37#post1352037 where at least part of an answer was provided (though the details of the necessary settings were not).

    So, regarding Q1, which could be impacted by the template in use (suggest temporarily switching to one of the default templates to ensure observing the intended operation.), but for categories to be shown on the main page, the following settings are necessary though may also help if you post the settings you currently have in the associated configuration listings:
    In configuration->Products Listing be sure to set 'Show SubCategories on Main Page while navigating' to 1.
    Also in the same configuration area set 'Include Product Listing Sub Categories Image' to true to see the images, and look at the other similar settings related to categories in that menu.
    In configuration->images, there are settings for the size of the related category images that may need to be adjusted if the category(ies) are otherwise shown, but the image is say super small.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Re: Should sub-categories list on category page by default? - if not how to activate?

    Quote Originally Posted by mc12345678 View Post
    This appears to be a continuation of a previous thread on the same topic: https://www.zen-cart.com/showthread....37#post1352037 where at least part of an answer was provided (though the details of the necessary settings were not).

    So, regarding Q1, which could be impacted by the template in use (suggest temporarily switching to one of the default templates to ensure observing the intended operation.), but for categories to be shown on the main page, the following settings are necessary though may also help if you post the settings you currently have in the associated configuration listings:
    In configuration->Products Listing be sure to set 'Show SubCategories on Main Page while navigating' to 1.
    Also in the same configuration area set 'Include Product Listing Sub Categories Image' to true to see the images, and look at the other similar settings related to categories in that menu.
    In configuration->images, there are settings for the size of the related category images that may need to be adjusted if the category(ies) are otherwise shown, but the image is say super small.
    Thanks MC - you hit the nail on the head (again) - it is indeed a template thing. I am using Westminster_New by Picaflor Azul - I switched to Responsive Classic and the category page appeared as it should (with description and image links to sub-categories).

    I will now scour the template forum to see if I can find a fix and will let you know in here - if I don't find a fix I will likely ask for a hint from you as to what file may be the culprit.

    cheers,
    Mike

    p.s. categories / sub-categories are showing as intended on main page with correct settings in configuration
    Last edited by shags38; 20 Dec 2018 at 11:16 PM.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Should sub-categories list on category page by default? - if not how to activate?

    Quote Originally Posted by shags38 View Post
    Thanks MC - you hit the nail on the head (again) - it is indeed a template thing. I am using Westminster_New by Picaflor Azul - I switched to Responsive Classic and the category page appeared as it should (with description and image links to sub-categories).

    I will now scour the template forum to see if I can find a fix and will let you know in here - if I don't find a fix I will likely ask for a hint from you as to what file may be the culprit.

    cheers,
    Mike

    p.s. categories / sub-categories are showing as intended on main page with correct settings in configuration
    Well, without even opening the first file, you can narrow it down based on what was seen. It is obviously related to an overridden template file. So you could compare the template's files with the default or responsive version of the same file...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Re: Should sub-categories list on category page by default? - if not how to activate?

    Quote Originally Posted by mc12345678 View Post
    Well, without even opening the first file, you can narrow it down based on what was seen. It is obviously related to an overridden template file. So you could compare the template's files with the default or responsive version of the same file...
    Hi MC - my investigation so far leads me to includes/classes/categories_ul_generator.php and includes/modules/westminster_new/category_row.php as being the files that would be responsible (?).

    Please refer to this thread and your suggestions for modifications to both files when I had a problem with categories on the main page >> https://www.zen-cart.com/showthread....ue-Breaks-Page - I checked those files and they are modified as you suggested.

    I even replaced those 2 files from v1.5.6 but still the problem exists - so it is likely to be something else however I have swapped out all the template overrides I could see one by one and still no change - needless to say I am stumped. Trying to figure what would say 'do not show content on this page'. If I add products then it is a different story as mentioned in original post.

    I found this post in the Westminster Template forum where it seems someone else had the same issue but there does not seem to be a response to that particular post that I can see. https://www.zen-cart.com/showthread....24#post1340624

    cheers,
    Mike

  6. #6
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Should sub-categories list on category page by default? - if not how to activate?

    As reread in the referenced post, it appears that there is some level of failed html validation. What that means is that where a tag is opened possibly within another tag, that the inner tag(s) need to close before the outer tags are closed and all tags opened need to be closed...

    It's like trying to take your car from the curb to the garage. To get the car into the garage, a person has to drive the car (the car doesn't have an auto-driver option). This means that the door to the car has to be opened. But, for the car to fit through the garage door, the car door has to be closed at some point. But for that matter the garage door has to be open for the car to safely go through (again no magical drive thru door, sky lift, underground left system nor can the doorway be magically widened.)

    Anyways, from what was posted, content appears to be pushed to the browser, but the browser can not make sense of it and only provides a portion of the content that it does understand.

    Such "non-sense" won't necessarily cause a php error logged in the logs directory. It has to be discovered through other means. There are publicly available html validation tools that at least can identify what html is out-of-place and then the developer's tool kit can be used to hunt down the area of code in question.

    As to the two files, well, the class file is something applicable to all templates, so if the issue goes away when choosing one template over another, then it is not the base cause of the issue. As to the message that was given to the other template file? Well the base ZC install was giving the same message until some updates were pushed by other members of the community. So, I would say that is not necessarily the cause.

    I would suggest (again without specifically looking) taking a look at the differences of the includes/templates/winchester_new/common/tpl_main_page.php file with each of the template_default and responsive_classic versions. I wouldn't be surprised though if the template had been designed to specifically exclude that feature from the main page with focus being on the scroller and other flashy aspects.

    Oh, and I never addressed the category grouping numbering... the path (cPath) shows the sequence of categories taken to get to the current display. It is not like the numbering of the last item in that path changes to match how many categories are assigned within the parent category. Every category gets a unique number. Every category can be the child of another category. Ideally all categories lead to the main category having a category_id of 0. So the category that was the 10th to be created could be referenced by cPath=10 to show just that category and any child information off of it. If it was moved into the category that was the 15th to be created then the cPath would be cPath=15_10. When breadcrumbs are turned on and you are in a product of that category or looking at children categories you should see the name associated with category 15 before (above) the name of the currently discussed category.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Re: Should sub-categories list on category page by default? - if not how to activate?

    Quote Originally Posted by mc12345678 View Post
    As reread in the referenced post, it appears that there is some level of failed html validation. What that means is that where a tag is opened possibly within another tag, that the inner tag(s) need to close before the outer tags are closed and all tags opened need to be closed...

    It's like trying to take your car from the curb to the garage. To get the car into the garage, a person has to drive the car (the car doesn't have an auto-driver option). This means that the door to the car has to be opened. But, for the car to fit through the garage door, the car door has to be closed at some point. But for that matter the garage door has to be open for the car to safely go through (again no magical drive thru door, sky lift, underground left system nor can the doorway be magically widened.)

    Anyways, from what was posted, content appears to be pushed to the browser, but the browser can not make sense of it and only provides a portion of the content that it does understand.

    Such "non-sense" won't necessarily cause a php error logged in the logs directory. It has to be discovered through other means. There are publicly available html validation tools that at least can identify what html is out-of-place and then the developer's tool kit can be used to hunt down the area of code in question.

    As to the two files, well, the class file is something applicable to all templates, so if the issue goes away when choosing one template over another, then it is not the base cause of the issue. As to the message that was given to the other template file? Well the base ZC install was giving the same message until some updates were pushed by other members of the community. So, I would say that is not necessarily the cause.

    I would suggest (again without specifically looking) taking a look at the differences of the includes/templates/winchester_new/common/tpl_main_page.php file with each of the template_default and responsive_classic versions. I wouldn't be surprised though if the template had been designed to specifically exclude that feature from the main page with focus being on the scroller and other flashy aspects.

    Oh, and I never addressed the category grouping numbering... the path (cPath) shows the sequence of categories taken to get to the current display. It is not like the numbering of the last item in that path changes to match how many categories are assigned within the parent category. Every category gets a unique number. Every category can be the child of another category. Ideally all categories lead to the main category having a category_id of 0. So the category that was the 10th to be created could be referenced by cPath=10 to show just that category and any child information off of it. If it was moved into the category that was the 15th to be created then the cPath would be cPath=15_10. When breadcrumbs are turned on and you are in a product of that category or looking at children categories you should see the name associated with category 15 before (above) the name of the currently discussed category.
    Thanks MC for the detailed explanation - I will work on the file comparisons you suggested in the various tpl_main_page.php files over the weekend. I do recall in one file I compared yesterday that there was a ?> missing at the end of it so I will go back over those files also ... but maybe it was a core file and not a template file, not sure.

    In the meantime what I have done is added two products and 'doctored' the category page description to include the information that under normal circumstances would render if all was working as it should - so now a page appears with info on it just so that the customer can follow the menu structure without getting an inert page.

    again many thanks,
    Mike

  8. #8
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Should sub-categories list on category page by default? - if not how to activate?

    The closing php tag is unnecessary in the file and actually can lead to other problems (content included after that closing tag is treated as html content and could cause a headers already sent issue if there is say a space or carriage return after that).

    Need to look at the html result(s) and then identify where within the php to correct the html problem(s).
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Jan 2020
    Location
    Scotland
    Posts
    1
    Plugin Contributions
    0

    Default Re: Should sub-categories list on category page by default? - if not how to activate?

    Quote Originally Posted by shags38 View Post
    v1.5.5f php7.1 harmonyballpendant.com

    Q1. are sub categories supposed to be listed on the main category page by default? .... if so then I have an issue ... if not then please see Q2.

    A category page with sub-categories is not listing the sub categories, i.e. page title shows and nothing else, not even the category description. If I add two products to that category using 'copy to' of products from another category then the category description shows up. Category number is 49, sub-categories are then numbered 49_50, 49_51 etc etc thru to 49_61 .... not sure if they should be 49_1, 49_2 etc so hence not sure if they were set up properly originally 3 versions ago? I understand that a main category is not designed to have products in it but I assume it should list the sub-categories, right? (Sub-categories do show in menu side box once main category is clicked - switching that on/off works fine)

    Q2. How do I get the sub-categories to show on the category page? I cannot find anything in admin/configuration/layout settings to switch sub-categories on or off (except for in menu) nor anything in FAQ's nor a specific topic in forums.

    cheers,
    Mike
    I appreciate this is a late addition to this discussion, but we recently ran into this same problem. We believed sub-categories were indeed showing correctly fairly recent;y, and could not think of any specific change. Eventually we realised we had changed the php version to improve a different issue on another part of the site. So the issue, in our case, turned out to be the choice of php7.3. Our hosting provider easily enabled us to revert to v5.6, which resolved the issue.

    I have not yet tested this on php7.1, as the OP had chosen, but as 5.6 remains acceptable, we will probably stick with this. Hope this helps.

 

 

Similar Threads

  1. How can I hide sub sub categories of a category in left sidebox?
    By X-Bumble in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 15 Feb 2012, 07:11 PM
  2. how to make sub categories to show by default?
    By raulmalik in forum Basic Configuration
    Replies: 4
    Last Post: 8 Apr 2011, 04:46 AM
  3. Show sub-sub categories underneath sub-categories on the category page?
    By tomrice in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 18 Jun 2009, 03:05 AM
  4. Skip Page showing sub categories, go straight to first sub category
    By HelenSama in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 8 May 2009, 05:16 PM
  5. Replies: 3
    Last Post: 11 Sep 2008, 09:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR