solidus_frontend 2.1.1 → 2.2.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of solidus_frontend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +30 -0
- data/app/assets/config/solidus_frontend_manifest.js +6 -0
- data/app/assets/javascripts/spree/frontend/checkout/coupon-code.js.coffee +2 -2
- data/app/assets/javascripts/spree/frontend/checkout.js.coffee +8 -0
- data/app/assets/stylesheets/spree/frontend/screen.css.scss +18 -7
- data/app/controllers/spree/checkout_controller.rb +63 -21
- data/app/controllers/spree/orders_controller.rb +2 -2
- data/app/controllers/spree/products_controller.rb +2 -2
- data/app/controllers/spree/store_controller.rb +1 -1
- data/app/controllers/spree/taxons_controller.rb +1 -1
- data/app/models/spree/frontend_configuration.rb +3 -0
- data/app/views/spree/address/_form.html.erb +2 -2
- data/app/views/spree/checkout/_address.html.erb +4 -4
- data/app/views/spree/checkout/_confirm.html.erb +15 -2
- data/app/views/spree/checkout/_delivery.html.erb +2 -2
- data/app/views/spree/checkout/_payment.html.erb +14 -14
- data/app/views/spree/checkout/_terms_and_conditions.en.html.erb +1 -0
- data/app/views/spree/checkout/edit.html.erb +4 -4
- data/app/views/spree/checkout/existing_payment/_gateway.html.erb +9 -0
- data/app/views/spree/checkout/payment/_gateway.html.erb +8 -8
- data/app/views/spree/home/index.html.erb +2 -2
- data/app/views/spree/layouts/spree_application.html.erb +4 -4
- data/app/views/spree/orders/_adjustment_row.html.erb +1 -1
- data/app/views/spree/orders/_adjustments.html.erb +3 -3
- data/app/views/spree/orders/_form.html.erb +7 -6
- data/app/views/spree/orders/_line_item.html.erb +2 -2
- data/app/views/spree/orders/edit.html.erb +9 -9
- data/app/views/spree/orders/show.html.erb +4 -4
- data/app/views/spree/products/_cart_form.html.erb +3 -3
- data/app/views/spree/products/_properties.html.erb +1 -1
- data/app/views/spree/products/index.html.erb +4 -4
- data/app/views/spree/products/show.html.erb +6 -6
- data/app/views/spree/shared/_filters.html.erb +2 -2
- data/app/views/spree/shared/_head.html.erb +1 -1
- data/app/views/spree/shared/_header.html.erb +2 -2
- data/app/views/spree/shared/_main_nav_bar.html.erb +2 -2
- data/app/views/spree/shared/_nav_bar.html.erb +1 -1
- data/app/views/spree/shared/_order_details.html.erb +7 -7
- data/app/views/spree/shared/_search.html.erb +4 -4
- data/app/views/spree/shared/_taxonomies.html.erb +1 -1
- data/config/initializers/assets.rb +1 -8
- data/config/routes.rb +1 -1
- data/lib/generators/solidus/views/override_generator.rb +46 -0
- data/spec/controllers/spree/checkout_controller_spec.rb +5 -52
- data/spec/controllers/spree/orders_controller_spec.rb +3 -3
- data/spec/controllers/spree/orders_controller_transitions_spec.rb +1 -1
- data/spec/features/caching/products_spec.rb +0 -1
- data/spec/features/caching/taxons_spec.rb +0 -1
- data/spec/features/checkout_spec.rb +4 -3
- data/spec/generators/solidus/views/override_generator_spec.rb +47 -0
- metadata +12 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3848fb0f3afde34da5f91a456bc57bb61b4b4785
|
4
|
+
data.tar.gz: e6d1cf1dac916b4b2de89815736bf3d83ffbe470
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce6aea89fa22eedd9a168df53f32a217d02a0721ee1a70716b02bb184751766a55d45ec19b717c9d4a6e34a17204dafea0545dc3fe0685a55b773de444876d4c
|
7
|
+
data.tar.gz: 2b669c2dbac2c9a6a23cea1d5e1c1bc6707d5d150267ea6863e55eb442068758c8419fe0ff724c69b8600f09a8ee0235d9160867f6b08a2b969dae842cb96ef4
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,36 @@
|
|
2
2
|
|
3
3
|
Frontend contains controllers and views implementing a storefront and cart for Solidus.
|
4
4
|
|
5
|
+
## Override views
|
6
|
+
|
7
|
+
In order to customize a view you should copy the file into your host app. Using Deface is not
|
8
|
+
recommended as it provides lots of headaches while debugging and degrades your shops performance.
|
9
|
+
|
10
|
+
Solidus provides a generator to help with copying the right view into your host app.
|
11
|
+
|
12
|
+
Simply call the generator to copy all views into your host app.
|
13
|
+
|
14
|
+
```shell
|
15
|
+
$ bundle exec rails g solidus:views:override
|
16
|
+
```
|
17
|
+
|
18
|
+
If you only want to copy certain views into your host app, you can provide the `--only` argument:
|
19
|
+
|
20
|
+
```shell
|
21
|
+
$ bundle exec rails g solidus:views:override --only products/show
|
22
|
+
```
|
23
|
+
|
24
|
+
The argument to `--only` can also be a substring of the name of the view from the `app/views/spree` folder:
|
25
|
+
|
26
|
+
```shell
|
27
|
+
$ bundle exec rails g solidus:views:override --only product
|
28
|
+
```
|
29
|
+
|
30
|
+
This will copy all views whose directory or filename contains the string "product".
|
31
|
+
|
32
|
+
### Handle upgrades
|
33
|
+
|
34
|
+
After upgrading solidus to a new version run the generator again and follow on screen instructions.
|
5
35
|
|
6
36
|
## Testing
|
7
37
|
|
@@ -13,14 +13,14 @@ Spree.onCouponCodeApply = (e) ->
|
|
13
13
|
}
|
14
14
|
)
|
15
15
|
|
16
|
-
couponStatus.removeClass([successClass,errorClass].join(" "))
|
16
|
+
couponStatus.removeClass([successClass,errorClass].join(" "))
|
17
17
|
|
18
18
|
req = Spree.ajax
|
19
19
|
method: "PUT",
|
20
20
|
url: url
|
21
21
|
|
22
22
|
req.done (data) ->
|
23
|
-
window.location.reload()
|
23
|
+
window.location.reload()
|
24
24
|
couponCodeField.val('')
|
25
25
|
couponStatus.addClass(successClass).html("Coupon code applied successfully.")
|
26
26
|
|
@@ -7,3 +7,11 @@
|
|
7
7
|
Spree.disableSaveOnClick = ->
|
8
8
|
($ 'form.edit_order').submit ->
|
9
9
|
($ this).find(':submit, :image').attr('disabled', true).removeClass('primary').addClass 'disabled'
|
10
|
+
|
11
|
+
Spree.ready ($) ->
|
12
|
+
termsCheckbox = ($ '#accept_terms_and_conditions')
|
13
|
+
termsCheckbox.change( () ->
|
14
|
+
submitBtn = $(this.closest('form')).find(':submit')
|
15
|
+
submitBtn.prop('disabled', !this.checked)
|
16
|
+
submitBtn.toggleClass('disabled', !this.checked)
|
17
|
+
)
|
@@ -30,13 +30,6 @@ hr {
|
|
30
30
|
border-bottom: $default_border;
|
31
31
|
}
|
32
32
|
|
33
|
-
/* Custom text-selection colors (remove any text shadows: twitter.com/miketaylr/status/12228805301) */
|
34
|
-
::-moz-selection{background: $link_text_color; color: $layout_background_color; text-shadow: none;}
|
35
|
-
::selection {background: $link_text_color; color: $layout_background_color; text-shadow: none;}
|
36
|
-
|
37
|
-
/* j.mp/webkit-tap-highlight-color */
|
38
|
-
a:link {-webkit-tap-highlight-color: $link_text_color;}
|
39
|
-
|
40
33
|
ins {background-color: $link_text_color; color: $layout_background_color; text-decoration: none;}
|
41
34
|
mark {background-color: $link_text_color; color: $layout_background_color; font-style: italic; font-weight: bold;}
|
42
35
|
|
@@ -216,6 +209,16 @@ input[type= "reset"], button, a.button {
|
|
216
209
|
}
|
217
210
|
}
|
218
211
|
|
212
|
+
input[type=button],
|
213
|
+
input[type=submit],
|
214
|
+
button {
|
215
|
+
&.disabled {
|
216
|
+
background:#ccc;
|
217
|
+
border-color: #ccc;
|
218
|
+
text-shadow:none;
|
219
|
+
}
|
220
|
+
}
|
221
|
+
|
219
222
|
input[type="checkbox"], label {
|
220
223
|
vertical-align: middle;
|
221
224
|
}
|
@@ -925,6 +928,14 @@ p[data-hook="use_billing"] {
|
|
925
928
|
}
|
926
929
|
}
|
927
930
|
|
931
|
+
.terms_and_conditions {
|
932
|
+
.policy {
|
933
|
+
height: 100px;
|
934
|
+
width: 100%;
|
935
|
+
overflow: scroll;
|
936
|
+
}
|
937
|
+
}
|
938
|
+
|
928
939
|
/*--------------------------------------*/
|
929
940
|
/* Cart
|
930
941
|
/*--------------------------------------*/
|
@@ -25,26 +25,22 @@ module Spree
|
|
25
25
|
|
26
26
|
# Updates the order and advances to the next state (when possible.)
|
27
27
|
def update
|
28
|
-
if
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
if !success
|
36
|
-
flash[:error] = @order.errors.full_messages.join("\n")
|
37
|
-
redirect_to(checkout_state_path(@order.state)) && return
|
28
|
+
if update_order
|
29
|
+
|
30
|
+
assign_temp_address
|
31
|
+
|
32
|
+
unless transition_forward
|
33
|
+
redirect_on_failure
|
34
|
+
return
|
38
35
|
end
|
39
36
|
|
37
|
+
|
40
38
|
if @order.completed?
|
41
|
-
|
42
|
-
flash.notice = Spree.t(:order_processed_successfully)
|
43
|
-
flash['order_completed'] = true
|
44
|
-
redirect_to completion_route
|
39
|
+
finalize_order
|
45
40
|
else
|
46
|
-
|
41
|
+
send_to_next_state
|
47
42
|
end
|
43
|
+
|
48
44
|
else
|
49
45
|
render :edit
|
50
46
|
end
|
@@ -52,6 +48,42 @@ module Spree
|
|
52
48
|
|
53
49
|
private
|
54
50
|
|
51
|
+
def update_order
|
52
|
+
OrderUpdateAttributes.new(@order, update_params, request_env: request.headers.env).apply
|
53
|
+
end
|
54
|
+
|
55
|
+
def assign_temp_address
|
56
|
+
@order.temporary_address = !params[:save_user_address]
|
57
|
+
end
|
58
|
+
|
59
|
+
def redirect_on_failure
|
60
|
+
flash[:error] = @order.errors.full_messages.join("\n")
|
61
|
+
redirect_to(checkout_state_path(@order.state))
|
62
|
+
end
|
63
|
+
|
64
|
+
def transition_forward
|
65
|
+
if @order.confirm?
|
66
|
+
@order.complete
|
67
|
+
else
|
68
|
+
@order.next
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def finalize_order
|
73
|
+
@current_order = nil
|
74
|
+
set_successful_flash_notice
|
75
|
+
redirect_to completion_route
|
76
|
+
end
|
77
|
+
|
78
|
+
def set_successful_flash_notice
|
79
|
+
flash.notice = Spree.t(:order_processed_successfully)
|
80
|
+
flash['order_completed'] = true
|
81
|
+
end
|
82
|
+
|
83
|
+
def send_to_next_state
|
84
|
+
redirect_to checkout_state_path(@order.state)
|
85
|
+
end
|
86
|
+
|
55
87
|
def update_params
|
56
88
|
if update_params = massaged_params[:order]
|
57
89
|
update_params.permit(permitted_checkout_attributes)
|
@@ -65,7 +97,11 @@ module Spree
|
|
65
97
|
massaged_params = params.deep_dup
|
66
98
|
|
67
99
|
move_payment_source_into_payments_attributes(massaged_params)
|
68
|
-
|
100
|
+
if massaged_params[:order] && massaged_params[:order][:existing_card].present?
|
101
|
+
Spree::Deprecation.warn("Passing order[:existing_card] is deprecated. Send order[:wallet_payment_source_id] instead.", caller)
|
102
|
+
move_existing_card_into_payments_attributes(massaged_params) # deprecated
|
103
|
+
end
|
104
|
+
move_wallet_payment_source_id_into_payments_attributes(massaged_params)
|
69
105
|
set_payment_parameters_amount(massaged_params, @order)
|
70
106
|
|
71
107
|
massaged_params
|
@@ -74,7 +110,7 @@ module Spree
|
|
74
110
|
def ensure_valid_state
|
75
111
|
unless skip_state_validation?
|
76
112
|
if (params[:state] && !@order.has_checkout_step?(params[:state])) ||
|
77
|
-
|
113
|
+
(!params[:state] && !@order.has_checkout_step?(@order.state))
|
78
114
|
@order.state = 'cart'
|
79
115
|
redirect_to checkout_state_path(@order.checkout_steps.first)
|
80
116
|
end
|
@@ -118,7 +154,8 @@ module Spree
|
|
118
154
|
|
119
155
|
def ensure_sufficient_stock_lines
|
120
156
|
if @order.insufficient_stock_lines.present?
|
121
|
-
|
157
|
+
out_of_stock_items = @order.insufficient_stock_lines.collect(&:name).to_sentence
|
158
|
+
flash[:error] = Spree.t(:inventory_error_flash_for_insufficient_quantity, names: out_of_stock_items)
|
122
159
|
redirect_to spree.cart_path
|
123
160
|
end
|
124
161
|
end
|
@@ -136,7 +173,7 @@ module Spree
|
|
136
173
|
def before_address
|
137
174
|
# if the user has a default address, a callback takes care of setting
|
138
175
|
# that; but if he doesn't, we need to build an empty one here
|
139
|
-
default = {
|
176
|
+
default = {country_id: Spree::Country.default.id}
|
140
177
|
@order.build_bill_address(default) unless @order.bill_address
|
141
178
|
@order.build_ship_address(default) if @order.checkout_steps.include?('delivery') && !@order.ship_address
|
142
179
|
end
|
@@ -157,8 +194,13 @@ module Spree
|
|
157
194
|
end
|
158
195
|
end
|
159
196
|
|
160
|
-
if try_spree_current_user && try_spree_current_user.respond_to?(:
|
161
|
-
@
|
197
|
+
if try_spree_current_user && try_spree_current_user.respond_to?(:wallet)
|
198
|
+
@wallet_payment_sources = try_spree_current_user.wallet.wallet_payment_sources
|
199
|
+
@default_wallet_payment_source = @wallet_payment_sources.detect(&:default) ||
|
200
|
+
@wallet_payment_sources.first
|
201
|
+
# TODO: How can we deprecate this instance variable? We could try
|
202
|
+
# wrapping it in a delegating object that produces deprecation warnings.
|
203
|
+
@payment_sources = try_spree_current_user.wallet.wallet_payment_sources.map(&:payment_source).select { |ps| ps.is_a?(Spree::CreditCard) }
|
162
204
|
end
|
163
205
|
end
|
164
206
|
|
@@ -13,7 +13,7 @@ module Spree
|
|
13
13
|
skip_before_action :verify_authenticity_token, only: [:populate]
|
14
14
|
|
15
15
|
def show
|
16
|
-
@order = Order.find_by_number!(params[:id])
|
16
|
+
@order = Spree::Order.find_by_number!(params[:id])
|
17
17
|
end
|
18
18
|
|
19
19
|
def update
|
@@ -36,7 +36,7 @@ module Spree
|
|
36
36
|
|
37
37
|
# Shows the current incomplete order from the session
|
38
38
|
def edit
|
39
|
-
@order = current_order || Order.incomplete.find_or_initialize_by(guest_token: cookies.signed[:guest_token])
|
39
|
+
@order = current_order || Spree::Order.incomplete.find_or_initialize_by(guest_token: cookies.signed[:guest_token])
|
40
40
|
associate_user
|
41
41
|
end
|
42
42
|
|
@@ -37,9 +37,9 @@ module Spree
|
|
37
37
|
|
38
38
|
def load_product
|
39
39
|
if try_spree_current_user.try(:has_spree_role?, "admin")
|
40
|
-
@products = Product.with_deleted
|
40
|
+
@products = Spree::Product.with_deleted
|
41
41
|
else
|
42
|
-
@products = Product.available
|
42
|
+
@products = Spree::Product.available
|
43
43
|
end
|
44
44
|
@product = @products.friendly.find(params[:id])
|
45
45
|
end
|
@@ -1,5 +1,8 @@
|
|
1
1
|
module Spree
|
2
2
|
class FrontendConfiguration < Preferences::Configuration
|
3
3
|
preference :locale, :string, default: Rails.application.config.i18n.default_locale
|
4
|
+
|
5
|
+
# Add your terms and conditions in app/views/spree/checkout/_terms_and_conditions.en.html.erb
|
6
|
+
preference :require_terms_and_conditions_acceptance, :boolean, default: false
|
4
7
|
end
|
5
8
|
end
|
@@ -51,7 +51,7 @@
|
|
51
51
|
<%=
|
52
52
|
form.collection_select(
|
53
53
|
:state_id, address.country.states, :id, :name,
|
54
|
-
{:
|
54
|
+
{include_blank: true},
|
55
55
|
{
|
56
56
|
class: have_states ? 'required' : '',
|
57
57
|
style: have_states ? '' : 'display: none;',
|
@@ -70,7 +70,7 @@
|
|
70
70
|
%>
|
71
71
|
</span>
|
72
72
|
<noscript>
|
73
|
-
<%= form.text_field :state_name, :
|
73
|
+
<%= form.text_field :state_name, class: 'required', autocomplete: address_type + ' address-level1' %>
|
74
74
|
</noscript>
|
75
75
|
</p>
|
76
76
|
<% end %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<fieldset id="billing" data-hook>
|
3
3
|
<%= form.fields_for :bill_address do |bill_form| %>
|
4
4
|
<legend align="center"><%= Spree.t(:billing_address) %></legend>
|
5
|
-
<%= render :
|
5
|
+
<%= render partial: 'spree/address/form', locals: { form: bill_form, address_type: 'billing', address: @order.bill_address } %>
|
6
6
|
<% end %>
|
7
7
|
</fieldset>
|
8
8
|
</div>
|
@@ -13,16 +13,16 @@
|
|
13
13
|
<legend align="center"><%= Spree.t(:shipping_address) %></legend>
|
14
14
|
<p class="field checkbox" data-hook="use_billing">
|
15
15
|
<%= check_box_tag 'order[use_billing]', '1', @order.shipping_eq_billing_address? %>
|
16
|
-
<%= label_tag :order_use_billing, Spree.t(:use_billing_address), :
|
16
|
+
<%= label_tag :order_use_billing, Spree.t(:use_billing_address), id: 'use_billing' %>
|
17
17
|
</p>
|
18
|
-
<%= render :
|
18
|
+
<%= render partial: 'spree/address/form', locals: { form: ship_form, address_type: 'shipping', address: @order.ship_address } %>
|
19
19
|
<% end %>
|
20
20
|
</fieldset>
|
21
21
|
</div>
|
22
22
|
<hr class="clear" />
|
23
23
|
|
24
24
|
<div class="form-buttons" data-hook="buttons">
|
25
|
-
<%= submit_tag Spree.t(:save_and_continue), :
|
25
|
+
<%= submit_tag Spree.t(:save_and_continue), class: 'continue button primary' %>
|
26
26
|
<% if try_spree_current_user %>
|
27
27
|
<span data-hook="save_user_address">
|
28
28
|
|
@@ -1,12 +1,25 @@
|
|
1
1
|
<fieldset id="order_details" data-hook>
|
2
2
|
<div class="clear"></div>
|
3
3
|
<legend align="center"><%= Spree.t(:confirm) %></legend>
|
4
|
-
<%= render :
|
4
|
+
<%= render partial: 'spree/shared/order_details', locals: { order: @order } %>
|
5
5
|
</fieldset>
|
6
6
|
|
7
7
|
<br />
|
8
8
|
|
9
9
|
<div class="form-buttons" data-hook="buttons">
|
10
|
-
|
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, Spree.t(:agree_to_terms_of_service) %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<%= submit_tag Spree.t(:place_order),
|
20
|
+
disabled: requires_acceptance,
|
21
|
+
class: "continue button primary #{ 'disabled' if requires_acceptance }" %>
|
22
|
+
<% end %>
|
23
|
+
|
11
24
|
<script>Spree.disableSaveOnClick();</script>
|
12
25
|
</div>
|
@@ -87,7 +87,7 @@
|
|
87
87
|
<% if Spree::Config[:shipping_instructions] %>
|
88
88
|
<p id="minstrs" data-hook>
|
89
89
|
<%= form.label :special_instructions, Spree.t(:shipping_instructions) %><br />
|
90
|
-
<%= form.text_area :special_instructions, :
|
90
|
+
<%= form.text_area :special_instructions, cols: 40, rows: 7 %>
|
91
91
|
</p>
|
92
92
|
<% end %>
|
93
93
|
</div>
|
@@ -96,5 +96,5 @@
|
|
96
96
|
<br />
|
97
97
|
|
98
98
|
<div class="form-buttons" data-hook="buttons">
|
99
|
-
<%= submit_tag Spree.t(:save_and_continue), :
|
99
|
+
<%= submit_tag Spree.t(:save_and_continue), class: 'continue button primary' %>
|
100
100
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<fieldset id="payment" data-hook>
|
2
2
|
<legend align="center"><%= Spree.t(:payment_information) %></legend>
|
3
3
|
<div data-hook="checkout_payment_step">
|
4
|
-
<% if @
|
4
|
+
<% if @wallet_payment_sources.present? %>
|
5
5
|
<div class="card_options">
|
6
6
|
<%= radio_button_tag 'use_existing_card', 'yes', true %>
|
7
7
|
<label for="use_existing_card_yes">
|
@@ -18,16 +18,16 @@
|
|
18
18
|
<p class="field" data-hook="existing_cards">
|
19
19
|
<table class="existing-credit-card-list">
|
20
20
|
<tbody>
|
21
|
-
<% @
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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.method_type}",
|
25
|
+
locals: {
|
26
|
+
wallet_payment_source: wallet_payment_source,
|
27
|
+
default: wallet_payment_source == @default_wallet_payment_source,
|
28
|
+
}
|
29
|
+
)
|
30
|
+
%>
|
31
31
|
<% end %>
|
32
32
|
</tbody>
|
33
33
|
</table>
|
@@ -40,7 +40,7 @@
|
|
40
40
|
<p>
|
41
41
|
<label>
|
42
42
|
<%= radio_button_tag "order[payments_attributes][][payment_method_id]", method.id, method == @order.available_payment_methods.first %>
|
43
|
-
<%= Spree.t(method.name, :
|
43
|
+
<%= Spree.t(method.name, scope: :payment_methods, default: method.name) %>
|
44
44
|
</label>
|
45
45
|
</p>
|
46
46
|
<% end %>
|
@@ -50,7 +50,7 @@
|
|
50
50
|
<% @order.available_payment_methods.each do |method| %>
|
51
51
|
<li id="payment_method_<%= method.id %>" class="<%= 'last' if method == @order.available_payment_methods.last %>" data-hook>
|
52
52
|
<fieldset>
|
53
|
-
<%= render :
|
53
|
+
<%= render partial: "spree/checkout/payment/#{method.method_type}", locals: { payment_method: method } %>
|
54
54
|
</fieldset>
|
55
55
|
</li>
|
56
56
|
<% end %>
|
@@ -72,6 +72,6 @@
|
|
72
72
|
<br class="space" />
|
73
73
|
|
74
74
|
<div class="form-buttons" data-hook="buttons">
|
75
|
-
<%= submit_tag Spree.t(:save_and_continue), :
|
75
|
+
<%= submit_tag Spree.t(:save_and_continue), class: 'continue button primary' %>
|
76
76
|
<script>Spree.disableSaveOnClick();</script>
|
77
77
|
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
Put your terms and conditions here
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div id="checkout" data-hook>
|
2
|
-
<%= render :
|
2
|
+
<%= render partial: 'spree/shared/error_messages', locals: { target: @order } %>
|
3
3
|
|
4
4
|
<div class="row" data-hook="checkout_header">
|
5
5
|
<h1 class="columns three alpha" data-hook="checkout_title"><%= Spree.t(:checkout) %></h1>
|
@@ -8,19 +8,19 @@
|
|
8
8
|
|
9
9
|
<div class="row" data-hook="checkout_content">
|
10
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, :
|
11
|
+
<%= form_for @order, url: update_checkout_path(@order.state), html: { id: "checkout_form_#{@order.state}" } do |form| %>
|
12
12
|
<% if @order.state == 'address' || !@order.email? %>
|
13
13
|
<p class="field" style='clear: both'>
|
14
14
|
<%= form.label :email %><br />
|
15
15
|
<%= form.text_field :email %>
|
16
16
|
</p>
|
17
17
|
<% end %>
|
18
|
-
<%= render @order.state, :
|
18
|
+
<%= render @order.state, form: form %>
|
19
19
|
<% end %>
|
20
20
|
</div>
|
21
21
|
<% if @order.state != 'confirm' %>
|
22
22
|
<div id="checkout-summary" data-hook="checkout_summary_box" class="columns omega four">
|
23
|
-
<%= render :
|
23
|
+
<%= render partial: 'summary', locals: { order: @order } %>
|
24
24
|
</div>
|
25
25
|
<% end %>
|
26
26
|
</div>
|
@@ -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>
|
@@ -1,14 +1,14 @@
|
|
1
|
-
<%= image_tag 'credit_cards/credit_card.gif', :
|
1
|
+
<%= image_tag 'credit_cards/credit_card.gif', id: 'credit-card-image' %>
|
2
2
|
<% param_prefix = "payment_source[#{payment_method.id}]" %>
|
3
3
|
|
4
4
|
<p class="field">
|
5
5
|
<%= label_tag "name_on_card_#{payment_method.id}", Spree.t(:name_on_card) %><span class="required">*</span><br />
|
6
|
-
<%= text_field_tag "#{param_prefix}[name]", "#{@order.billing_firstname} #{@order.billing_lastname}", { id: "name_on_card_#{payment_method.id}", :
|
6
|
+
<%= text_field_tag "#{param_prefix}[name]", "#{@order.billing_firstname} #{@order.billing_lastname}", { id: "name_on_card_#{payment_method.id}", autocomplete: "cc-name" } %>
|
7
7
|
</p>
|
8
8
|
|
9
9
|
<p class="field" data-hook="card_number">
|
10
10
|
<%= label_tag "card_number", Spree.t(:card_number) %><span class="required">*</span><br />
|
11
|
-
<%= text_field_tag "#{param_prefix}[number]", '', {:
|
11
|
+
<%= text_field_tag "#{param_prefix}[number]", '', {id: 'card_number', class: 'required cardNumber', size: 19, maxlength: 19, autocomplete: "cc-number", type: "tel"} %>
|
12
12
|
|
13
13
|
<span id="card_type" style="display:none;">
|
14
14
|
( <span id="looks_like" ><%= Spree.t(:card_type_is) %> <span id="type"></span></span>
|
@@ -19,19 +19,19 @@
|
|
19
19
|
|
20
20
|
<p class="field" data-hook="card_expiration">
|
21
21
|
<%= label_tag "card_expiry", Spree.t(:expiration) %><span class="required">*</span><br />
|
22
|
-
<%= text_field_tag "#{param_prefix}[expiry]", '', :
|
22
|
+
<%= text_field_tag "#{param_prefix}[expiry]", '', id: 'card_expiry', class: "required cardExpiry", placeholder: "MM / YY", type: "tel" %>
|
23
23
|
</p>
|
24
24
|
|
25
25
|
<p class="field" data-hook="card_code">
|
26
26
|
<%= label_tag "card_code", Spree.t(:card_code) %><span class="required">*</span><br />
|
27
|
-
<%= text_field_tag "#{param_prefix}[verification_value]", '', {:
|
28
|
-
<%= link_to "(#{Spree.t(:what_is_this)})", spree.cvv_path, :
|
27
|
+
<%= text_field_tag "#{param_prefix}[verification_value]", '', {id: 'card_code', class: 'required cardCode', size: 5, type: "tel", autocomplete: "off"} %>
|
28
|
+
<%= link_to "(#{Spree.t(:what_is_this)})", spree.cvv_path, target: '_blank', "data-hook" => "cvv_link", id: "cvv_link" %>
|
29
29
|
</p>
|
30
30
|
|
31
31
|
<% if @order.bill_address %>
|
32
32
|
<%= fields_for "#{param_prefix}[address_attributes]", @order.bill_address do |f| %>
|
33
|
-
<%= render :
|
33
|
+
<%= render partial: 'spree/address/form_hidden', locals: { form: f } %>
|
34
34
|
<% end %>
|
35
35
|
<% end %>
|
36
36
|
|
37
|
-
<%= hidden_field_tag "#{param_prefix}[cc_type]", '', :
|
37
|
+
<%= hidden_field_tag "#{param_prefix}[cc_type]", '', id: "cc_type", class: 'ccType' %>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
<% content_for :sidebar do %>
|
2
2
|
<div data-hook="homepage_sidebar_navigation">
|
3
|
-
<%= render :
|
3
|
+
<%= render partial: 'spree/shared/taxonomies' %>
|
4
4
|
</div>
|
5
5
|
<% end %>
|
6
6
|
|
7
7
|
<div data-hook="homepage_products">
|
8
8
|
<% cache(cache_key_for_products) do %>
|
9
|
-
<%= render :
|
9
|
+
<%= render partial: 'spree/shared/products', locals: { products: @products } %>
|
10
10
|
<% end %>
|
11
11
|
</div>
|
12
12
|
|
@@ -5,19 +5,19 @@
|
|
5
5
|
<!--[if IE 9 ]> <html class="ie ie9" lang="<%= I18n.locale %>"> <![endif]-->
|
6
6
|
<!--[if gt IE 9]><!--><html lang="<%= I18n.locale %>"><!--<![endif]-->
|
7
7
|
<head data-hook="inside_head">
|
8
|
-
<%= render :
|
8
|
+
<%= render partial: 'spree/shared/head' %>
|
9
9
|
</head>
|
10
10
|
<body class="<%= body_class %>" id="<%= @body_id || 'default' %>" data-hook="body">
|
11
11
|
|
12
12
|
<div class="container">
|
13
13
|
|
14
|
-
<%= render :
|
14
|
+
<%= render partial: 'spree/shared/header' %>
|
15
15
|
|
16
16
|
<div id="wrapper" class="row" data-hook>
|
17
17
|
|
18
18
|
<%= taxon_breadcrumbs(@taxon) %>
|
19
19
|
|
20
|
-
<%= render :
|
20
|
+
<%= render partial: 'spree/shared/sidebar' if content_for? :sidebar %>
|
21
21
|
|
22
22
|
<div id="content" class="columns <%= !content_for?(:sidebar) ? "sixteen" : "twelve omega" %>" data-hook>
|
23
23
|
<%= flash_messages %>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
</div>
|
30
30
|
|
31
|
-
<%= render :
|
31
|
+
<%= render partial: 'spree/shared/footer' %>
|
32
32
|
|
33
33
|
</div>
|
34
34
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<tr class="adjustment">
|
3
3
|
<td colspan="4" align='right'><h5><%= type %>: <%= label %></h5></td>
|
4
4
|
<td colspan='2'>
|
5
|
-
<h5><%= Spree::Money.new(adjustments.sum(&:amount), :
|
5
|
+
<h5><%= Spree::Money.new(adjustments.sum(&:amount), currency: @order.currency) %></h5>
|
6
6
|
</td>
|
7
7
|
</tr>
|
8
8
|
<% end %>
|