rigids Posted January 4, 2012 Share Posted January 4, 2012 I am getting trouble while fetching all images for a product on the category page. For eg :- i have a product named "abc". There are 3 images for this product. one is cover image and two other images. I want to display all the three images on the category page, currently it only displays the cover image. Link to comment Share on other sites More sharing options...
Medea Web Agency Posted March 5, 2012 Share Posted March 5, 2012 I've the same question, anyone knows how to fix? Link to comment Share on other sites More sharing options...
karthiiiiiiiiiik Posted October 25, 2013 Share Posted October 25, 2013 hi, I am also searching for same thing has any one has got the solution.... ? Link to comment Share on other sites More sharing options...
vekia Posted October 25, 2013 Share Posted October 25, 2013 in this case it's necessary to modify controller (categoryController) you need to add there function with sql query to database to get product images, for example: public static function getImagesByProductID($id) { return Db::getInstance()->ExecuteS('SELECT `id_image` FROM `'._DB_PREFIX_.'image` WHERE `id_product` = '.(int)($id_product)); } then in .tpl file you can use foreach loop on function Category::getImagesByProductID(Tools::getValue('id_product')) Link to comment Share on other sites More sharing options...
karthiiiiiiiiiik Posted October 28, 2013 Share Posted October 28, 2013 hi vekia, i have added the code to categorycontroller, but in tpl file how can i show up the images using the function you have said ? 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