solidus_frontend_devise_token_auth 2.8.0.alpha.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +26 -0
  3. data/README.md +42 -0
  4. data/Rakefile +17 -0
  5. data/app/assets/config/solidus_frontend_manifest.js +4 -0
  6. data/app/assets/images/credit_cards/amex_cid.gif +0 -0
  7. data/app/assets/images/credit_cards/credit_card.gif +0 -0
  8. data/app/assets/images/credit_cards/discover_cid.gif +0 -0
  9. data/app/assets/images/credit_cards/icons/american_express.png +0 -0
  10. data/app/assets/images/credit_cards/icons/cirrus.png +0 -0
  11. data/app/assets/images/credit_cards/icons/delta.png +0 -0
  12. data/app/assets/images/credit_cards/icons/diners_club.png +0 -0
  13. data/app/assets/images/credit_cards/icons/directdebit.png +0 -0
  14. data/app/assets/images/credit_cards/icons/discover.png +0 -0
  15. data/app/assets/images/credit_cards/icons/egold.png +0 -0
  16. data/app/assets/images/credit_cards/icons/maestro.png +0 -0
  17. data/app/assets/images/credit_cards/icons/master.png +0 -0
  18. data/app/assets/images/credit_cards/icons/paypal.png +0 -0
  19. data/app/assets/images/credit_cards/icons/solo.png +0 -0
  20. data/app/assets/images/credit_cards/icons/switch.png +0 -0
  21. data/app/assets/images/credit_cards/icons/visa.png +0 -0
  22. data/app/assets/images/credit_cards/icons/visaelectron.png +0 -0
  23. data/app/assets/images/credit_cards/icons/westernunion.png +0 -0
  24. data/app/assets/images/credit_cards/icons/wirecard.png +0 -0
  25. data/app/assets/images/credit_cards/icons/worldpay.png +0 -0
  26. data/app/assets/images/credit_cards/master_cid.jpg +0 -0
  27. data/app/assets/images/credit_cards/visa_cid.gif +0 -0
  28. data/app/assets/images/favicon.ico +0 -0
  29. data/app/assets/images/icons/add-to-cart.png +0 -0
  30. data/app/assets/images/icons/checkout.png +0 -0
  31. data/app/assets/images/icons/delete.png +0 -0
  32. data/app/assets/images/icons/update.png +0 -0
  33. data/app/assets/images/spinner.gif +0 -0
  34. data/app/assets/images/spree/frontend/cart.png +0 -0
  35. data/app/assets/javascripts/spree/frontend/cart.js +30 -0
  36. data/app/assets/javascripts/spree/frontend/checkout/address.js +127 -0
  37. data/app/assets/javascripts/spree/frontend/checkout/coupon-code.js +41 -0
  38. data/app/assets/javascripts/spree/frontend/checkout/payment.js +55 -0
  39. data/app/assets/javascripts/spree/frontend/checkout.js +24 -0
  40. data/app/assets/javascripts/spree/frontend/locale_selector.js +5 -0
  41. data/app/assets/javascripts/spree/frontend/product.js +81 -0
  42. data/app/assets/javascripts/spree/frontend.js +5 -0
  43. data/app/assets/stylesheets/spree/frontend/_skeleton.scss +242 -0
  44. data/app/assets/stylesheets/spree/frontend/_variables.scss +65 -0
  45. data/app/assets/stylesheets/spree/frontend/screen.css.scss +1387 -0
  46. data/app/assets/stylesheets/spree/frontend.css +5 -0
  47. data/app/controllers/spree/checkout_controller.rb +236 -0
  48. data/app/controllers/spree/content_controller.rb +11 -0
  49. data/app/controllers/spree/home_controller.rb +14 -0
  50. data/app/controllers/spree/locale_controller.rb +20 -0
  51. data/app/controllers/spree/orders_controller.rb +138 -0
  52. data/app/controllers/spree/products_controller.rb +52 -0
  53. data/app/controllers/spree/store_controller.rb +30 -0
  54. data/app/controllers/spree/taxons_controller.rb +31 -0
  55. data/app/helpers/spree/orders_helper.rb +18 -0
  56. data/app/helpers/spree/taxon_filters_helper.rb +13 -0
  57. data/app/models/spree/frontend_configuration.rb +10 -0
  58. data/app/views/spree/address/_form.html.erb +96 -0
  59. data/app/views/spree/address/_form_hidden.html.erb +12 -0
  60. data/app/views/spree/checkout/_address.html.erb +33 -0
  61. data/app/views/spree/checkout/_confirm.html.erb +25 -0
  62. data/app/views/spree/checkout/_coupon_code.html.erb +12 -0
  63. data/app/views/spree/checkout/_delivery.html.erb +108 -0
  64. data/app/views/spree/checkout/_payment.html.erb +67 -0
  65. data/app/views/spree/checkout/_summary.html.erb +76 -0
  66. data/app/views/spree/checkout/_terms_and_conditions.en.html.erb +1 -0
  67. data/app/views/spree/checkout/edit.html.erb +32 -0
  68. data/app/views/spree/checkout/existing_payment/_gateway.html.erb +9 -0
  69. data/app/views/spree/checkout/payment/_check.html.erb +0 -0
  70. data/app/views/spree/checkout/payment/_gateway.html.erb +36 -0
  71. data/app/views/spree/content/cvv.html.erb +13 -0
  72. data/app/views/spree/home/index.html.erb +12 -0
  73. data/app/views/spree/layouts/spree_application.html.erb +36 -0
  74. data/app/views/spree/orders/_adjustment_row.html.erb +8 -0
  75. data/app/views/spree/orders/_adjustments.html.erb +24 -0
  76. data/app/views/spree/orders/_form.html.erb +29 -0
  77. data/app/views/spree/orders/_line_item.html.erb +34 -0
  78. data/app/views/spree/orders/edit.html.erb +47 -0
  79. data/app/views/spree/orders/show.html.erb +22 -0
  80. data/app/views/spree/payments/_payment.html.erb +18 -0
  81. data/app/views/spree/products/_cart_form.html.erb +65 -0
  82. data/app/views/spree/products/_image.html.erb +8 -0
  83. data/app/views/spree/products/_promotions.html.erb +19 -0
  84. data/app/views/spree/products/_properties.html.erb +15 -0
  85. data/app/views/spree/products/_taxons.html.erb +14 -0
  86. data/app/views/spree/products/_thumbnails.html.erb +21 -0
  87. data/app/views/spree/products/index.html.erb +27 -0
  88. data/app/views/spree/products/show.html.erb +51 -0
  89. data/app/views/spree/shared/_address.html.erb +38 -0
  90. data/app/views/spree/shared/_filters.html.erb +27 -0
  91. data/app/views/spree/shared/_footer.html.erb +6 -0
  92. data/app/views/spree/shared/_head.html.erb +14 -0
  93. data/app/views/spree/shared/_header.html.erb +5 -0
  94. data/app/views/spree/shared/_image.html.erb +12 -0
  95. data/app/views/spree/shared/_link_to_cart.html.erb +1 -0
  96. data/app/views/spree/shared/_locale_selector.html.erb +25 -0
  97. data/app/views/spree/shared/_login_bar_items.html.erb +1 -0
  98. data/app/views/spree/shared/_main_nav_bar.html.erb +12 -0
  99. data/app/views/spree/shared/_nav_bar.html.erb +9 -0
  100. data/app/views/spree/shared/_order_details.html.erb +146 -0
  101. data/app/views/spree/shared/_products.html.erb +51 -0
  102. data/app/views/spree/shared/_search.html.erb +11 -0
  103. data/app/views/spree/shared/_shipment_tracking.html.erb +9 -0
  104. data/app/views/spree/shared/_sidebar.html.erb +3 -0
  105. data/app/views/spree/shared/_taxonomies.html.erb +9 -0
  106. data/app/views/spree/shared/unauthorized.html.erb +0 -0
  107. data/app/views/spree/store/cart_link.html.erb +1 -0
  108. data/app/views/spree/taxons/_taxon.html.erb +4 -0
  109. data/app/views/spree/taxons/show.html.erb +20 -0
  110. data/config/initializers/assets.rb +3 -0
  111. data/config/initializers/canonical_rails.rb +16 -0
  112. data/config/routes.rb +33 -0
  113. data/lib/generators/solidus/views/override_generator.rb +49 -0
  114. data/lib/solidus_frontend.rb +3 -0
  115. data/lib/spree/frontend/engine.rb +13 -0
  116. data/lib/spree/frontend/middleware/seo_assist.rb +52 -0
  117. data/lib/spree/frontend.rb +15 -0
  118. data/lib/spree_frontend.rb +3 -0
  119. data/lib/tasks/rake_util.rb +18 -0
  120. data/lib/tasks/taxon.rake +16 -0
  121. data/script/rails +10 -0
  122. data/solidus_frontend.gemspec +35 -0
  123. data/spec/controllers/controller_helpers_spec.rb +30 -0
  124. data/spec/controllers/locale_controller_spec.rb +57 -0
  125. data/spec/controllers/spree/checkout_controller_spec.rb +539 -0
  126. data/spec/controllers/spree/checkout_controller_with_views_spec.rb +37 -0
  127. data/spec/controllers/spree/content_controller_spec.rb +9 -0
  128. data/spec/controllers/spree/current_order_tracking_spec.rb +47 -0
  129. data/spec/controllers/spree/home_controller_spec.rb +29 -0
  130. data/spec/controllers/spree/orders_controller_ability_spec.rb +93 -0
  131. data/spec/controllers/spree/orders_controller_spec.rb +225 -0
  132. data/spec/controllers/spree/orders_controller_transitions_spec.rb +33 -0
  133. data/spec/controllers/spree/products_controller_spec.rb +38 -0
  134. data/spec/controllers/spree/taxons_controller_spec.rb +14 -0
  135. data/spec/features/address_spec.rb +78 -0
  136. data/spec/features/automatic_promotion_adjustments_spec.rb +49 -0
  137. data/spec/features/caching/products_spec.rb +48 -0
  138. data/spec/features/caching/taxons_spec.rb +21 -0
  139. data/spec/features/cart_spec.rb +85 -0
  140. data/spec/features/checkout_spec.rb +690 -0
  141. data/spec/features/checkout_unshippable_spec.rb +37 -0
  142. data/spec/features/coupon_code_spec.rb +266 -0
  143. data/spec/features/currency_spec.rb +20 -0
  144. data/spec/features/free_shipping_promotions_spec.rb +60 -0
  145. data/spec/features/locale_spec.rb +27 -0
  146. data/spec/features/order_spec.rb +73 -0
  147. data/spec/features/products_spec.rb +291 -0
  148. data/spec/features/promotion_code_invalidation_spec.rb +54 -0
  149. data/spec/features/quantity_promotions_spec.rb +130 -0
  150. data/spec/features/taxons_spec.rb +158 -0
  151. data/spec/features/template_rendering_spec.rb +20 -0
  152. data/spec/fixtures/thinking-cat.jpg +0 -0
  153. data/spec/generators/solidus/views/override_generator_spec.rb +50 -0
  154. data/spec/helpers/base_helper_spec.rb +13 -0
  155. data/spec/helpers/order_helper_spec.rb +14 -0
  156. data/spec/helpers/taxon_filters_helper_spec.rb +12 -0
  157. data/spec/spec_helper.rb +106 -0
  158. data/spec/support/features/fill_in_with_force.rb +12 -0
  159. data/spec/support/shared_contexts/checkout_setup.rb +12 -0
  160. data/spec/support/shared_contexts/custom_products.rb +28 -0
  161. data/spec/support/shared_contexts/locales.rb +16 -0
  162. data/spec/views/spree/checkout/_summary_spec.rb +11 -0
  163. metadata +337 -0
@@ -0,0 +1,12 @@
1
+ <%= form.hidden_field :firstname %>
2
+ <%= form.hidden_field :lastname %>
3
+ <%= form.hidden_field :company %>
4
+ <%= form.hidden_field :address1 %>
5
+ <%= form.hidden_field :address2 %>
6
+ <%= form.hidden_field :city %>
7
+ <%= form.hidden_field :country_id %>
8
+ <%= form.hidden_field :state_id %>
9
+ <%= form.hidden_field :state_name %>
10
+ <%= form.hidden_field :zipcode %>
11
+ <%= form.hidden_field :phone %>
12
+ <%= form.hidden_field :alternative_phone %>
@@ -0,0 +1,33 @@
1
+ <div class="columns alpha six" data-hook="billing_fieldset_wrapper">
2
+ <fieldset id="billing" data-hook>
3
+ <%= form.fields_for :bill_address do |bill_form| %>
4
+ <legend align="center"><%= t('spree.billing_address') %></legend>
5
+ <%= render partial: 'spree/address/form', locals: { form: bill_form, address_type: 'billing', address: @order.bill_address } %>
6
+ <% end %>
7
+ </fieldset>
8
+ </div>
9
+
10
+ <div class="columns omega six" data-hook="shipping_fieldset_wrapper">
11
+ <fieldset id="shipping" data-hook>
12
+ <%= form.fields_for :ship_address do |ship_form| %>
13
+ <legend align="center"><%= t('spree.shipping_address') %></legend>
14
+ <div class="checkbox" data-hook="use_billing">
15
+ <%= check_box_tag 'order[use_billing]', '1', @order.shipping_eq_billing_address? %>
16
+ <%= label_tag :order_use_billing, t('spree.use_billing_address'), id: 'use_billing' %>
17
+ </div>
18
+ <%= render partial: 'spree/address/form', locals: { form: ship_form, address_type: 'shipping', address: @order.ship_address } %>
19
+ <% end %>
20
+ </fieldset>
21
+ </div>
22
+ <hr class="clear" />
23
+
24
+ <div class="form-buttons" data-hook="buttons">
25
+ <%= submit_tag t('spree.save_and_continue'), class: 'continue button primary' %>
26
+ <% if try_spree_current_user %>
27
+ <span data-hook="save_user_address">
28
+ &nbsp; &nbsp;
29
+ <%= check_box_tag 'save_user_address', '1', try_spree_current_user.respond_to?(:persist_order_address) %>
30
+ <%= label_tag :save_user_address, t('spree.save_my_address') %>
31
+ </span>
32
+ <% end %>
33
+ </div>
@@ -0,0 +1,25 @@
1
+ <fieldset id="order_details" data-hook>
2
+ <div class="clear"></div>
3
+ <legend align="center"><%= t('spree.confirm') %></legend>
4
+ <%= render partial: 'spree/shared/order_details', locals: { order: @order } %>
5
+ </fieldset>
6
+
7
+ <br />
8
+
9
+ <div class="form-buttons" data-hook="buttons">
10
+ <% Spree::Frontend::Config[:require_terms_and_conditions_acceptance].tap do |requires_acceptance| %>
11
+ <% if requires_acceptance %>
12
+ <div class="terms_and_conditions" data-hook="terms_and_conditions">
13
+ <div class="policy"><%= render partial: "spree/checkout/terms_and_conditions" %></div>
14
+ <%= check_box_tag :accept_terms_and_conditions, 'accepted', false %>
15
+ <%= label_tag :accept_terms_and_conditions, t('spree.agree_to_terms_of_service') %>
16
+ </div>
17
+ <% end %>
18
+
19
+ <%= submit_tag t('spree.place_order'),
20
+ disabled: requires_acceptance,
21
+ class: "continue button primary #{ 'disabled' if requires_acceptance }" %>
22
+ <% end %>
23
+
24
+ <script>Spree.disableSaveOnClick();</script>
25
+ </div>
@@ -0,0 +1,12 @@
1
+ <div class="coupon-code" data-hook='coupon_code'>
2
+ <%= form_for order, url: update_checkout_path(order.state) do |form| %>
3
+ <%= form.label :coupon_code %>
4
+ <%= form.text_field :coupon_code, placeholder: :coupon_code %>
5
+
6
+ <button type="submit" class="button coupon-code-apply-button" id="coupon-code-apply-button">
7
+ <%= t('spree.apply_code') %>
8
+ </button>
9
+ <% end %>
10
+
11
+ <div id='coupon_status'></div>
12
+ </div>
@@ -0,0 +1,108 @@
1
+ <fieldset id='shipping_method' data-hook>
2
+ <legend align="center"><%= t('spree.delivery') %></legend>
3
+ <div class="inner" data-hook="shipping_method_inner">
4
+ <div id="methods">
5
+ <%= form.fields_for :shipments do |ship_form| %>
6
+
7
+ <div class="shipment">
8
+ <h3 class="stock-location" data-hook="stock-location">
9
+ <%= t('spree.package_from') %>
10
+ <strong class="stock-location-name" data-hook="stock-location-name"><%= ship_form.object.stock_location.name %></strong>
11
+ </h3>
12
+
13
+ <table class="stock-contents" data-hook="stock-contents">
14
+ <colgroup>
15
+ <col style="width: 10%;" />
16
+ <col style="width: 60%;" />
17
+ <col style="width: 10%;" />
18
+ <col style="width: 20%;" />
19
+ </colgroup>
20
+ <thead>
21
+ <th></th>
22
+ <th align='left'><%= t('spree.item') %></th>
23
+ <th><%= t('spree.qty') %></th>
24
+ <th><%= t('spree.price') %></th>
25
+ </thead>
26
+ <tbody>
27
+ <% ship_form.object.manifest.each do |item| %>
28
+ <tr class="stock-item">
29
+ <td class="item-image">
30
+ <%= render 'spree/shared/image',
31
+ image: (item.variant.gallery.images.first || item.variant.product.gallery.images.first),
32
+ size: :mini %>
33
+ </td>
34
+ <td class="item-name"><%= item.variant.name %></td>
35
+ <td class="item-qty"><%= item.quantity %></td>
36
+ <td class="item-price"><%= display_price(item.variant) %></td>
37
+ </tr>
38
+ <% end %>
39
+ </tbody>
40
+ </table>
41
+
42
+ <h5 class="stock-shipping-method-title"><%= t('spree.shipping_method') %></h5>
43
+ <ul class="radios shipping-methods">
44
+ <% ship_form.object.shipping_rates.each do |rate| %>
45
+ <li class="shipping-method">
46
+ <label>
47
+ <%= ship_form.radio_button :selected_shipping_rate_id, rate.id %>
48
+ <span class="rate-name"><%= rate.name %></span>
49
+ <span class="rate-cost"><%= rate.display_cost %></span>
50
+ </label>
51
+ </li>
52
+ <% end %>
53
+ </ul>
54
+ </div>
55
+
56
+ <% end %>
57
+
58
+ <% if @differentiator.try(:missing?) %>
59
+ <div class="shipment unshippable">
60
+ <h3 class="stock-location" data-hook="stock-location">
61
+ <%= t('spree.unshippable_items') %>
62
+ </h3>
63
+ <table class="stock-contents" data-hook="stock-missing">
64
+ <colgroup>
65
+ <col style="width: 10%;" />
66
+ <col style="width: 60%;" />
67
+ <col style="width: 10%;" />
68
+ <col style="width: 20%;" />
69
+ </colgroup>
70
+ <thead>
71
+ <th></th>
72
+ <th align='left'><%= t('spree.item') %></th>
73
+ <th><%= t('spree.qty') %></th>
74
+ <th><%= t('spree.price') %></th>
75
+ </thead>
76
+ <tbody>
77
+ <% @differentiator.missing.each do |variant, quantity| %>
78
+ <tr class="stock-item">
79
+ <td class="item-image">
80
+ <%= render 'spree/shared/image',
81
+ image: (variant.gallery.images.first || variant.product.gallery.images.first),
82
+ size: :mini %>
83
+ </td>
84
+ <td class="item-name"><%= variant.name %></td>
85
+ <td class="item-qty"><%= quantity %></td>
86
+ <td class="item-price"><%= display_price(variant) %></td>
87
+ </tr>
88
+ <% end %>
89
+ </tbody>
90
+ </table>
91
+ </div>
92
+ <% end %>
93
+
94
+ </div>
95
+ <% if Spree::Config[:shipping_instructions] %>
96
+ <p id="minstrs" data-hook>
97
+ <%= form.label :special_instructions, t('spree.shipping_instructions') %><br />
98
+ <%= form.text_area :special_instructions, cols: 40, rows: 7 %>
99
+ </p>
100
+ <% end %>
101
+ </div>
102
+ </fieldset>
103
+
104
+ <br />
105
+
106
+ <div class="form-buttons" data-hook="buttons">
107
+ <%= submit_tag t('spree.save_and_continue'), class: 'continue button primary' %>
108
+ </div>
@@ -0,0 +1,67 @@
1
+ <fieldset id="payment" data-hook>
2
+ <legend align="center"><%= t('spree.payment_information') %></legend>
3
+ <div data-hook="checkout_payment_step">
4
+ <% if @wallet_payment_sources.present? %>
5
+ <div class="card_options">
6
+ <%= radio_button_tag 'use_existing_card', 'yes', true %>
7
+ <label for="use_existing_card_yes">
8
+ <%= t('spree.use_existing_cc') %>
9
+ </label>
10
+ <br/>
11
+ <%= radio_button_tag 'use_existing_card', 'no' %>
12
+ <label for="use_existing_card_no">
13
+ <%= t('spree.use_new_cc_or_payment_method') %>
14
+ </label>
15
+ </div>
16
+
17
+ <div id="existing_cards">
18
+ <div class="field" data-hook="existing_cards">
19
+ <table class="existing-credit-card-list">
20
+ <tbody>
21
+ <% @wallet_payment_sources.each do |wallet_payment_source| %>
22
+ <%=
23
+ render(
24
+ partial: "spree/checkout/existing_payment/#{wallet_payment_source.payment_source.payment_method.partial_name}",
25
+ locals: {
26
+ wallet_payment_source: wallet_payment_source,
27
+ default: wallet_payment_source == @default_wallet_payment_source,
28
+ }
29
+ )
30
+ %>
31
+ <% end %>
32
+ </tbody>
33
+ </table>
34
+ </div>
35
+ </div>
36
+ <% end %>
37
+
38
+ <div id="payment-method-fields" data-hook>
39
+ <% @order.available_payment_methods.each do |method| %>
40
+ <p>
41
+ <label>
42
+ <%= radio_button_tag "order[payments_attributes][][payment_method_id]", method.id, method == @order.available_payment_methods.first %>
43
+ <%= t(method.name, scope: 'spree.payment_methods', default: method.name) %>
44
+ </label>
45
+ </p>
46
+ <% end %>
47
+ </div>
48
+
49
+ <ul id="payment-methods" data-hook>
50
+ <% @order.available_payment_methods.each do |method| %>
51
+ <li id="payment_method_<%= method.id %>" class="<%= 'last' if method == @order.available_payment_methods.last %>" data-hook>
52
+ <fieldset>
53
+ <%= render partial: "spree/checkout/payment/#{method.partial_name}", locals: { payment_method: method } %>
54
+ </fieldset>
55
+ </li>
56
+ <% end %>
57
+ </ul>
58
+ <br style="clear:both;" />
59
+ </div>
60
+ </fieldset>
61
+
62
+ <br class="space" />
63
+
64
+ <div class="form-buttons" data-hook="buttons">
65
+ <%= submit_tag t('spree.save_and_continue'), class: 'continue button primary' %>
66
+ <script>Spree.disableSaveOnClick();</script>
67
+ </div>
@@ -0,0 +1,76 @@
1
+ <h3><%= t('spree.order_summary') %></h3>
2
+
3
+ <table data-hook="order_summary">
4
+ <tbody>
5
+ <tr data-hook="item_total">
6
+ <td><strong><%= t('spree.item_total') %>:</strong></td>
7
+ <td><strong><%= order.display_item_total.to_html %></strong></td>
8
+ </tr>
9
+
10
+ <% if order.line_item_adjustments.nonzero.exists? %>
11
+ <tbody data-hook="order_details_promotion_adjustments">
12
+ <% order.line_item_adjustments.nonzero.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
13
+ <tr class="total">
14
+ <td><%= label %></td>
15
+ <td><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %></td>
16
+ </tr>
17
+ <% end %>
18
+ </tbody>
19
+ <% end %>
20
+
21
+ <tbody data-hook="order_details_tax_adjustments">
22
+ <% order.all_adjustments.nonzero.tax.eligible.group_by(&:label).each do |label, adjustments| %>
23
+ <tr class="total">
24
+ <td><%= label %></td>
25
+ <td><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %></td>
26
+ </tr>
27
+ <% end %>
28
+ </tbody>
29
+
30
+ <% if order.passed_checkout_step?("delivery") && order.shipments.any? %>
31
+ <tr data-hook="shipping_total">
32
+ <td><%= t('spree.shipping_total') %>:</td>
33
+ <td><%= Spree::Money.new(order.shipments.to_a.sum(&:cost), currency: order.currency).to_html %></td>
34
+ </tr>
35
+
36
+ <% if order.shipment_adjustments.nonzero.exists? %>
37
+ <tbody data-hook="order_details_shipment_promotion_adjustments">
38
+ <% order.shipment_adjustments.nonzero.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
39
+ <tr class="total">
40
+ <td><%= label %>:</td>
41
+ <td><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %></td>
42
+ </tr>
43
+ <% end %>
44
+ </tbody>
45
+ <% end %>
46
+ <% end %>
47
+
48
+ <% if order.adjustments.nonzero.eligible.exists? %>
49
+ <tbody id="summary-order-charges" data-hook>
50
+ <% order.adjustments.nonzero.eligible.each do |adjustment| %>
51
+ <% next if (adjustment.source_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
52
+ <tr class="total">
53
+ <td><%= adjustment.label %>:</td>
54
+ <td><%= adjustment.display_amount.to_html %></td>
55
+ </tr>
56
+ <% end %>
57
+ </tbody>
58
+ <% end %>
59
+
60
+ <% if order.total_applicable_store_credit > 0.0 %>
61
+ <tr data-hook="checkout-summary-store-credit">
62
+ <td><%= t('spree.store_credit.store_credit') %>:</td>
63
+ <td><%= order.display_total_applicable_store_credit.to_html %></td>
64
+ </tr>
65
+ <% end %>
66
+
67
+ <tr data-hook="order_total">
68
+ <td><strong><%= t('spree.order_total') %>:</strong></td>
69
+ <td><strong><span id='summary-order-total'><%= order.display_order_total_after_store_credit.to_html %></span></strong></td>
70
+ </tr>
71
+ </tbody>
72
+ </table>
73
+
74
+ <% if order.state == 'payment' %>
75
+ <%= render 'coupon_code', order: order %>
76
+ <% end %>
@@ -0,0 +1 @@
1
+ Put your terms and conditions here
@@ -0,0 +1,32 @@
1
+ <div id="checkout" data-hook>
2
+ <%= render partial: 'spree/shared/error_messages', locals: { target: @order } %>
3
+
4
+ <div class="row" data-hook="checkout_header">
5
+ <h1 class="columns three alpha" data-hook="checkout_title"><%= t('spree.checkout') %></h1>
6
+ <div class="columns thirteen omega" data-hook="checkout_progress"><%= checkout_progress %></div>
7
+ </div>
8
+
9
+ <div class="row" data-hook="checkout_content">
10
+ <div class="columns <%= if @order.state != 'confirm' then 'alpha twelve' else 'alpha omega sixteen' end %>" data-hook="checkout_form_wrapper">
11
+ <%= form_for @order, url: update_checkout_path(@order.state), html: { id: "checkout_form_#{@order.state}" } do |form| %>
12
+ <% if @order.state == 'address' || !@order.email? %>
13
+ <div class="field field-required" style='clear: both'>
14
+ <%= form.label :email %><br />
15
+ <%= form.email_field :email, required: true %>
16
+ </div>
17
+ <% end %>
18
+ <%= render @order.state, form: form %>
19
+ <% end %>
20
+ </div>
21
+ <% if @order.state != 'confirm' %>
22
+ <div id="checkout-summary" data-hook="checkout_summary_box" class="columns omega four">
23
+ <%= render partial: 'summary', locals: { order: @order } %>
24
+ </div>
25
+ <% end %>
26
+ </div>
27
+ </div>
28
+
29
+ <script>
30
+ Spree.current_order_id = "<%= @order.number %>"
31
+ Spree.current_order_token = "<%= @order.guest_token %>"
32
+ </script>
@@ -0,0 +1,9 @@
1
+ <tr id="<%= dom_id(wallet_payment_source, 'spree')%>" class="<%= cycle('even', 'odd') %>">
2
+ <td><%= wallet_payment_source.payment_source.name %></td>
3
+ <td><%= wallet_payment_source.payment_source.display_number %></td>
4
+ <td><%= wallet_payment_source.payment_source.month %></td>
5
+ <td><%= wallet_payment_source.payment_source.year %></td>
6
+ <td>
7
+ <%= radio_button_tag "order[wallet_payment_source_id]", wallet_payment_source.id, default, class: "existing-cc-radio" %>
8
+ </td>
9
+ </tr>
File without changes
@@ -0,0 +1,36 @@
1
+ <%= image_tag 'credit_cards/credit_card.gif', id: 'credit-card-image' %>
2
+ <% param_prefix = "payment_source[#{payment_method.id}]" %>
3
+
4
+ <div class="field field-required">
5
+ <%= label_tag "name_on_card_#{payment_method.id}", t('spree.name_on_card') %>
6
+ <%= text_field_tag "#{param_prefix}[name]", "#{@order.billing_firstname} #{@order.billing_lastname}", { id: "name_on_card_#{payment_method.id}", autocomplete: "cc-name" } %>
7
+ </div>
8
+
9
+ <div class="field field-required" data-hook="card_number">
10
+ <%= label_tag "card_number", t('spree.card_number') %>
11
+ <%= text_field_tag "#{param_prefix}[number]", '', {id: 'card_number', class: 'required cardNumber', size: 19, maxlength: 19, autocomplete: "cc-number", type: "tel" } %>
12
+ <span id="card_type" style="display:none;">
13
+ ( <span id="looks_like" ><%= t('spree.card_type_is') %> <span id="type"></span></span>
14
+ <span id="unrecognized"><%= t('spree.unrecognized_card_type') %></span>
15
+ )
16
+ </span>
17
+ </div>
18
+
19
+ <div class="field field-required" data-hook="card_expiration">
20
+ <%= label_tag "card_expiry", t('spree.expiration') %>
21
+ <%= text_field_tag "#{param_prefix}[expiry]", '', id: 'card_expiry', class: "required cardExpiry", placeholder: "MM / YY", type: "tel" %>
22
+ </div>
23
+
24
+ <div class="field field-required" data-hook="card_code">
25
+ <%= label_tag "card_code", t('spree.card_code') %>
26
+ <%= text_field_tag "#{param_prefix}[verification_value]", '', {id: 'card_code', class: 'required cardCode', size: 5, type: "tel", autocomplete: "off" } %>
27
+ <%= link_to "(#{t('spree.what_is_this')})", spree.cvv_path, target: '_blank', "data-hook" => "cvv_link", id: "cvv_link" %>
28
+ </div>
29
+
30
+ <% if @order.bill_address %>
31
+ <%= fields_for "#{param_prefix}[address_attributes]", @order.bill_address do |f| %>
32
+ <%= render partial: 'spree/address/form_hidden', locals: { form: f } %>
33
+ <% end %>
34
+ <% end %>
35
+
36
+ <%= hidden_field_tag "#{param_prefix}[cc_type]", '', id: "cc_type", class: 'ccType' %>
@@ -0,0 +1,13 @@
1
+ <div class="cvv" data-hook>
2
+ <h1><%= t('spree.what_is_a_cvv') %></h1>
3
+ <p>For Visa, MasterCard, and Discover cards, the card code is the last 3 digit number located on the back of your card on or above your signature line. For an American Express card, it is the 4 digits on the FRONT above the end of your card number.</p>
4
+ <p>To help reduce fraud in the card-not-present environment, credit card companies have introduced a card code program. Visa calls this code Card Verification Value (CVV); MasterCard calls it Card Validation Code (CVC); Discover calls it Card ID (CID). The card code is a three- or four- digit security code that is printed on the back of cards. The number typically appears at the end of the signature panel.</p>
5
+ <div class="cid-caption">Visa</div>
6
+ <%= image_tag 'credit_cards/visa_cid.gif' %>
7
+ <div class="cid-caption">Master Card</div>
8
+ <%= image_tag 'credit_cards/master_cid.jpg' %>
9
+ <div class="cid-caption">American Express</div>
10
+ <%= image_tag 'credit_cards/amex_cid.gif' %>
11
+ <div class="cid-caption">Discover</div>
12
+ <%= image_tag 'credit_cards/discover_cid.gif' %>
13
+ </div>
@@ -0,0 +1,12 @@
1
+ <% content_for :sidebar do %>
2
+ <div data-hook="homepage_sidebar_navigation">
3
+ <%= render partial: 'spree/shared/taxonomies' %>
4
+ </div>
5
+ <% end %>
6
+
7
+ <div data-hook="homepage_products">
8
+ <% cache(cache_key_for_products) do %>
9
+ <%= render partial: 'spree/shared/products', locals: { products: @products } %>
10
+ <% end %>
11
+ </div>
12
+
@@ -0,0 +1,36 @@
1
+ <!doctype html>
2
+ <!--[if lt IE 7 ]> <html class="ie ie6" lang="<%= I18n.locale %>"> <![endif]-->
3
+ <!--[if IE 7 ]> <html class="ie ie7" lang="<%= I18n.locale %>"> <![endif]-->
4
+ <!--[if IE 8 ]> <html class="ie ie8" lang="<%= I18n.locale %>"> <![endif]-->
5
+ <!--[if IE 9 ]> <html class="ie ie9" lang="<%= I18n.locale %>"> <![endif]-->
6
+ <!--[if gt IE 9]><!--><html lang="<%= I18n.locale %>"><!--<![endif]-->
7
+ <head data-hook="inside_head">
8
+ <%= render partial: 'spree/shared/head' %>
9
+ </head>
10
+ <body class="<%= body_class %>" id="<%= @body_id || 'default' %>" data-hook="body">
11
+
12
+ <div class="container">
13
+
14
+ <%= render partial: 'spree/shared/header' %>
15
+
16
+ <div id="wrapper" class="row" data-hook>
17
+
18
+ <%= taxon_breadcrumbs(@taxon) %>
19
+
20
+ <%= render partial: 'spree/shared/sidebar' if content_for? :sidebar %>
21
+
22
+ <div id="content" class="columns <%= !content_for?(:sidebar) ? "sixteen" : "twelve omega" %>" data-hook>
23
+ <%= flash_messages %>
24
+ <%= yield %>
25
+ </div>
26
+
27
+ <%= yield :templates %>
28
+
29
+ </div>
30
+
31
+ <%= render partial: 'spree/shared/footer' %>
32
+
33
+ </div>
34
+
35
+ </body>
36
+ </html>
@@ -0,0 +1,8 @@
1
+ <% if adjustments.sum(&:amount) != 0 %>
2
+ <tr class="adjustment">
3
+ <td colspan="4" align='right'><h5><%= type %>: <%= label %></h5></td>
4
+ <td colspan='2'>
5
+ <h5><%= Spree::Money.new(adjustments.sum(&:amount), currency: @order.currency) %></h5>
6
+ </td>
7
+ </tr>
8
+ <% end %>
@@ -0,0 +1,24 @@
1
+ <tbody id="cart_adjustments" data-hook>
2
+ <% if @order.line_item_adjustments.exists? %>
3
+ <% @order.line_item_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
4
+ <%= render "spree/orders/adjustment_row", label: label, adjustments: adjustments, type: t('spree.promotion') %>
5
+ <% end %>
6
+ <% end %>
7
+
8
+ <% @order.all_adjustments.tax.eligible.group_by(&:label).each do |label, adjustments| %>
9
+ <%= render "spree/orders/adjustment_row", label: label, adjustments: adjustments, type: t('spree.tax') %>
10
+ <% end %>
11
+
12
+ <% @order.shipments.each do |shipment| %>
13
+ <tr>
14
+ <td colspan="4" align='right'><h5><%= t('spree.shipping') %>: <%= shipment.shipping_method.name %></h5></td>
15
+ <td colspan='2'>
16
+ <h5><%= shipment.display_total_before_tax %></h5>
17
+ </td>
18
+ </tr>
19
+ <% end %>
20
+
21
+ <% @order.adjustments.eligible.group_by(&:label).each do |label, adjustments| %>
22
+ <%= render "spree/orders/adjustment_row", label: label, adjustments: adjustments, type: t('spree.adjustment') %>
23
+ <% end %>
24
+ </tbody>
@@ -0,0 +1,29 @@
1
+ <% order = order_form.object %>
2
+ <%= render 'spree/shared/error_messages', target: order %>
3
+ <table id="cart-detail" data-hook>
4
+ <thead>
5
+ <tr data-hook="cart_items_headers">
6
+ <th class="cart-item-description-header" colspan="2"><%= t('spree.item') %></th>
7
+ <th class="cart-item-price-header"><%= t('spree.price') %></th>
8
+ <th class="cart-item-quantity-header"><%= t('spree.qty') %></th>
9
+ <th class="cart-item-total-header"><%= t('spree.total') %></th>
10
+ <th class="cart-item-delete-header"></th>
11
+ </tr>
12
+ </thead>
13
+ <tbody id="line_items" data-hook>
14
+ <%= render partial: 'spree/orders/line_item', collection: order.line_items, locals: { order_form: order_form } %>
15
+ </tbody>
16
+ <% if order.adjustments.nonzero.exists? || order.line_item_adjustments.nonzero.exists? || order.shipment_adjustments.nonzero.exists? || order.shipments.any? %>
17
+ <tr class="cart-subtotal">
18
+ <td colspan="4" align='right'><h5><%= t('spree.cart_subtotal', count: order.line_items.sum(:quantity)) %></h5></th>
19
+ <td colspan><h5><%= order.display_item_total %></h5></td>
20
+ <td></td>
21
+ </tr>
22
+ <%= render "spree/orders/adjustments" %>
23
+ <% end %>
24
+ <tr class="cart-total">
25
+ <td colspan="4" align='right'><h5><%= t('spree.total') %></h5></td>
26
+ <td colspan><h5><%= order.display_total %></h5></td>
27
+ <td></td>
28
+ </tr>
29
+ </table>
@@ -0,0 +1,34 @@
1
+ <% variant = line_item.variant -%>
2
+ <%= order_form.fields_for :line_items, line_item do |item_form| -%>
3
+ <tr class="<%= cycle('', 'alt') %> line-item">
4
+ <td class="cart-item-image" data-hook="cart_item_image">
5
+ <%= link_to(render('spree/shared/image',
6
+ image: (variant.gallery.images.first || variant.product.gallery.images.first),
7
+ size: :small), variant.product) %>
8
+ </td>
9
+ <td class="cart-item-description" data-hook="cart_item_description">
10
+ <h4><%= link_to line_item.name, product_path(variant.product) %></h4>
11
+ <%= variant.options_text %>
12
+ <% if line_item.insufficient_stock? %>
13
+ <span class="out-of-stock">
14
+ <%= t('spree.out_of_stock') %>&nbsp;&nbsp;<br />
15
+ </span>
16
+ <% end %>
17
+ <span class="line-item-description" data-hook="line_item_description">
18
+ <%= line_item_description_text(line_item.description) %>
19
+ </span>
20
+ </td>
21
+ <td class="cart-item-price" data-hook="cart_item_price">
22
+ <%= line_item.single_money.to_html %>
23
+ </td>
24
+ <td class="cart-item-quantity" data-hook="cart_item_quantity">
25
+ <%= item_form.number_field :quantity, min: 0, class: "line_item_quantity", size: 5 %>
26
+ </td>
27
+ <td class="cart-item-total" data-hook="cart_item_total">
28
+ <%= line_item.display_amount.to_html unless line_item.quantity.nil? %>
29
+ </td>
30
+ <td class="cart-item-delete" data-hook="cart_item_delete">
31
+ <%= link_to image_tag('icons/delete.png'), '#', class: 'delete', id: "delete_#{dom_id(line_item)}" %>
32
+ </td>
33
+ </tr>
34
+ <% end -%>
@@ -0,0 +1,47 @@
1
+ <% @body_id = 'cart' %>
2
+ <div data-hook="cart_container">
3
+ <h1><%= t('spree.shopping_cart') %></h1>
4
+
5
+ <% if @order.line_items.empty? %>
6
+
7
+ <div data-hook="empty_cart">
8
+ <p><%= t('spree.your_cart_is_empty') %></p>
9
+ <p><%= link_to t('spree.continue_shopping'), products_path, class: 'button continue' %></p>
10
+ </div>
11
+
12
+ <% else %>
13
+
14
+ <div data-hook="outside_cart_form">
15
+ <%= form_for @order, url: update_cart_path, html: {id: 'update-cart'} do |order_form| %>
16
+ <div data-hook="inside_cart_form">
17
+
18
+ <div data-hook="cart_items">
19
+ <%= render 'form', order_form: order_form %>
20
+ </div>
21
+
22
+ <div class="links columns sixteen alpha omega" data-hook="cart_buttons">
23
+ <%= order_form.text_field :coupon_code, size: 10, placeholder: t('spree.coupon_code') %>
24
+ <%= button_tag class: 'primary', id: 'update-button' do %>
25
+ <%= t('spree.update') %>
26
+ <% end %>
27
+ <%= button_tag class: 'button checkout primary', id: 'checkout-link', name: 'checkout' do %>
28
+ <%= t('spree.checkout') %>
29
+ <% end %>
30
+ </div>
31
+
32
+ </div>
33
+ <% end %>
34
+ </div>
35
+
36
+ <div id="empty-cart" data-hook>
37
+ <%= form_tag empty_cart_path, method: :put do %>
38
+ <p id="clear_cart_link" data-hook>
39
+ <%= submit_tag t('spree.empty_cart'), class: 'button gray' %>
40
+ <%= t('spree.or') %>
41
+ <%= link_to t('spree.continue_shopping'), products_path, class: 'continue button gray' %>
42
+ </p>
43
+ <% end %>
44
+ </div>
45
+
46
+ <% end %>
47
+ </div>