% if product.images.size > 1 %>
<% product.images.each do |i| %>
- <%= link_to(image_tag(i.attachment.url(:mini)), i.attachment.url(:product)) %>
<% end %>
<% end %>
<% if @product.has_variants?
has_checked = false %>
<%= t('images_for') %>:
<%= @selected_variant.options_text %>
<% @variants.each do |v|
checked = !has_checked && (v.available?)
has_checked = true if checked
if checked
v.images.each do |i| %>
- <%= link_to(image_tag(i.attachment.url(:mini)), i.attachment.url(:product)) %>
<% end %>
<% end %>
<% end %>
<% end %>
<% content_for :head do %>
<% end %>