Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.4.5.1
    • Fix Version/s: 1.4.5.1
    • Security Level: All-users
    • Labels:
      None

      Description

      There are no subcategories in categories frontend (/category.php?id_category=***)

      (there are no products in this category)

      after replacing the line 125 in categorycontroller.php
      /* $subCategories = $this->category->getSubCategories((int)(self::$cookie->id_lang)); */
      $subCategories = $this->category->getSubCategories(intval($cookie->id_lang));

      they appeared.
      But without titles(names):

      <li><a title="" href="http://****/category.php?id_category=28">
      <img alt="" src="/img/c/28-medium.jpg">
      </a>
      <a href="http://hmstudio.com.ua/category.php?id_category=28"> </a>
      </li>

      1. Capture.png
        298 kB
      2. CropImage-1.png
        50 kB
      3. CropImage-2.png
        371 kB
      4. CropImage-3.png
        305 kB

        Activity

        Hide
        Guillaume BRUNIER added a comment - - edited

        Hi,

        I didn't succeed to reproduce this bug.
        Maybe I have done something wrong:

        I created new category (NewCat)
        I created a subcategory (Subcat1)
        I created another subcategory (Subcat2)

        There are no product in Newcat nor Subcat1 and Subcat2

        In my FrontOffice the categories are display properly (See pictures attach)

        Regards,

        Show
        Guillaume BRUNIER added a comment - - edited Hi, I didn't succeed to reproduce this bug. Maybe I have done something wrong: I created new category (NewCat) I created a subcategory (Subcat1) I created another subcategory (Subcat2) There are no product in Newcat nor Subcat1 and Subcat2 In my FrontOffice the categories are display properly (See pictures attach) Regards,
        Hide
        ben807 ben807 added a comment -

        database was updated from 1.1 (successful)
        russian language is used as dafault in shop
        categories.tpl from prestashop theme without changes

        Show
        ben807 ben807 added a comment - database was updated from 1.1 (successful) russian language is used as dafault in shop categories.tpl from prestashop theme without changes
        Hide
        ben807 ben807 added a comment -

        no subcategories

        Show
        ben807 ben807 added a comment - no subcategories
        Hide
        ben807 ben807 added a comment -

        there you can see new thust created sucategories are not displayed.
        but there are in layered navigation block

        Show
        ben807 ben807 added a comment - there you can see new thust created sucategories are not displayed. but there are in layered navigation block
        Hide
        Guillaume BRUNIER added a comment - - edited

        Hi,

        I don't know where could be the problem, I didn't succeed to reproduce it.
        Is it possible to have your ftp and backoffice access via private message? (guillaume.brunier@prestashop.com).
        I'll try to understand what is wrong in your website.

        Regards,

        Show
        Guillaume BRUNIER added a comment - - edited Hi, I don't know where could be the problem, I didn't succeed to reproduce it. Is it possible to have your ftp and backoffice access via private message? (guillaume.brunier@prestashop.com). I'll try to understand what is wrong in your website. Regards,
        Hide
        Guillaume BRUNIER added a comment - - edited

        Hi,

        Thank you for your mail, I will see your problem soon.
        Actually, I have many works because of the next release.

        Regards,

        Show
        Guillaume BRUNIER added a comment - - edited Hi, Thank you for your mail, I will see your problem soon. Actually, I have many works because of the next release. Regards,
        Hide
        Guillaume BRUNIER added a comment - - edited

        Hi,

        Sorry for the waiting

        This bug don't come from the lang cookies.
        The categories are correctly found but not assigned to Smarty:

        Strangely, the following condition is not passed in the CategoryController.php (controllers/CategoryController.php)

        if (Db::getInstance()->numRows())
        {
        self::$smarty->assign('subcategories', $subCategories);self::$smarty->assign(array(
        'subcategories_nb_total' => sizeof($subCategories),
        'subcategories_nb_half' => ceil(sizeof($subCategories) / 2)));
        }
        

        But if you disable the caching system (Backoffice->Preference->Performance->Caching), the subcategories are display.

        So something is wrong in the caching system, I'm trying to find the solution.

        For the moment, the solutions you have:

        • You can disable the caching system
        • Or you can change the condition
          if (Db::getInstance()->numRows())

          By

          if ($subCategories AND isset($subCategories) AND !empty($subCategories))

        I have added this line in your file. You just have to comment the old and decomment the new

        Regards,

        Show
        Guillaume BRUNIER added a comment - - edited Hi, Sorry for the waiting This bug don't come from the lang cookies. The categories are correctly found but not assigned to Smarty: Strangely, the following condition is not passed in the CategoryController.php (controllers/CategoryController.php) if (Db::getInstance()->numRows()) { self::$smarty->assign('subcategories', $subCategories);self::$smarty->assign(array( 'subcategories_nb_total' => sizeof($subCategories), 'subcategories_nb_half' => ceil(sizeof($subCategories) / 2))); } But if you disable the caching system (Backoffice->Preference->Performance->Caching), the subcategories are display. So something is wrong in the caching system, I'm trying to find the solution. For the moment, the solutions you have: You can disable the caching system Or you can change the condition if (Db::getInstance()->numRows()) By if ($subCategories AND isset($subCategories) AND !empty($subCategories)) I have added this line in your file. You just have to comment the old and decomment the new Regards,
        Hide
        Guillaume BRUNIER added a comment -

        Hi,

        This bug has been fixed on SVN version. I changed the condition by

        if ($subCategories AND isset($subCategories) AND !empty($subCategories))

        Regards,

        Show
        Guillaume BRUNIER added a comment - Hi, This bug has been fixed on SVN version. I changed the condition by if ($subCategories AND isset($subCategories) AND !empty($subCategories)) Regards,
        Hide
        Tommy added a comment -

        I think that my site is doing the same thing as this bug. No SUB categories are displaying in the front end. I am using version 1.4.6.2. I tried and change the controllerCategory.php file but it did nothing, my cashe is disabled and force comply is on. Not sure if this is the same issue but it's is the only topic i found about this issue. When you click on my category you should be able to see all sub category i have but all i see is a blank page the only thing that displays in the category is the categoy img but not for sub categories. please can anyone help with this??

        Show
        Tommy added a comment - I think that my site is doing the same thing as this bug. No SUB categories are displaying in the front end. I am using version 1.4.6.2. I tried and change the controllerCategory.php file but it did nothing, my cashe is disabled and force comply is on. Not sure if this is the same issue but it's is the only topic i found about this issue. When you click on my category you should be able to see all sub category i have but all i see is a blank page the only thing that displays in the category is the categoy img but not for sub categories. please can anyone help with this??

          People

          • Assignee:
            Guillaume BRUNIER
            Reporter:
            ben807 ben807
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: