spree_frontend 2.3.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4620d155a39c6395e1fc0c3783d5d07e72b9b1a2
4
- data.tar.gz: 4492bb79bf2fe1ecc1ab34b4af769dc3e52f24b2
3
+ metadata.gz: d7412331db6132df41984568e7e0f570dfdfa161
4
+ data.tar.gz: a25f129f8b1ba8c7a49f05525814d013b7ad19bc
5
5
  SHA512:
6
- metadata.gz: fd5395dfc6401d5f6f1865abc2f2b95419d97dc71d57934256bff116bac1b15b21b7e3c44b73a9ab3b8bb267ca542621bd6ccfad7e5c549a03fc5cb1d19317cc
7
- data.tar.gz: 6b6a3a89944d2ab4efe406e1edf8039cd872a9af5e35f484964c73e4154466dcade27c1e78fc610779d8732fc13db8557c9184844f7835afb14cbc765a9d7331
6
+ metadata.gz: a6233061c39a311f8c8dc115ed81ed95413201617f1fa308187a512f559e36df2bce6b56cefd8d1a34a5e5a31a097e626cd3b55dedfa87f45e0149841d801842
7
+ data.tar.gz: 7c0a9463e53495a6565f8cc5e27c74b791263b374b199c250c3c43da5563f8c8284b99b59c676b1aef4a9a8bd8a27cfdae95bfda159eebbacbdbe968a072ac65
@@ -26,7 +26,7 @@ module Spree
26
26
  # Updates the order and advances to the next state (when possible.)
27
27
  def update
28
28
  if @order.update_from_params(params, permitted_checkout_attributes, request.headers.env)
29
- persist_user_address
29
+ @order.temporary_address = !params[:save_user_address]
30
30
  unless @order.next
31
31
  flash[:error] = @order.errors.full_messages.join("\n")
32
32
  redirect_to checkout_state_path(@order.state) and return
@@ -35,7 +35,7 @@ module Spree
35
35
  if @order.completed?
36
36
  @current_order = nil
37
37
  flash.notice = Spree.t(:order_processed_successfully)
38
- flash[:order_completed] = true
38
+ flash['order_completed'] = true
39
39
  redirect_to completion_route
40
40
  else
41
41
  redirect_to checkout_state_path(@order.state)
@@ -106,14 +106,11 @@ module Spree
106
106
  send(method_name) if respond_to?(method_name, true)
107
107
  end
108
108
 
109
- # Skip setting ship address if order doesn't have a delivery checkout step
110
- # to avoid triggering validations on shipping address
111
109
  def before_address
112
- @order.bill_address ||= Address.default(try_spree_current_user, "bill")
113
-
114
- if @order.checkout_steps.include? "delivery"
115
- @order.ship_address ||= Address.default(try_spree_current_user, "ship")
116
- end
110
+ # if the user has a default address, a callback takes care of setting
111
+ # that; but if he doesn't, we need to build an empty one here
112
+ @order.bill_address ||= Address.build_default
113
+ @order.ship_address ||= Address.build_default if @order.checkout_steps.include?('delivery')
117
114
  end
118
115
 
119
116
  def before_delivery
@@ -146,13 +143,5 @@ module Spree
146
143
  def check_authorization
147
144
  authorize!(:edit, current_order, cookies.signed[:guest_token])
148
145
  end
149
-
150
- def persist_user_address
151
- if @order.checkout_steps.include? "address"
152
- if @order.address? && try_spree_current_user.respond_to?(:persist_order_address)
153
- try_spree_current_user.persist_order_address(@order) if params[:save_user_address]
154
- end
155
- end
156
- end
157
146
  end
158
147
  end
@@ -37,23 +37,19 @@ module Spree
37
37
  def edit
38
38
  @order = current_order || Order.new
39
39
  associate_user
40
- if stale?(current_order)
41
- respond_with(current_order)
42
- end
43
40
  end
44
41
 
45
42
  # Adds a new item to the order (creating a new order if none already exists)
46
43
  def populate
47
44
  populator = Spree::OrderPopulator.new(current_order(create_order_if_necessary: true), current_currency)
48
- if populator.populate(params[:variant_id], params[:quantity])
49
- current_order.ensure_updated_shipments
50
45
 
46
+ if populator.populate(params[:variant_id], params[:quantity])
51
47
  respond_with(@order) do |format|
52
48
  format.html { redirect_to cart_path }
53
49
  end
54
50
  else
55
51
  flash[:error] = populator.errors.full_messages.join(" ")
56
- redirect_to :back
52
+ redirect_back_or_default(spree.root_path)
57
53
  end
58
54
  end
59
55
 
@@ -7,7 +7,7 @@
7
7
  <ul>
8
8
  <% @product.variants_and_option_values(current_currency).each_with_index do |variant, index| %>
9
9
  <li>
10
- <%= radio_button_tag "variant_id", variant.id, index == 0, 'data-price' => Spree::Money.new(variant.price, currency: current_currency, with_currency: true).to_s %>
10
+ <%= radio_button_tag "variant_id", variant.id, index == 0, 'data-price' => variant.price_in(current_currency).money %>
11
11
  <%= label_tag "variant_id_#{ variant.id }" do %>
12
12
  <span class="variant-description">
13
13
  <%= variant_options variant %>
@@ -6,9 +6,10 @@
6
6
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
7
7
 
8
8
  ga('create', '<%= tracker.analytics_id %>','<%= current_store.url.sub(/(^www.)?/,'') %>');
9
+ ga('require', 'displayfeatures');
9
10
  ga('send', 'pageview');
10
11
 
11
- <% if order_just_completed?(@order) %>
12
+ <% if @order && order_just_completed?(@order) %>
12
13
  <%# more info: https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce %>
13
14
  ga('require', 'ecommerce', 'ecommerce.js');
14
15
  ga('ecommerce:addTransaction', {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-01 00:00:00.000000000 Z
11
+ date: 2014-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_api
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.3.1
19
+ version: 2.3.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.3.1
26
+ version: 2.3.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.3.1
33
+ version: 2.3.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 2.3.1
40
+ version: 2.3.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: canonical-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -56,14 +56,14 @@ dependencies:
56
56
  name: jquery-rails
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
61
  version: 3.1.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - '='
67
67
  - !ruby/object:Gem::Version
68
68
  version: 3.1.0
69
69
  - !ruby/object:Gem::Dependency