Sha256: 7d068c37ae5475cac1d268f16275c7541d3abf4d1fe90694358e35de232dd4f9

Contents?: true

Size: 1.86 KB

Versions: 4

Compression:

Stored size: 1.86 KB

Contents

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

<% content_for :head do %>
  <% if paginated_products.respond_to?(:num_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_currency, @taxon, product] : [I18n.locale, current_currency, product]) do %>
        <div class="product-image">
          <%= link_to small_image(product, :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?(:num_pages) %>
  <%= paginate paginated_products %>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spree_frontend-2.4.10 app/views/spree/shared/_products.html.erb
spree_frontend-2.4.9 app/views/spree/shared/_products.html.erb
spree_frontend-2.4.8 app/views/spree/shared/_products.html.erb
spree_frontend-2.4.7 app/views/spree/shared/_products.html.erb