Sha256: 7a9e9ce1e1c5ba8fe75deada7f8acee62162c161907564ffb26705302020fd48

Contents?: true

Size: 1.36 KB

Versions: 1

Compression:

Stored size: 1.36 KB

Contents

<%
  base_class = "product-card".freeze

  # Classes
  class_names = [base_class]
  class_names = class_names.join(" ")

  url = spree.product_path(product, taxon_id: @taxon.try(:id))
  cached = @taxon.present? ?
    [I18n.locale, current_pricing_options, @taxon, product] :
    [I18n.locale, current_pricing_options, product]
  product_id = "product_#{product.id}"
%>

<% cache cached do %>
  <li class=<%= class_names %> itemscope itemtype="http://schema.org/Product" id=<%= product_id %>>
    <article>
      <section class="product-card_image">
        <%= link_to render('spree/shared/image', image: product.gallery.images.first, size: :small, itemprop: "image"), url, itemprop: 'url' %>
      </section>
      <header class="product-card_header">
        <h2>
          <%= link_to truncate(product.name, length: 50), url, class: 'info', itemprop: "name", title: product.name %>
        </h2>
      </header>
      <section class="product-card_price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
        <% if price = product.price_for(current_pricing_options) %>
          <span class="price selling" itemprop="price" content="<%= price.to_d %>">
            <%= price.to_html %>
          </span>
        <% end %>
        <span itemprop="priceCurrency" content="<%= current_pricing_options.currency %>"></span>
      </section>
    </article>
  </li>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_starter_frontend-0.1.0 app/views/spree/components/products/_product-card.html.erb