Getting started with Spree/Products/Index

From the Directed Edge Developer Base
Revision as of 09:18, 28 November 2010 by Scott (talk | contribs) (Created page with "<source lang="html4strict"> <% unless edgy_recommended.empty? %> <h3 class="list-type"><%= edgy_message %></h3> <ul class="product-listing"> <% edgy_recommended.each do |...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
<% unless edgy_recommended.empty? %>
  <h3 class="list-type"><%= edgy_message %></h3>
  <ul class="product-listing">
    <% edgy_recommended.each do |product| %>
      <li id="product_<%= product.id %>">
        <%= link_to small_image(product), product %>
        <%= link_to raw(product.name + " <span class='price selling'>#{product_price(product)}</span>"), product, :class => 'info' %>
      </li>
    <% end %>
  </ul>
  <h3 class="list-type">Our catalog:</h3>
<% end %>
<% content_for :sidebar do %>
  <% hook :homepage_sidebar_navigation do %>
    <% if "products" == @current_controller && @taxon %>
      <%= render "shared/filters" %>
    <% else %>
      <%= render "shared/taxonomies" %>
    <% end %>
  <% end %>
<% end %>
<% if params[:keywords] %>
  <% hook :search_results do %>
    <% if @products.empty? %>
      <%= t(:no_products_found) %>
    <% else %>
      <%= render "shared/products", :products => @products, :taxon => @taxon %>
    <% end %>
  <% end %>
<% else %>
  <% hook :homepage_products do %>
    <%= render "shared/products", :products => @products, :taxon => @taxon %>
  <% end %>
<% end %>