Home › Forums › WoodMart support forum › Product image changes format when clicking on variation
Product image changes format when clicking on variation
- This topic has 13 replies, 2 voices, and was last updated 5 months, 3 weeks ago by
Aizaz Imtiaz Awan.
-
AuthorPosts
-
September 2, 2024 at 1:29 pm #594468
joelmellinParticipantHi,
There is an issue with the format of the product pictures on the archive/shop page. The pictures changes its format when clicking on a variation swatch. It is only happening with those images that are not squared from the beginning. Se video:
https://www.awesomescreenshot.com/video/31091393?key=bb74545e47e328b1300e6a073764f941
September 3, 2024 at 9:03 am #594715
Aizaz Imtiaz AwanKeymasterHello,
You need to upload images of the same size.
Please check this manual and upload the same size of product images.
https://xtemos.com/docs-topic/image-size-and-content-alignment-in-a-product-grid/Best Regards
September 3, 2024 at 10:51 am #594778
joelmellinParticipantHi again,
I think you misunderstood the issue.
The thumbnails are in fact not uploaded as squares (we have hundreds of products and as you say in your own manual it is not always possible to upload them as squares), but since they are defined in the layouts as squares they should also be kept as squares when clicking on a swatch variable.
September 3, 2024 at 2:01 pm #594887
Aizaz Imtiaz AwanKeymasterHello,
Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.
Best Regards
September 3, 2024 at 2:22 pm #594894
joelmellinParticipantOk, they are shared now.
September 4, 2024 at 9:02 am #595049
Aizaz Imtiaz AwanKeymasterHello,
Now visit your site’s landing page and click on the “1 hg” attribute of the “Jordnötter rostade med salt” product and check the image.
Best Regards
September 4, 2024 at 9:37 am #595065
joelmellinParticipantIt works now for the 1 hg variation when clicking on that. But not for the other variations.
September 4, 2024 at 1:38 pm #595181
Aizaz Imtiaz AwanKeymasterHello,
I have uploaded the same size image for the “1 hg” variation. You need to upload images of the same size.
Best Regards
September 4, 2024 at 3:39 pm #595229
joelmellinParticipantIt seems like you still not unserstand. It works perfect before they are not clicked on as you can see. The the picture is a square. But when a variation swatch is clicked, then the image changes. It shouldn’t change. It must be a bug or setting in the theme. I ask you to fix this since as it says in your manual that it is noy always possible to upload a certain size.
September 5, 2024 at 2:06 pm #595466
Aizaz Imtiaz AwanKeymasterHello,
Ok, please share the correct/changed WP admin login details of your site. Your given login details are not working any more.
Best Regards.
September 5, 2024 at 3:58 pm #595528
joelmellinParticipantOk, have done so.
September 6, 2024 at 3:45 pm #595777
Aizaz Imtiaz AwanKeymasterHello,
First of all, we wanted to explain that the functionality of swatches on the product archive is the same as on the single product page, including variation images, because by default, WooCommerce variations are only available on the single product page. While the main product images in the product archive can be cropped using WooCommerce settings, WooCommerce does not have any options for cropping images from the single product page. As a result, when a variation is selected, it displays the image from the single product page, which cannot be cropped to match the aspect ratio of the images in the product archive due to WooCommerce’s lack of this functionality.
This issue can be resolved in two ways:
1. Use the same aspect ratio for images on both the single product page and the archive. In your case, all images should be uploaded with a square aspect ratio of 1:1.
2. Since you are using a simple aspect ratio, alternatively, you can use the following custom CSS code for the product archive, which will not physically crop the image but will make it appear square using CSS.
.wd-product .attachment-woocommerce_thumbnail img { aspect-ratio: 1; object-fit: cover; }
Best Regards.
September 6, 2024 at 6:32 pm #595817
joelmellinParticipantThank you. The css code works.
But wouldn’t it also be possible to just use a code that says that the already cropped picture on the archive page should not change when a variation is clicked on, but instead just remain as it is? Since we don’t have a picture for each variation, but always only use the picture for the parent product for all variations this should be possible right?
September 9, 2024 at 9:19 am #596058
Aizaz Imtiaz AwanKeymasterHello,
Unfortunately, it’s not possible to achieve this with simple custom code. To prevent the variation images from showing when a variation is selected, you would need either to not assign an image to each individual variation in the variation settings or leave the field empty (https://monosnap.com/file/pVutkyjdI3ogMH8qxEIOGwwL5QwZIw), or disable the display of variations on the product archive (https://monosnap.com/file/QaznbF7ASvhEHwk7tbRqqDDT9jpGxk).
Best Regards.
-
AuthorPosts
Tagged: product image format variation
- You must be logged in to create new topics. Login / Register