Variant image get a error in show page.
CharlyJazz opened this issue · comments
Carlos Azuaje commented
I fixed this bug with this code
<% if variant.images.length != 0 %>
<%= small_image(variant.product) %>
<% end %>
We should talk about it.
Carlos Azuaje commented
Other solution:
<%= product_image(variant.product, itemprop: "image") %>
Or more small:
<%= small_image(variant.product, itemprop: "image") %>
Mateo Laiño commented
Hello.
I have this issue too.
I think it could be a better solution:
<%= image_tag main_app.url_for(variant.images.first.url(:small)) %>
retrieving the first stored image for this variant.
(Not the master image and without resizing the image again throught product_image or small_image methods).
MateoLa.