Jon90 Posted November 6, 2010 Share Posted November 6, 2010 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 More sharing options...
Guest Posted November 13, 2010 Share Posted November 13, 2010 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 More sharing options...
Jon90 Posted November 16, 2010 Author Share Posted November 16, 2010 will try to duplicate the module to display products from different subcategories in the index, I will not modify the current module. Link to comment Share on other sites More sharing options...
uddhava Posted November 19, 2010 Share Posted November 19, 2010 You have to change the following : $category = new Category(2);to the subcategory ID that you want to display. So if your subcategory has an ID of 220, you need this :$category = new Category(220); Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now