Jump to content

[Solved] Why Home Category category.php?id_category=1 (There are no products.)?


Recommended Posts

I already solved my problem by... Thanks...
At Line 54 of category.php

        if ($category->id != 1)
       {
           $nbProducts = $category->getProducts(NULL, NULL, NULL, $orderBy, $orderWay, true);
           include(dirname(__FILE__).'/pagination.php');
           $smarty->assign('nb_products', $nbProducts);
           $cat_products = $category->getProducts(intval($cookie->id_lang), intval($p), intval($n), $orderBy, $orderWay);
       }



add this code after...

    else{
           $nbProducts = $category->getProducts(NULL, NULL, NULL, $orderBy, $orderWay, true);
           include(dirname(__FILE__).'/pagination.php');
           $smarty->assign('nb_products', $nbProducts);
           $cat_products = $category->getProducts(intval($cookie->id_lang), intval($p), intval($n), $orderBy, $orderWay);
       }

Link to comment
Share on other sites

  • 1 year later...

In version 1.4.5.1

 

edit:

if ($this->category->id != 1)

to:

//if ($this->category->id != 1)

 

and change:

 


if(!$hookExecuted) // The hook was not executed, standard working
{

self::$smarty->assign('categoryNameComplement', '');
$this->nbProducts = $this->category->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true);
$this->pagination((int)$this->nbProducts); // Pagination must be call after "getProducts"
$this->cat_products = $this->category->getProducts((int)(self::$cookie->id_lang), (int)($this->p), (int)($this->n), $this->orderBy, $this->orderWay);
}

else // Hook executed, use the override

 

to:

/* if(!$hookExecuted) // The hook was not executed, standard working
 {*/
  self::$smarty->assign('categoryNameComplement', '');
  $this->nbProducts = $this->category->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true);
  $this->pagination((int)$this->nbProducts); // Pagination must be call after "getProducts"
  $this->cat_products = $this->category->getProducts((int)(self::$cookie->id_lang), (int)($this->p), (int)($this->n), $this->orderBy, $this->orderWay);
 /*}
 else // Hook executed, use the override*/

Link to comment
Share on other sites

  • 4 weeks later...

(((((

if(!$hookExecuted) // The hook was not executed, standard working

{

 

self::$smarty->assign('categoryNameComplement', '');

$this->nbProducts = $this->category->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true);

$this->pagination((int)$this->nbProducts); // Pagination must be call after "getProducts"

$this->cat_products = $this->category->getProducts((int)(self::$cookie->id_lang), (int)($this->p), (int)($this->n), $this->orderBy, $this->orderWay);

}

 

else // Hook executed, use the override

))))

 

 

--------------------------

Hi-Im not fond this code

im same problem

My presta 1.4.4.1

-------

Please Help me :wacko:

Link to comment
Share on other sites

  • 7 months later...
×
×
  • Create New...