If this is your first visit, check our documentation. To post, register or login.
Forums / Installing on a Linux/Unix Server / 157b, No categories on storefront main page

157b, No categories on storefront main page

Started by marton_1 on 23 Dec 2020, 3:42 PM · Views: 2,900

Results 1 to 7 of 7
23 Dec 2020, 3:42 PM
#1
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

157b, No categories on storefront main page

I have installed 157b, the responsive classic template on a subdomain of my web site here, (I know the page needs the look improving) https://catalogtest.simmar.ch/index.php?main_page=index&language=en

Server: Apache, PHP Version: 7.4.13 (Zend: 3.4.0)
Datenbank Patch Level: 1.5.7b
v1.5.7b [2020-12-04 14:32:28] (Version Update 1.5.6->1.5.7b)

MySQL Mode: NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION

The main page has a header, footer, side columns, greetings but no products.
There are no errors or warnings in logs.

MySQL Mode: NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION

I set config/Define Main Page Status: 1, config/Main Page - Opens with Category; 0

tpl_main_page.php is not customised.
tpl_index_fault.php is also not customosed.

<?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2) { ?>
<?php
/**
 * get the Define Main Page Text
 */
?>
<div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
<?php } ?>

<?php
  $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_MAIN);
  while (!$show_display_category->EOF) {
?>

If I put an actual category number in config/"Main Page - Opens with Category" then that category shows up on the main page.

Appreciate any comments?

23 Dec 2020, 4:37 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: 157b, No categories on storefront main page

First, thanks for the detailed post. You included lots of important information, which rules out a lot of actual "error" situations, leaving it to actually be a logic/configuration/expectation problem.

What were you wanting it to show? You probably don't want it to list all 647 products (I counted those from your products_all page) on the home page, right?

There are no actual products in category 0. Just subcategories. (And there should not be products in category 0 either; only subcategories)

What are your settings in Admin->Configuration->Index Listing set to?
I'm guessing they're all set to 0 instead of a sort-order between 1-4? Therefore there's no centerbox enabled to show different 'segments' of available products according to new/featured/special/etc.

So the next question is: What "view" would be most useful to your typical buyer?

.
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.

23 Dec 2020, 7:53 PM
#3
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: 157b, No categories on storefront main page

Thank you for your lightning fast reply and kind words, I spent a lot of time searching the forum for clues before posting.

Good question, I was expecting the page to look like my 155f page here,
https://www.simmar.ch/catalog/index.php?main_page=index&language=en

I have used the same configuration in 157b as in 155f including "index listing" all set to 0

155f main page shows the categories (not products :) ) that are in the "products-top" hierarchy, see the picture below.

Attachment 19346

23 Dec 2020, 8:44 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: 157b, No categories on storefront main page

Have you by any chance customized or are not using the original code for /includes/modules/pages/index/header_php.php or have additional header*.php files in that directory?

That needs to set the category depth to 'nested' in order to get tpl_index_categories.php to show all the subcategories.

.
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.

23 Dec 2020, 10:07 PM
#5
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: 157b, No categories on storefront main page

Header_php.php is the original, I copied it again from the 157b download to be sure. See the picture below.
Thanks for your patience

Attachment 19347

24 Dec 2020, 12:29 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: 157b, No categories on storefront main page

There might be a bug.

I wonder if adding the two lines as shown here is the right fix, in /includes/modules/pages/index/header_php.php

if (isset($cPath) && zen_not_null($cPath)) {
[B]    if ($cPath > 0) {[/B]
        $category_status_query =
            "SELECT categories_status
               FROM " . TABLE_CATEGORIES . "
              WHERE categories_id = :currentCategoryId
              LIMIT 1";
        $category_status_query = $db->bindVars($category_status_query, ':currentCategoryId', $current_category_id, 'integer');
        $category_status = $db->Execute($category_status_query);
        if ($category_status->EOF) {
            $current_category_not_found = true;
        } elseif ($category_status->fields['categories_status'] == '0') {
            $current_category_is_disabled = true;
        }
[B]    }[/B]
    $category_products_query =
        "SELECT products_id

.
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.

24 Dec 2020, 1:36 PM
#7
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: 157b, No categories on storefront main page

Hurrah! that worked fine, many many thanks.

You might want to correct the title of this thread to "No categories on..." instead of "products"?