Sha256: 6779ede5b9c1a0cb4031ff3a761a9d8d9d61d8b3e117a63bc2add16d6958326a

Contents?: true

Size: 1.51 KB

Versions: 2

Compression:

Stored size: 1.51 KB

Contents

<%
  paginated_products = @searcher.products if params.key?(:keywords)
  paginated_products ||= products
%>
<% if products.empty? %>
  <%= t(:no_products_found) %>
<% elsif params.key?(:keywords) %>
  <h3><%= t(:search_results, :keywords => h(params[:keywords])) %></h3>
<% end %>

<% if products.any? %>
  <div class="vendor-products">
    <% c = 1 %> 
    <% p = products.count %>
    <% products.each do |product| %>
      <% if c == 1 %>
        <ul>
      <% elsif (c-1)% 4 == 0 %>
        </ul><ul>
      <% end %>
      
      <% if Spree::Config[:show_zero_stock_products] || product.has_stock? %>
        <li id="product_<%= product.id %>">
          <%= hook :products_list_item, {:product => product} do %>
            <%= link_to small_image(product), product_path(product) %>
            <%= link_to raw(product.name + "<span class='vendor'>#{product.supplier.title}</span> <span class='price selling'>#{product_price(product)}</span>"), product_path(product), :class => 'info' %>
          <% end %>
        </li>
      <% end %>
      <% if c == p %>
        </ul><!-- END OF ITERATION -->
      <% end %>
      <% c += 1 %>
    <% end %>
  </div><!-- END div.vendor-products -->
<% end %>
 
<hr class="space" />
 
<% if paginated_products.respond_to?(:total_pages)
      params.delete(:search)
      params.delete(:taxon)
      
%><%= will_paginate(paginated_products,
                    :previous_label => "&#171; #{t('previous')}",
                    :next_label => "#{t('next')} &#187;") %>
<% end %>
 
<hr class="space" />

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_suppliers-0.0.1 app/views/shared/_products_vendor.html.erb
spree_suppliers-0.60.3 app/views/shared/_products_vendor.html.erb