Sha256: 2a4f49c66bcdbbe30d0ef51a893ff2c065cd908eee0a0ee7b8bdebfacffea884

Contents?: true

Size: 1.92 KB

Versions: 25

Compression:

Stored size: 1.92 KB

Contents

<%
  paginated_products = @searcher.retrieve_products if params.key?(:keywords)
  paginated_products ||= products
%>

<% content_for :head do %>
  <% if paginated_products.respond_to?(:total_pages) %>
    <%= rel_next_prev_link_tags paginated_products %>
  <% end %>
<% end %>

<div data-hook="products_search_results_heading">
  <% if products.empty? %>
    <div data-hook="products_search_results_heading_no_results_found">
      <%= Spree.t(:no_products_found) %>
    </div>
  <% elsif params.key?(:keywords) %>
    <div data-hook="products_search_results_heading_results_found">
      <h6 class="search-results-title"><%= Spree.t(:search_results, keywords: h(params[:keywords])) %></h6>
    </div>
  <% end %>
</div>

<% if products.any? %>
  <ul id="products" class="inline product-listing" data-hook>
    <% products.each do |product| %>
      <% url = spree.product_path(product, taxon_id: @taxon.try(:id)) %>
      <li id="product_<%= product.id %>" class="columns three <%= cycle("alpha", "secondary", "", "omega secondary", name: "classes") %>" data-hook="products_list_item" itemscope itemtype="http://schema.org/Product">
        <% cache(@taxon.present? ? [I18n.locale, current_pricing_options, @taxon, product] : [I18n.locale, current_pricing_options, product]) do %>
          <div class="product-image">
            <%= link_to image_tag(product.display_image.attachment(:small), itemprop: "image"), url, itemprop: 'url' %>
          </div>
          <%= link_to truncate(product.name, length: 50), url, class: 'info', itemprop: "name", title: product.name %>
          <span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
            <span class="price selling" itemprop="price"><%= display_price(product) %></span>
          </span>
        <% end %>
      </li>
    <% end %>
    <% reset_cycle("classes") %>
  </ul>
<% end %>

<% if paginated_products.respond_to?(:total_pages) %>
  <%= paginate paginated_products %>
<% end %>

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
solidus_frontend-2.2.2 app/views/spree/shared/_products.html.erb
solidus_frontend-2.1.1 app/views/spree/shared/_products.html.erb
solidus_frontend-2.0.3 app/views/spree/shared/_products.html.erb
solidus_frontend-1.4.2 app/views/spree/shared/_products.html.erb
solidus_frontend-1.3.2 app/views/spree/shared/_products.html.erb
solidus_frontend-2.0.2 app/views/spree/shared/_products.html.erb
solidus_frontend-1.4.1 app/views/spree/shared/_products.html.erb
solidus_frontend-2.2.1 app/views/spree/shared/_products.html.erb
solidus_frontend-2.2.0 app/views/spree/shared/_products.html.erb
solidus_frontend-2.2.0.rc1 app/views/spree/shared/_products.html.erb
solidus_frontend-2.2.0.beta1 app/views/spree/shared/_products.html.erb
solidus_frontend-2.1.0 app/views/spree/shared/_products.html.erb
solidus_frontend-2.1.0.rc1 app/views/spree/shared/_products.html.erb
solidus_frontend-2.0.1 app/views/spree/shared/_products.html.erb
solidus_frontend-2.1.0.beta1 app/views/spree/shared/_products.html.erb
solidus_frontend-2.0.0 app/views/spree/shared/_products.html.erb
solidus_frontend-1.4.0 app/views/spree/shared/_products.html.erb
solidus_frontend-2.0.0.rc1 app/views/spree/shared/_products.html.erb
solidus_frontend-1.4.0.rc1 app/views/spree/shared/_products.html.erb
solidus_frontend-2.0.0.beta1 app/views/spree/shared/_products.html.erb