spree_frontend 3.7.13 → 4.0.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/app/assets/javascripts/spree/frontend.js +4 -1
- data/app/assets/javascripts/spree/frontend/checkout/address.js +42 -14
- data/app/assets/javascripts/spree/frontend/checkout/address_book.js +56 -0
- data/app/assets/javascripts/spree/frontend/product.js +54 -39
- data/app/assets/stylesheets/spree/frontend.css +1 -0
- data/app/assets/stylesheets/spree/frontend/_variables.scss +1 -1
- data/app/assets/stylesheets/spree/frontend/address_book.scss +8 -0
- data/app/assets/stylesheets/spree/frontend/frontend_bootstrap.css.scss +13 -35
- data/app/controllers/concerns/spree/checkout/address_book.rb +53 -0
- data/app/controllers/spree/addresses_controller.rb +72 -0
- data/app/controllers/spree/checkout_controller.rb +2 -0
- data/app/controllers/spree/orders_controller.rb +0 -55
- data/app/controllers/spree/products_controller.rb +5 -1
- data/app/controllers/spree/store_controller.rb +1 -1
- data/app/helpers/spree/addresses_helper.rb +36 -0
- data/app/helpers/spree/frontend_helper.rb +16 -15
- data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_first_page.html.erb +2 -2
- data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_gap.html.erb +5 -1
- data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_last_page.html.erb +2 -2
- data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_next_page.html.erb +2 -2
- data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_page.html.erb +8 -2
- data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_paginator.html.erb +1 -1
- data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_prev_page.html.erb +2 -2
- data/app/views/spree/address/_form.html.erb +27 -24
- data/app/views/spree/addresses/_form.html.erb +18 -0
- data/app/views/spree/addresses/destroy.js.erb +2 -0
- data/app/views/spree/addresses/edit.html.erb +23 -0
- data/app/views/spree/addresses/new.html.erb +23 -0
- data/app/views/spree/checkout/_address.html.erb +61 -37
- data/app/views/spree/checkout/_confirm.html.erb +12 -10
- data/app/views/spree/checkout/_delivery.html.erb +27 -15
- data/app/views/spree/checkout/_payment.html.erb +14 -9
- data/app/views/spree/checkout/_summary.html.erb +59 -57
- data/app/views/spree/checkout/edit.html.erb +6 -6
- data/app/views/spree/checkout/payment/_gateway.html.erb +43 -35
- data/app/views/spree/layouts/spree_application.html.erb +5 -2
- data/app/views/spree/orders/_form.html.erb +38 -25
- data/app/views/spree/orders/edit.html.erb +28 -22
- data/app/views/spree/orders/show.html.erb +2 -1
- data/app/views/spree/products/_cart_form.html.erb +28 -26
- data/app/views/spree/products/_product.html.erb +7 -8
- data/app/views/spree/products/_promotions.html.erb +13 -11
- data/app/views/spree/products/_properties.html.erb +10 -3
- data/app/views/spree/products/_thumbnails.html.erb +5 -7
- data/app/views/spree/products/show.html.erb +8 -8
- data/app/views/spree/shared/_filters.html.erb +29 -9
- data/app/views/spree/shared/_header.html.erb +2 -2
- data/app/views/spree/shared/_login_bar.html.erb +9 -3
- data/app/views/spree/shared/_main_nav_bar.html.erb +15 -15
- data/app/views/spree/shared/_nav_bar.html.erb +2 -2
- data/app/views/spree/shared/_order_details.html.erb +143 -89
- data/app/views/spree/shared/_products.html.erb +2 -2
- data/app/views/spree/shared/_search.html.erb +19 -12
- data/app/views/spree/shared/_sidebar.html.erb +1 -1
- data/app/views/spree/shared/_taxonomies.html.erb +7 -3
- data/config/routes.rb +2 -0
- data/lib/spree/frontend.rb +3 -3
- data/lib/spree/frontend/engine.rb +4 -0
- data/spree_frontend.gemspec +4 -3
- metadata +48 -25
@@ -3,11 +3,11 @@
|
|
3
3
|
<div id="checkout" data-hook>
|
4
4
|
<%= render partial: 'spree/shared/error_messages', locals: { target: @order } %>
|
5
5
|
|
6
|
-
<div class="row" data-hook="checkout_header">
|
7
|
-
<div class="col-
|
8
|
-
<h1 data-hook="checkout_title"><%= Spree.t(:checkout) %></h1>
|
6
|
+
<div class="row align-items-center" data-hook="checkout_header">
|
7
|
+
<div class="col-md-3 mb-4">
|
8
|
+
<h1 class="mb-0" data-hook="checkout_title"><%= Spree.t(:checkout) %></h1>
|
9
9
|
</div>
|
10
|
-
<div class="col-
|
10
|
+
<div class="col-md-9 mb-4" data-hook="checkout_progress">
|
11
11
|
<%= checkout_progress %>
|
12
12
|
</div>
|
13
13
|
</div>
|
@@ -16,8 +16,8 @@
|
|
16
16
|
<div class="<%= if @order.state != 'confirm' then 'col-md-9' else 'col-md-12' end %>" data-hook="checkout_form_wrapper">
|
17
17
|
<%= form_for @order, url: update_checkout_path(@order.state), html: { id: "checkout_form_#{@order.state}" } do |form| %>
|
18
18
|
<% if @order.state == 'address' || !@order.email? %>
|
19
|
-
<div class="
|
20
|
-
<div class="
|
19
|
+
<div class="card card-default mb-4">
|
20
|
+
<div class="card-body">
|
21
21
|
<div class="form-group">
|
22
22
|
<%= form.label :email %>
|
23
23
|
<%= form.email_field :email, class: 'form-control', required: true %>
|
@@ -1,42 +1,50 @@
|
|
1
|
-
<div class="
|
2
|
-
|
3
|
-
|
1
|
+
<div class="card mt-4 w-100">
|
2
|
+
<div class="card-body">
|
3
|
+
<%= image_tag 'credit_cards/credit_card.gif',
|
4
|
+
id: 'credit-card-image',
|
5
|
+
width: '170',
|
6
|
+
height: '28',
|
7
|
+
class: 'position-absolute',
|
8
|
+
style: 'right: 1rem' %>
|
4
9
|
|
5
|
-
|
6
|
-
<%= label_tag "name_on_card_#{payment_method.id}" do %>
|
7
|
-
<%= Spree.t(:name_on_card) %><abbr class="required" title="required">*</abbr>
|
8
|
-
<% end %>
|
9
|
-
<%= text_field_tag "#{param_prefix}[name]", "#{@order.bill_address_firstname} #{@order.bill_address_lastname}", { id: "name_on_card_#{payment_method.id}", class: 'form-control required'} %>
|
10
|
-
</p>
|
10
|
+
<% param_prefix = "payment_source[#{payment_method.id}]" %>
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<% end %>
|
16
|
-
<% options_hash = Rails.env.production? ? {autocomplete: 'off'} : {} %>
|
17
|
-
<%= text_field_tag "#{param_prefix}[number]", '', options_hash.merge(id: 'card_number', class: 'form-control required cardNumber', size: 19, maxlength: 19, autocomplete: "off") %>
|
18
|
-
|
19
|
-
<span id="card_type" style="display:none;">
|
20
|
-
( <span id="looks_like" ><%= Spree.t(:card_type_is) %> <span id="type"></span></span>
|
21
|
-
<span id="unrecognized"><%= Spree.t(:unrecognized_card_type) %></span>
|
22
|
-
)
|
23
|
-
</span>
|
24
|
-
</p>
|
25
|
-
<div class="row">
|
26
|
-
<div class="col-md-8 field" data-hook="card_expiration">
|
27
|
-
<%= label_tag "card_expiry" do %>
|
28
|
-
<%= Spree.t(:expiration) %><abbr class="required" title="required">*</abbr>
|
12
|
+
<p class="field">
|
13
|
+
<%= label_tag "name_on_card_#{payment_method.id}" do %>
|
14
|
+
<%= Spree.t(:name_on_card) %><abbr class="required" title="required">*</abbr>
|
29
15
|
<% end %>
|
30
|
-
<%= text_field_tag "#{param_prefix}[
|
31
|
-
</
|
32
|
-
|
33
|
-
|
34
|
-
|
16
|
+
<%= text_field_tag "#{param_prefix}[name]", "#{@order.bill_address_firstname} #{@order.bill_address_lastname}", { id: "name_on_card_#{payment_method.id}", class: 'form-control required'} %>
|
17
|
+
</p>
|
18
|
+
|
19
|
+
<p class="field" data-hook="card_number">
|
20
|
+
<%= label_tag "card_number" do %>
|
21
|
+
<%= Spree.t(:card_number) %><abbr class="required" title="required">*</abbr>
|
35
22
|
<% end %>
|
36
|
-
|
37
|
-
<%=
|
23
|
+
<% options_hash = Rails.env.production? ? {autocomplete: 'off'} : {} %>
|
24
|
+
<%= text_field_tag "#{param_prefix}[number]", '', options_hash.merge(id: 'card_number', class: 'form-control required cardNumber', size: 19, maxlength: 19, autocomplete: "off") %>
|
25
|
+
|
26
|
+
<span id="card_type" style="display:none;">
|
27
|
+
( <span id="looks_like" ><%= Spree.t(:card_type_is) %> <span id="type"></span></span>
|
28
|
+
<span id="unrecognized"><%= Spree.t(:unrecognized_card_type) %></span>
|
29
|
+
)
|
30
|
+
</span>
|
31
|
+
</p>
|
32
|
+
<div class="row">
|
33
|
+
<div class="col-md-8 field" data-hook="card_expiration">
|
34
|
+
<%= label_tag "card_expiry" do %>
|
35
|
+
<%= Spree.t(:expiration) %><abbr class="required" title="required">*</abbr>
|
36
|
+
<% end %>
|
37
|
+
<%= text_field_tag "#{param_prefix}[expiry]", '', id: 'card_expiry', class: "form-control required cardExpiry", placeholder: "MM / YY" %>
|
38
|
+
</div>
|
39
|
+
<div class="col-md-4 field" data-hook="card_code">
|
40
|
+
<%= label_tag "card_code" do %>
|
41
|
+
<%= Spree.t(:card_code) %><abbr class="required" title="required">*</abbr>
|
42
|
+
<% end %>
|
43
|
+
<%= text_field_tag "#{param_prefix}[verification_value]", '', options_hash.merge(id: 'card_code', class: 'form-control required cardCode', size: 5) %>
|
44
|
+
<%= link_to Spree.t(:what_is_this), spree.cvv_path, target: :blank, "data-hook" => "cvv_link", id: "cvv_link" %>
|
45
|
+
</div>
|
38
46
|
</div>
|
39
|
-
</div>
|
40
47
|
|
41
|
-
|
48
|
+
<%= hidden_field_tag "#{param_prefix}[cc_type]", '', id: "cc_type", class: 'ccType' %>
|
49
|
+
</div>
|
42
50
|
</div>
|
@@ -16,10 +16,13 @@
|
|
16
16
|
|
17
17
|
<%= render partial: 'spree/shared/sidebar' if content_for? :sidebar %>
|
18
18
|
|
19
|
-
<
|
19
|
+
<main
|
20
|
+
id="content"
|
21
|
+
class="mt-4 <%= !content_for?(:sidebar) ? "col-sm-12" : "col-sm-12 col-md-9" %>"
|
22
|
+
data-hook>
|
20
23
|
<%= flash_messages %>
|
21
24
|
<%= yield %>
|
22
|
-
</
|
25
|
+
</main>
|
23
26
|
|
24
27
|
<%= yield :templates %>
|
25
28
|
</div>
|
@@ -1,28 +1,41 @@
|
|
1
1
|
<%= render partial: 'spree/shared/error_messages', locals: { target: @order } %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
<
|
2
|
+
|
3
|
+
<div class="table-responsive">
|
4
|
+
<table class="table" id="cart-detail" data-hook>
|
5
|
+
<thead>
|
6
|
+
<tr class="active" data-hook="cart_items_headers">
|
7
|
+
<th class="cart-item-description-header" colspan="2"><%= Spree.t(:item) %></th>
|
8
|
+
<th class="cart-item-price-header"><%= Spree.t(:price) %></th>
|
9
|
+
<th class="cart-item-quantity-header"><%= Spree.t(:qty) %></th>
|
10
|
+
<th class="cart-item-total-header"><%= Spree.t(:total) %></th>
|
11
|
+
<th class="cart-item-delete-header"></th>
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
<tbody id="line_items" data-hook>
|
15
|
+
<%= render partial: 'spree/orders/line_item', collection: order_form.object.line_items, locals: { order_form: order_form } %>
|
16
|
+
</tbody>
|
17
|
+
<% if @order.adjustments.nonzero.exists? || @order.line_item_adjustments.nonzero.exists? || @order.shipment_adjustments.nonzero.exists? || @order.shipments.any? %>
|
18
|
+
<tr class="cart-subtotal">
|
19
|
+
<td colspan="4" align='right'><h5><%= Spree.t(:cart_subtotal, count: @order.line_items.sum(:quantity)) %></h5></td>
|
20
|
+
<td colspan>
|
21
|
+
<h5>
|
22
|
+
<%= order_form.object.display_item_total %>
|
23
|
+
</h5>
|
24
|
+
</td>
|
25
|
+
<td></td>
|
26
|
+
</tr>
|
27
|
+
<%= render "spree/orders/adjustments" %>
|
28
|
+
<% end %>
|
29
|
+
<tr class="table-warning cart-total">
|
30
|
+
<td colspan="4" align='right' class="align-middle">
|
31
|
+
<h5 class="mb-0">
|
32
|
+
<%= Spree.t(:total) %>
|
33
|
+
</h5>
|
34
|
+
</td>
|
35
|
+
<td class="lead" colspan>
|
36
|
+
<%= order_form.object.display_total %>
|
37
|
+
</td>
|
19
38
|
<td></td>
|
20
39
|
</tr>
|
21
|
-
|
22
|
-
|
23
|
-
<tr class="warning cart-total">
|
24
|
-
<td colspan="4" align='right'><h5><%= Spree.t(:total) %></h5></td>
|
25
|
-
<td class="lead" colspan><%= order_form.object.display_total %></td>
|
26
|
-
<td></td>
|
27
|
-
</tr>
|
28
|
-
</table>
|
40
|
+
</table>
|
41
|
+
</div>
|
@@ -1,12 +1,14 @@
|
|
1
1
|
<% @body_id = 'cart' %>
|
2
2
|
|
3
|
-
<div data-hook="cart_container">
|
3
|
+
<div data-hook="cart_container" class="col-12">
|
4
4
|
<h1><%= Spree.t(:shopping_cart) %></h1>
|
5
5
|
|
6
6
|
<% if @order.line_items.empty? %>
|
7
7
|
<div data-hook="empty_cart">
|
8
8
|
<div class="alert alert-info"><%= Spree.t(:your_cart_is_empty) %></div>
|
9
|
-
<p
|
9
|
+
<p>
|
10
|
+
<%= link_to Spree.t(:continue_shopping), products_path, class: 'btn btn-outline-secondary' %>
|
11
|
+
</p>
|
10
12
|
</div>
|
11
13
|
<% else %>
|
12
14
|
<div data-hook="outside_cart_form">
|
@@ -17,34 +19,38 @@
|
|
17
19
|
<%= render partial: 'form', locals: { order_form: order_form } %>
|
18
20
|
</div>
|
19
21
|
|
20
|
-
<div class="
|
21
|
-
|
22
|
-
|
23
|
-
<%=
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
<div class="row">
|
23
|
+
<% if Spree::Frontend::Config[:coupon_codes_enabled] %>
|
24
|
+
<div class='col-md-6 form-inline' data-hook='coupon_code'>
|
25
|
+
<%= order_form.label :coupon_code, class: 'mr-2' %>
|
26
|
+
<div class="input-group">
|
27
|
+
<%= order_form.text_field :coupon_code, size: '30', class: 'form-control' %>
|
28
|
+
<div class="input-group-append">
|
29
|
+
<%= button_tag Spree.t(:coupon_code_apply), class: 'btn btn-outline-secondary' %>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
30
34
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
<%= button_tag
|
37
|
-
|
35
|
+
<div class="links col-md-6 d-flex justify-content-end" data-hook="cart_buttons">
|
36
|
+
<div class="form-group">
|
37
|
+
<%= button_tag class: 'btn btn-primary', id: 'update-button' do %>
|
38
|
+
<%= Spree.t(:update) %>
|
39
|
+
<% end %>
|
40
|
+
<%= button_tag class: 'btn btn-lg btn-success', id: 'checkout-link', name: 'checkout' do %>
|
41
|
+
<%= Spree.t(:checkout) %>
|
42
|
+
<% end %>
|
43
|
+
</div>
|
38
44
|
</div>
|
39
|
-
|
45
|
+
</div>
|
40
46
|
</div>
|
41
47
|
<% end %>
|
42
48
|
</div>
|
43
49
|
|
44
|
-
<div id="empty-cart" class="
|
50
|
+
<div id="empty-cart" class="mt-4" data-hook>
|
45
51
|
<%= form_tag empty_cart_path, method: :put do %>
|
46
52
|
<p id="clear_cart_link" data-hook>
|
47
|
-
<%= submit_tag Spree.t(:empty_cart), class: 'btn btn-
|
53
|
+
<%= submit_tag Spree.t(:empty_cart), class: 'btn btn-outline-secondary' %>
|
48
54
|
<%= Spree.t(:or) %>
|
49
55
|
<%= link_to Spree.t(:continue_shopping), products_path, class: 'continue' %>
|
50
56
|
</p>
|
@@ -1,7 +1,8 @@
|
|
1
1
|
<fieldset id="order_summary" data-hook>
|
2
2
|
<h1><%= accurate_title %></h1>
|
3
|
+
|
3
4
|
<% if order_just_completed?(@order) %>
|
4
|
-
<strong><%= Spree.t(:thank_you_for_your_order) %></strong>
|
5
|
+
<p><strong><%= Spree.t(:thank_you_for_your_order) %></strong></p>
|
5
6
|
<% end %>
|
6
7
|
|
7
8
|
<div id="order" data-hook>
|
@@ -1,27 +1,30 @@
|
|
1
1
|
<%= form_for :order, html: { id: 'add-to-cart-form' } do |f| %>
|
2
2
|
<div class="row" id="inside-product-cart-form" data-hook="inside_product_cart_form" itemprop="offers" itemscope itemtype="https://schema.org/Offer">
|
3
3
|
<% if @product.variants_and_option_values(current_currency).any? %>
|
4
|
-
<div id="product-variants" class="col-
|
4
|
+
<div id="product-variants" class="col-lg-6 mt-4">
|
5
5
|
<h3 class="product-section-title"><%= Spree.t(:variants) %></h3>
|
6
6
|
<ul class="list-group">
|
7
7
|
<% @product.variants_and_option_values(current_currency).each_with_index do |variant, index| %>
|
8
|
-
<li>
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
8
|
+
<li class="list-group-item <%= "active" if index == 0 %>">
|
9
|
+
<div class="form-check">
|
10
|
+
<%= radio_button_tag "variant_id", variant.id, index == 0,
|
11
|
+
'data-price' => variant.price_in(current_currency).money,
|
12
|
+
'data-in-stock' => variant.can_supply?,
|
13
|
+
'data-backordered' => variant.backordered?,
|
14
|
+
class: 'form-check-input'
|
15
|
+
%>
|
16
|
+
<%= label_tag "variant_id_#{ variant.id }", class: "form-check-label" do %>
|
17
|
+
<span class="variant-description">
|
18
|
+
<%= variant.options_text %>
|
19
|
+
</span>
|
20
|
+
<% if variant_price variant %>
|
21
|
+
<span class="price diff"><%= variant_price variant %></span>
|
22
|
+
<% end %>
|
23
|
+
<% unless variant.can_supply? %>
|
24
|
+
<span class="out-of-stock"><%= Spree.t(:out_of_stock) %></span>
|
25
|
+
<% end %>
|
20
26
|
<% end %>
|
21
|
-
|
22
|
-
<span class="out-of-stock"><%= Spree.t(:out_of_stock) %></span>
|
23
|
-
<% end %>
|
24
|
-
<% end %>
|
27
|
+
</div>
|
25
28
|
</li>
|
26
29
|
<% end%>
|
27
30
|
</ul>
|
@@ -31,9 +34,9 @@
|
|
31
34
|
<% end %>
|
32
35
|
|
33
36
|
<% if @product.price_in(current_currency) && !@product.price.nil? %>
|
34
|
-
<div data-hook="product_price" class="col-
|
37
|
+
<div data-hook="product_price" class="col-lg-5 mt-4">
|
35
38
|
<div id="product-price">
|
36
|
-
<
|
39
|
+
<h3 class="product-section-title"><%= Spree.t(:price) %></h3>
|
37
40
|
<div>
|
38
41
|
<span class="lead price selling" itemprop="price" content="<%= @product.price_in(current_currency).amount.to_d %>">
|
39
42
|
<%= display_price(@product) %>
|
@@ -44,8 +47,9 @@
|
|
44
47
|
<% if @product.master.can_supply? %>
|
45
48
|
<link itemprop="availability" href="https://schema.org/InStock" />
|
46
49
|
<% elsif @product.variants.empty? %>
|
47
|
-
<
|
48
|
-
|
50
|
+
<span class="out-of-stock d-block mt-2">
|
51
|
+
<%= Spree.t(:out_of_stock) %>
|
52
|
+
</span>
|
49
53
|
<% end %>
|
50
54
|
<% if @product.backordered? %>
|
51
55
|
<div class="alert alert-warning" id="cart-backordered-info">
|
@@ -55,22 +59,20 @@
|
|
55
59
|
</div>
|
56
60
|
|
57
61
|
<% if @product.can_supply? %>
|
58
|
-
<div class="add-to-cart">
|
59
|
-
<br />
|
62
|
+
<div class="add-to-cart mt-2">
|
60
63
|
<div class="input-group">
|
61
64
|
<%= number_field_tag :quantity, 1, class: 'title form-control', min: 1 %>
|
62
|
-
<
|
65
|
+
<div class="input-group-append">
|
63
66
|
<%= button_tag class: 'btn btn-success', id: 'add-to-cart-button', type: :submit, disabled: true do %>
|
64
67
|
<%= Spree.t(:add_to_cart) %>
|
65
68
|
<% end %>
|
66
|
-
</
|
69
|
+
</div>
|
67
70
|
</div>
|
68
71
|
</div>
|
69
72
|
<% end %>
|
70
73
|
</div>
|
71
74
|
<% else %>
|
72
75
|
<div id="product-price">
|
73
|
-
<br />
|
74
76
|
<div>
|
75
77
|
<span class="price selling" itemprop="price">
|
76
78
|
<%= Spree.t('product_not_available_in_this_currency') %>
|
@@ -1,15 +1,14 @@
|
|
1
1
|
<% url = spree.product_path(product, taxon_id: taxon.try(:id)) %>
|
2
|
-
<div id="product_<%= product.id %>" class="
|
3
|
-
<div class="
|
2
|
+
<div id="product_<%= product.id %>" class="d-flex w-100 col-12 col-sm-6 col-lg-4 col-xl-3 product-list-item mb-4" data-hook="products_list_item" itemscope itemtype="https://schema.org/Product">
|
3
|
+
<div class="card w-100">
|
4
4
|
<% cache(taxon.present? ? [I18n.locale, current_currency, taxon, product] : cache_key_for_product(product)) do %>
|
5
|
-
<div class="
|
6
|
-
<%= link_to url, itemprop: "url" do %>
|
7
|
-
<%= small_image(product, itemprop: "image")
|
8
|
-
<%= content_tag(:span, truncate(product.name, length: 50), class: 'info', itemprop: "name", title: product.name) %>
|
5
|
+
<div class="card-body text-center product-body">
|
6
|
+
<%= link_to url, itemprop: "url", class: 'd-block text-center' do %>
|
7
|
+
<%= small_image(product, itemprop: "image", class: "d-block mx-auto") %>
|
8
|
+
<%= content_tag(:span, truncate(product.name, length: 50), class: 'info mt-3 d-block', itemprop: "name", title: product.name) %>
|
9
9
|
<% end %>
|
10
|
-
<br/>
|
11
10
|
</div>
|
12
|
-
<div class="
|
11
|
+
<div class="card-footer text-center">
|
13
12
|
<span itemprop="offers" itemscope itemtype="https://schema.org/Offer">
|
14
13
|
<span class="price selling lead" itemprop="price" content="<%= (product.price_in(current_currency).amount.nil?)? 0 : product.price_in(current_currency).amount.to_d %>">
|
15
14
|
<%= display_price(product) %>
|
@@ -4,17 +4,19 @@
|
|
4
4
|
<div id="promotions">
|
5
5
|
<h3><%= Spree.t(:promotions) %></h3>
|
6
6
|
<% promotions.each do |promotion| %>
|
7
|
-
<div class="
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
<div class="card mb-3 bg-light">
|
8
|
+
<div class="card-body p-1">
|
9
|
+
<h4><%= promotion.name %></h4>
|
10
|
+
<p><%= promotion.description %></p>
|
11
|
+
<% if promotion.products.any? %>
|
12
|
+
<ul>
|
13
|
+
<% promotion.products.each do |product| %>
|
14
|
+
<li><%= link_to product.name, product_path(product) %></li>
|
15
|
+
<% end %>
|
16
|
+
</ul>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
19
|
+
</div>
|
18
20
|
<% end %>
|
19
21
|
</div>
|
20
22
|
<% end %>
|
@@ -1,11 +1,18 @@
|
|
1
|
-
<% unless @product_properties.blank? %>
|
2
|
-
<h3 class="product-section-title"
|
1
|
+
<% unless @product_properties.blank? %>
|
2
|
+
<h3 class="product-section-title h4 mt-4">
|
3
|
+
<%= Spree.t('properties')%>
|
4
|
+
</h3>
|
5
|
+
|
3
6
|
<table id="product-properties" class="table table-striped" data-hook>
|
4
7
|
<tbody>
|
5
8
|
<% @product_properties.each do |product_property| %>
|
6
9
|
<% css_class = cycle('even', 'odd', name: "properties") %>
|
7
10
|
<tr class="<%= css_class %>">
|
8
|
-
<td
|
11
|
+
<td>
|
12
|
+
<strong>
|
13
|
+
<%= product_property.property.presentation %>
|
14
|
+
</strong>
|
15
|
+
</td>
|
9
16
|
<td><%= product_property.value %></td>
|
10
17
|
</tr>
|
11
18
|
<% end %>
|