Show all pictures of product, not only images associated with combination
Hello,
I am not sure what's the prestashop version you use, but from your description i see that it is probaly prestashop 1.7.x. So my answer will be based on this PrestaShop version.
(i think so because in ps 1.7 when you will access to product page that has combinations, product page will show pictures that are associated with viewed combination only)
The product has 4 images, one for each of the 2 combinations and 2 general images. I would like all 4 images to show for the product (as thumbnails) and for one of the two general images to be used as the main (cover) image
In PrestaShop you can mark one from the images as a cover of product: https://i.imgur.com/oMj7n4r.png - So, this picture will appear as a cover of the product. Do it, selected picture will appear as a product cover photo.
Then it will be required to modify PrestaShop's core code. Please open file: src/adapter/image/ImageRetrievier.php
there is a code: (somewhere near ~50 line)
public function getProductImages(array $product, Language $language){$productAttributeId = $product['id_product_attribute'];$productInstance = new Product($product['id_product'],false,$language->id);
alter it to:
public function getProductImages(array $product, Language $language){$productAttributeId = 0;$productInstance = new Product($product['id_product'],false,$language->id);
Thanks to this change product page will show all product pictures, not only pictures associated with viewed combination
hope that this is what you are looking for ;)
The table of combinations should use the image relevant to each combination. Is there any way to do this?
'combinations table' module near each combination shows cover image of according combination. So in context of the module - there is nothing to 'fix' or 'improve' because it behaves like you described by default :)
Hello Vekia,
ReplyDeleteThis method does not work very well. It can actually display all the pictures, but the change of picture when choosing a variant does not work after that. How to make both work together?
Best regards,
assign default combination and the select image/images u want to show then save it.
ReplyDeleteThis modification ALWAYS DISPLAYS ALL PICTURES, even if you will select combination
ReplyDeleteHi Vekia.
ReplyDeleteThere is no way to show all the images (like the code does) but also change the image to the one of the combination checked?
Even with a module, but I need to solve this!
Hi, u have tuto for 1.7.8 ?:D
ReplyDelete