Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I changed a product image, uploaded a smaller jpeg file, changed to semantic name and added alt text, and now the product image will not render and for some reason seems to have display: hidden css added to the tag.
See the missing image space, on this product url; https://forhm.com/products/placemat-set-2-butterfly-characters?variant=42089028878575
Can someone please advise what's going on here?
Here's the html <li> element attributes as shown by Chrome inspector:
<li data-thumbnail-set-number="Green..." class="product__media-item grid__item slider__slide" data-media-id="template--15372759597295__main-33012002521327" data-media-index="7" style="display:none">
Solved! Go to the solution
This is an accepted solution.
The problem here was due to my theme having been updated years ago with code to enable the product variant selection buttons to show only certain images with alt tag values that correspond to the product variant featured image's tag value. I'd changed the tag value of a newly uploaded image without realising that there was logic built into the JS which required a certain alt text value in order to render the image.
What do you mean by images whose html tag contains the tag style="display: none".
In my opinion, it is because of your setup that images corresponding to each variant of your product appear
If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here ☕.
B2B Solution & Custom Pricing | Product Labels by BSS
Need help from our expert? Kindly share your request with us via community@bsscommerce.com
Thanks for the reply and help BSS-Commerce. I found the problem and detailed it in my other reply to this post.
This is an accepted solution.
The problem here was due to my theme having been updated years ago with code to enable the product variant selection buttons to show only certain images with alt tag values that correspond to the product variant featured image's tag value. I'd changed the tag value of a newly uploaded image without realising that there was logic built into the JS which required a certain alt text value in order to render the image.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024