Jump to content

how to change category product list sql


Recommended Posts

controllers/front/categoryController.php is function assignProductList(),your say "get products from database" is here?

the function have code

        if (!$hookExecuted)
        {
            $this->context->smarty->assign('categoryNameComplement', '');//the program is not execution here
            $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($this->context->language->id, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay);
        }
        // Hook executed, use the override
        else
            // Pagination must be call after "getProducts"
            $this->pagination($this->nbProducts);
 

Link to comment
Share on other sites

  • 4 months later...

categoryController.php

 

         $hookExecuted = false;
    /*    Hook::exec('actionProductListOverride', array(
            'nbProducts' => &$this->nbProducts,
            'catProducts' => &$this->cat_products,
            'hookExecuted' => &$hookExecuted,
        ));*/
       //after comment out this , override  category work!

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

              //the program now  execution here

Edited by aliabc (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...