Jump to content

Show products in a subcategory


Recommended Posts

Hi, I want to modify the block homefeatured that is in the index to display products in a subcategory, not the entire category, is currently as follows:

   function hookHome($params)
   {
       global $smarty;

       $category = new Category(2);
       $nb = intval(Configuration::get('HOME_FEATURED_NBR'));
       $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10));
       $smarty->assign(array('products' => $products, 'homeSize' => Image::getSize('home')));

       return $this->display(__FILE__, 'homefeatured.tpl');
   }



How could I?, Any ideas?

A greeting and thanks in advance.

Link to comment
Share on other sites

You want to do this because why? So it doesn't display on the home page? it's a hook for the center section of prestashop you would have to put a link some place on your home page and find a way to display the homefeatured module when user clicks on link ya know?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...