<commit_before><%
  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? %>
<div id="products" class="row" data-hook>
  <% products.each do |product| %>
    <% url = product_url(product, :taxon_id => @taxon.try(:id)) %>
    <div id="product_<%= product.id %>" class="col-md-3 col-sm-6 product-list-item" data-hook="products_list_item" itemscope itemtype="http://schema.org/Product">
      <div class="panel panel-default">
        <% cache(@taxon.present? ? [I18n.locale, current_currency, @taxon, product] : [I18n.locale, current_currency, product]) do %>
          <div class="panel-body text-center product-body">
            <%= link_to small_image(product, :itemprop => "image"), product, :itemprop => 'url' %><br/>
            <%= link_to truncate(product.name, :length => 50), product, :class => 'info', :itemprop => "name", :title => product.name %>
          </div>
          <div class="panel-footer text-center">
            <span class="price selling lead" itemprop="price"><%= display_price(product) %></span>
          </div>
        <% end %>
      </div>
    </div>
  <% end %>
  <% reset_cycle("classes") %>
</div>
<% end %>

<% if paginated_products.respond_to?(:num_pages) %>
  <%= paginate paginated_products, theme: 'twitter-bootstrap-3' %>
<% end %><commit_msg>Fix products linking to the wrong URLs.<commit_after><%
  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? %>
<div id="products" class="row" data-hook>
  <% products.each do |product| %>
    <% url = product_url(product, :taxon_id => @taxon.try(:id)) %>
    <div id="product_<%= product.id %>" class="col-md-3 col-sm-6 product-list-item" data-hook="products_list_item" itemscope itemtype="http://schema.org/Product">
      <div class="panel panel-default">
        <% cache(@taxon.present? ? [I18n.locale, current_currency, @taxon, product] : [I18n.locale, current_currency, product]) do %>
          <div class="panel-body text-center product-body">
            <%= link_to small_image(product, :itemprop => "image"), url, :itemprop => 'url' %><br/>
            <%= link_to truncate(product.name, :length => 50), url, :class => 'info', :itemprop => "name", :title => product.name %>
          </div>
          <div class="panel-footer text-center">
            <span class="price selling lead" itemprop="price"><%= display_price(product) %></span>
          </div>
        <% end %>
      </div>
    </div>
  <% end %>
  <% reset_cycle("classes") %>
</div>
<% end %>

<% if paginated_products.respond_to?(:num_pages) %>
  <%= paginate paginated_products, theme: 'twitter-bootstrap-3' %>
<% end %>
{'fraction_non_alphanumeric': 0.18841679312089024, 'fraction_numerical': 0.00556398583712696, 'mean_word_length': 3.846813725490196, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4879716', 'n_tokens_mistral': 1406, 'n_tokens_neox': 1300, 'n_words': 246}