Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jan 2014
    Posts
    62
    Plugin Contributions
    0

    Default Sub categories disappeared

    Hi everyone, I recently updated to 1.5.4 on existing database from 1.5.1 - all done very well a part for the sub categories, which I don't know why have disappeared.

    I explain. When opening a top category, with sub categories in it, the top category page used to show of course all the subcategories.

    Now, when opening a top category, it will show all the products of the subcategories and I have no wat to change it.

    Here is the website:

    http://www.londonsatman.co.uk/

    Sub are enabled from configuration, so don't know what else to look for.

    Customer Greeting - Show on Index Page 1 Info
    Categories - Always Show on Main Page 0 Info
    Main Page - Opens with Category 0 Info
    Categories - Always Open to Show SubCategories 1 Info

    many thanks for reading this.

    PS tried to switch back to standard template but result is the same

    walter
    Last edited by satello; 9 Oct 2015 at 10:18 AM.

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

    Default Re: Sub categories disappeared

    how about when disabling the uri rewriter? Same issue? The site map shows the subcategories existing as part of the main category, but thing is like you explained, click oon the main category and it drills down to all products rather than displaying a category main page with a display of the sub-categories. Somewhat seems to me, that if the database upgrade was performed onthe database that dsplayed this correctly, that unless a newly nstalled plugin modfied one of the settings thatim drawing a blank on at the moment though. Can't say I know of anythng that simply merges the items in the sub-categories. Anyways, thinking there might be a possble modification of ether the headers_php.php file, duplcate files inthe same drectory cancellng the expected results, or a template modificaton of the default template files, those are things that come to mind...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Sub categories disappeared

    Try switching to the classic template and see what is displayed
    If this corrects it - then you have narrowed it to something about your template
    Zen-Venom Get Bitten

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

    Default Re: Sub categories disappeared

    Quote Originally Posted by satello View Post
    Hi everyone, I recently updated to 1.5.4 on existing database from 1.5.1 - all done very well a part for the sub categories, which I don't know why have disappeared.

    I explain. When opening a top category, with sub categories in it, the top category page used to show of course all the subcategories.

    Now, when opening a top category, it will show all the products of the subcategories and I have no wat to change it.

    Here is the website:

    http://www.londonsatman.co.uk/

    Sub are enabled from configuration, so don't know what else to look for.

    Customer Greeting - Show on Index Page 1 Info
    Categories - Always Show on Main Page 0 Info
    Main Page - Opens with Category 0 Info
    Categories - Always Open to Show SubCategories 1 Info

    many thanks for reading this.

    PS tried to switch back to standard template but result is the same

    walter
    Quote Originally Posted by kobra View Post
    Try switching to the classic template and see what is displayed
    If this corrects it - then you have narrowed it to something about your template
    In OP that's already been tried with same result.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Jan 2014
    Posts
    62
    Plugin Contributions
    0

    Default Re: Sub categories disappeared

    I have not installed any extra plugin since the upgrade, everything seems to work absolutely fine, a part for this problem. As said, I have tried with standard template and still no subs.

    i have also tried right now to create a new test category, with other 2 subs. still on the main category it shows "no products in this category", which looks to me as if it is looking for products rather than the sub category. it is driving me MAD!!!

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

    Default Re: Sub categories disappeared

    So let's talk about the upgrade and the process followed... Please describe the process used with as much detail as possible. (Okay specific filenames of each and every file not required, but... )
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Jan 2014
    Posts
    62
    Plugin Contributions
    0

    Default Re: Sub categories disappeared

    Hi, Thought it was a template thing, so I posted on the Tableau template section, and had this reply which actually sorted my problem. Hope it can help others

    This is caused by a change in the includes\modules\pages\index\main_template_vars.php file
    To switch back to the old way first uncomment lines 64 THROUGH 123 and line 126.
    Code:

    /*$sql = "SELECT cd.categories_name, c.categories_image
    FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
    WHERE c.categories_id = :categoriesID
    AND cd.categories_id = :categoriesID
    AND cd.language_id = :languagesID
    AND c.categories_status= '1'";

    $sql = $db->bindVars($sql, ':categoriesID', $current_category_id, 'integer');
    $sql = $db->bindVars($sql, ':languagesID', $_SESSION['languages_id'], 'integer');
    $category = $db->Execute($sql);

    if (isset($cPath) && strpos($cPath, '_'))
    {
    // check to see if there are deeper categories within the current category
    $category_links = array_reverse($cPath_array);
    for($i=0, $n=sizeof($category_links); $i<$n; $i++)
    {
    $sql = "SELECT count(*) AS total
    FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
    WHERE c.parent_id = arentID
    AND c.categories_id = cd.categories_id
    AND cd.language_id = :languagesID
    AND c.categories_status= '1'";

    $sql = $db->bindVars($sql, 'arentID', $category_links[$i], 'integer');
    $sql = $db->bindVars($sql, ':languagesID', $_SESSION['languages_id'], 'integer');
    $categories = $db->Execute($sql);

    if ($categories->fields['total'] < 1)
    {
    // do nothing, go through the loop
    } else {
    $categories_query = "SELECT c.categories_id, cd.categories_name, c.categories_image, c.parent_id
    FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
    WHERE c.parent_id = arentID
    AND c.categories_id = cd.categories_id
    AND cd.language_id = :languagesID
    AND c.categories_status= '1'
    ORDER BY sort_order, cd.categories_name";

    $categories_query = $db->bindVars($categories_query, 'arentID', $category_links[$i], 'integer');
    $categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer');
    break; // we've found the deepest category the customer is in
    }
    }
    } else {
    $categories_query = "SELECT c.categories_id, cd.categories_name, c.categories_image, c.parent_id
    FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
    WHERE c.parent_id = arentID
    AND c.categories_id = cd.categories_id
    AND cd.language_id = :languagesID
    AND c.categories_status= '1'
    ORDER BY sort_order, cd.categories_name";

    $categories_query = $db->bindVars($categories_query, 'arentID', $current_category_id, 'integer');
    $categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer');
    }
    $categories = $db->Execute($categories_query);
    $number_of_categories = $categories->RecordCount();
    $new_products_category_id = $current_category_id;*/

    /////////////////////////////////////////////////////////////////////////////////////////////////////
    //$tpl_page_body = 'tpl_index_categories.php';
    /////////////////////////////////////////////////////////////////////////////////////////////////////

    Next comment out this section (129-196):
    Code:

    //BOF SHOW ALL PRODUCTS FOR PARENT CATEGORIES
    if (SHOW_PRODUCT_INFO_ALL_PRODUCTS == '1') {
    // set a category filter
    $new_products_category_id = $cPath;
    } else {
    // do not set the category
    }
    // create column list
    $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
    'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
    'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
    'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
    'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
    'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
    'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);

    /* ,
    'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
    */
    asort($define_list);
    reset($define_list);
    $column_list = array();
    foreach ($define_list as $key => $value)
    {
    if ($value > 0) $column_list[] = $key;
    }

    $select_column_list = '';

    for ($i=0, $n=sizeof($column_list); $i<$n; $i++)
    {
    switch ($column_list[$i])
    {
    case 'PRODUCT_LIST_MODEL':
    $select_column_list .= 'p.products_model, ';
    break;
    case 'PRODUCT_LIST_NAME':
    $select_column_list .= 'pd.products_name, ';
    break;
    case 'PRODUCT_LIST_MANUFACTURER':
    $select_column_list .= 'm.manufacturers_name, ';
    break;
    case 'PRODUCT_LIST_QUANTITY':
    $select_column_list .= 'p.products_quantity, ';
    break;
    case 'PRODUCT_LIST_IMAGE':
    $select_column_list .= 'p.products_image, ';
    break;
    case 'PRODUCT_LIST_WEIGHT':
    $select_column_list .= 'p.products_weight, ';
    break;
    }
    }
    // always add quantity regardless of whether or not it is in the listing for add to cart buttons
    if (PRODUCT_LIST_QUANTITY < 1) {
    $select_column_list .= 'p.products_quantity, ';
    }

    // set the product filters according to selected product type
    $typefilter = 'default';
    if (isset($_GET['typefilter'])) $typefilter = $_GET['typefilter'];
    require(zen_get_index_filters_directory($typefilter . '_filter.php'));

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////
    $tpl_page_body = 'tpl_index_product_list.php';
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////

    //EOF SHOW ALL PRODUCTS FOR PARENT CATEGORIES

    This will revert to sub-category photos showing when a parent category is selected.

  8. #8
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Sub categories disappeared

    PS tried to switch back to standard template but result is the same
    With what you found that fixed this you must not have things installed correctly as the classic template should use provided files that display correctly
    Zen-Venom Get Bitten

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

    Default Re: Sub categories disappeared

    Quote Originally Posted by kobra View Post
    With what you found that fixed this you must not have things installed correctly as the classic template should use provided files that display correctly
    Because the modification of this template affects: includes\modules\pages\index\main_template_vars.php
    And that files in the includes/modules/pages directory are at this time (base ZC files) not template overrideable, the code referenced above affects all templates on that system which is why when using the classic template there was no change...

    Ideally, this template would instead add an admin configurable switch so that the display could be modified without touching the code, or in this case discovering how to restore operation back to the standard method...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #10
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Sub categories disappeared

    Or perhaps as well as adding a configuration switch in the admin, a future release of the theme could also use a Zen Cart "observer" (and only trigger when the theme is selected) to make any necessary changes instead of modifying a core Zen Cart file. Just a thought.
    Last edited by lhungil; 13 Oct 2015 at 05:56 PM.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Sub-categories and their Sub-categories Styling
    By imperialmusic in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 3 Aug 2011, 05:03 AM
  2. Replies: 1
    Last Post: 12 Mar 2011, 07:18 AM
  3. Sub Categories under sub categories, can that be done?
    By pebblecrossing in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 9 Feb 2011, 09:46 PM
  4. 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
  5. 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

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