Fusiondevs Posted December 29, 2011 Share Posted December 29, 2011 Hi, I built my own module that creates an array of all the products (so then i can loop on it with smarty) but i need each product to also include its attribute combinations. I cant find the function to get this. My actual code is the following... function hookHome($params) { global $smarty; $category = new Category(5, Configuration::get('PS_LANG_DEFAULT')); $products = $category->getProducts((int)($params['cookie']->id_lang), 1, 100); for ($i = 0; $i < count($products); $i++) { /* Here i need to save the attribute combination for each of the products in the array */ } //print_r($products); $smarty->assign(array( 'products' => $products )); return $this->display(__FILE__, 'template.tpl'); } I was checking on the Product class and i found the function getAttributeCombinaisons, but honestly i cant seem to understand how to use it. Any help will be greatly appreciated, Kind regards Bruno 1 Link to comment Share on other sites More sharing options...
Fusiondevs Posted December 29, 2011 Author Share Posted December 29, 2011 Ok i solved it.. I just added the following code into the for-loop. $this_product = new Product($products[$i]['id_product']); $products[$i]['combinations'] = $this_product->getAttributeCombinaisons($params['cookie']->id_lang); 2 Link to comment Share on other sites More sharing options...
Arkadia Posted August 22, 2012 Share Posted August 22, 2012 Thank you very much for sharing!! 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