caboose-cms 0.5.73 → 0.5.74
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/controllers/caboose/checkout_controller.rb +2 -7
- data/app/models/caboose/order.rb +9 -0
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjNhNjFkMzlmZjgwYzQ1NWVmNzNkNmUwZGI5OGU0ODNkMjViOGFjZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Zjg4MmMxOWEwMGRkNjRjYzM1NGY3YTQ1N2RjODRkNzU4NzEwODJmYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjZhYmQzYjgyNGJlMGQ3ZmE2YzY2ZTMyNjY4YTUyY2YyN2RkNjFlYWUzZGI4
|
10
|
+
OWJmZWUwZTBjZjk3ZjVmNmNjODhmMjQyM2VmOTAzZmE4MjEzNTRkYzViNzI5
|
11
|
+
ZGZjNTg2ZWVmMGQ0MGY3ZjEzMzhmN2Q5ZWZiNTQyNGViNDgxOTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2JkZWJkZTc4NDEwMTVkNjEyODJkM2Q0NzRlN2RlNTZlZDFkMTEzN2RlOTUw
|
14
|
+
Mjc0YzFhZDAzODdlMjg1OTk4MmVhZjA5NTkxNTI1NmEzYjRlOGExYzcwNzdi
|
15
|
+
NWQ0NmQ3NmRmODlkOWYxOTc2ODVmMzMxZDZhNjY3ZjAyYzZkNDk=
|
@@ -52,7 +52,7 @@ module Caboose
|
|
52
52
|
def gift_cards
|
53
53
|
redirect_to '/checkout' and return if !logged_in?
|
54
54
|
redirect_to '/checkout/addresses' and return if @order.shipping_address.nil? || @order.billing_address.nil?
|
55
|
-
redirect_to '/checkout/shipping' and return if @order.
|
55
|
+
redirect_to '/checkout/shipping' and return if @order.has_empty_shipping_methods?
|
56
56
|
end
|
57
57
|
|
58
58
|
# Step 5 - Payment
|
@@ -60,7 +60,7 @@ module Caboose
|
|
60
60
|
def payment
|
61
61
|
redirect_to '/checkout' and return if !logged_in?
|
62
62
|
redirect_to '/checkout/addresses' and return if @order.shipping_address.nil? || @order.billing_address.nil?
|
63
|
-
redirect_to '/checkout/shipping' and return if @order.
|
63
|
+
redirect_to '/checkout/shipping' and return if @order.has_empty_shipping_methods?
|
64
64
|
|
65
65
|
# Make sure all the variants still exist
|
66
66
|
@order.line_items.each do |li|
|
@@ -188,11 +188,6 @@ module Caboose
|
|
188
188
|
render :json => resp
|
189
189
|
end
|
190
190
|
|
191
|
-
## GET /checkout/shipping
|
192
|
-
#def shipping
|
193
|
-
# render :json => { :rates => ShippingCalculator.rates(@order), :selected_rate => ShippingCalculator.rate(@order) }
|
194
|
-
#end
|
195
|
-
|
196
191
|
# PUT /checkout/shipping
|
197
192
|
def update_shipping
|
198
193
|
op = OrderPackage.find(params[:order_package_id])
|
data/app/models/caboose/order.rb
CHANGED
@@ -227,6 +227,15 @@ module Caboose
|
|
227
227
|
gc.save
|
228
228
|
end
|
229
229
|
end
|
230
|
+
|
231
|
+
def has_empty_shipping_methods?
|
232
|
+
return true if self.order_packages.nil?
|
233
|
+
return true if self.order_packages.count == 0
|
234
|
+
self.order_packages.each do |op|
|
235
|
+
return true if op.shipping_method_id.nil?
|
236
|
+
end
|
237
|
+
return false
|
238
|
+
end
|
230
239
|
end
|
231
240
|
end
|
232
241
|
|
data/lib/caboose/version.rb
CHANGED