spree_wishlist icon indicating copy to clipboard operation
spree_wishlist copied to clipboard

Variant image get a error in show page.

Open CharlyJazz opened this issue 5 years ago • 2 comments

https://github.com/spree-contrib/spree_wishlist/blob/7fddd1d41b2e6149858bbf4474983aa435a28935/app/views/spree/wishlists/show.html.erb#L54

Screenshot from 2019-05-07 17-58-01

I fixed this bug with this code

<% if variant.images.length != 0 %>
  <%= small_image(variant.product) %>
<% end %>

We should talk about it.

CharlyJazz avatar May 07 '19 20:05 CharlyJazz

Other solution:

<%= product_image(variant.product, itemprop: "image") %>

Or more small:

<%= small_image(variant.product, itemprop: "image") %>

CharlyJazz avatar May 07 '19 21:05 CharlyJazz

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.

MateoLa avatar Jul 29 '19 21:07 MateoLa