Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2010
    Location
    Austria
    Posts
    112
    Plugin Contributions
    0

    Default includes/modules/pages/index/header.php causes empty homepage

    The site I'm working on uses quite an old theme (all business). After upgrading to Zen Cart 1.5.7b, the homepage is empty; whereas previously it would display the categories in a grid.

    I've tracked the error down to changes in the file /includes/modules/pages/index/header_php.php (sorry about typo in name of this thread)

    My question: how can I over-ride this file? Or if that's not the right approach, how can I display a grid of categories on the homepage? With the old file v1.5.6 it worked fine.

    The commit that seems to cause the blank page is https://github.com/zencart/zencart/c...d185756fe99be6

    Many thanks, Edith
    Last edited by terraGirl; 27 Nov 2020 at 05:06 PM. Reason: wrong filename

  2. #2
    Join Date
    Jan 2004
    Posts
    66,011
    Blog Entries
    7
    Plugin Contributions
    261

    Default Re: includes/modules/pages/index/header.php causes empty homepage

    That particular page is certainly quite different from prior versions.

    No you can't "override" that file. Better to identify what's different about it and re-apply those differences to the new version in whatever way is appropriate for the new version.
    You can add more header_php_xyz.php files if you want to do more things. This is rarely the best option though.

    Chances are the "empty" (most likely "partial blank page") is the result of a PHP error being triggered ... and those log details will be recorded as new files at /logs/myDebug-xxxxxxxx.log ... and using the actual error details will help you sort out what needs fixing, or you can post the details here for further help.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2010
    Location
    Austria
    Posts
    112
    Plugin Contributions
    0

    Default Re: includes/modules/pages/index/header.php causes empty homepage

    Thank you! Yes, it's not a blank page, no Fatal PHP error. Just the category grid is missing. Logs are not recording anything unfortunately.

    Thank you for confirming that over-ride of header_php.php is not possible. I will give this another go on Monday & post an update.

    Regards, Edith

  4. #4
    Join Date
    Jan 2004
    Posts
    66,011
    Blog Entries
    7
    Plugin Contributions
    261

    Default Re: includes/modules/pages/index/header.php causes empty homepage

    Doing a quick cursory review I discovered that All Business appears to have the "column-grid-layout" mod integrated for its product listing. It could be that that's clashing with other things. Fortunately the responsive_classic in v157b has already integrated the column-layout features, so you might consider using the /includes/modules/responsive_classic/product_listing.php and /includes/templates/responsive_classic/templates/tpl_modules_product_listing.php files as a base for a replacement.

    The All Business template also won't work on PHP 7.2+ due to old syntax used in its files.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2010
    Location
    Austria
    Posts
    112
    Plugin Contributions
    0

    Default Re: includes/modules/pages/index/header.php causes empty homepage

    Yes, the "all business" is pretty old. I did update it so it runs fine on PHP 7.3, but I appreciate it's on borrowed time.

    I've traced the issue back to the "status" check. On the homepage, the category ID = 0; which isn't in the database and hasn't got a status. So the status check fails; and defaults to $current_category_not_found.

    My fix is to change header_php.php on line 33 from:

    PHP Code:
        if ($category_status->EOF ) {
            
    $current_category_not_found true;
        } 
    to

    PHP Code:
        if ($category_status->EOF && $current_category_id !== ) {
            
    $current_category_not_found true;
        } 
    Hope this helps others who want to show a category grid on the homepage.

 

 

Similar Threads

  1. v151 override \includes\modules\pages\shopping_cart\header.php.php??
    By tlyczko in forum General Questions
    Replies: 7
    Last Post: 27 Nov 2012, 06:12 PM
  2. Replies: 3
    Last Post: 15 Oct 2012, 02:03 PM
  3. Replies: 1
    Last Post: 9 Aug 2012, 04:42 PM
  4. how to override includes > modules > pages > page_folder > header_php.php
    By monkeytown in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 1 Feb 2008, 05:45 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