radiant-shop-extension 0.92.3 → 0.92.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/shop/controllers/application_controller.rb +12 -11
- data/lib/shop/models/form_extension.rb +9 -11
- data/radiant-shop-extension.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.92.
|
1
|
+
0.92.6
|
@@ -11,21 +11,22 @@ module Shop
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def find_shop_order
|
14
|
-
|
15
|
-
ShopOrder.find_by_session(request.session[:shop_order])
|
16
|
-
rescue
|
17
|
-
nil
|
18
|
-
end
|
14
|
+
ShopOrder.find_by_session(request.session[:shop_order])
|
19
15
|
end
|
20
16
|
|
21
17
|
def find_or_create_shop_order
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
request.session[:shop_order] =
|
27
|
-
|
18
|
+
begin
|
19
|
+
@order = find_shop_order
|
20
|
+
rescue
|
21
|
+
@order = ShopOrder.create
|
22
|
+
request.session[:shop_order] = @order.id
|
23
|
+
end
|
24
|
+
|
25
|
+
if current_user
|
26
|
+
@order.update_attribute(:customer_id, (current_user.id))
|
28
27
|
end
|
28
|
+
|
29
|
+
@order
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
@@ -6,25 +6,23 @@ module Shop
|
|
6
6
|
base.class_eval do
|
7
7
|
# Uses the page session data to find the current order
|
8
8
|
def find_current_order
|
9
|
-
|
10
|
-
@order.update_attribute(:customer_id, (current_customer.id rescue nil)) # either assign it to a user, or don't
|
9
|
+
ShopOrder.find_by_session(@page.request.session[:shop_order])
|
11
10
|
end
|
12
|
-
|
11
|
+
|
13
12
|
# Uses the page session data to find or create the current order
|
14
13
|
def find_or_create_current_order
|
15
14
|
begin
|
16
|
-
find_current_order
|
15
|
+
@order = find_current_order
|
17
16
|
rescue
|
18
17
|
@order = ShopOrder.create
|
19
18
|
@result[:session] = { :shop_order => @order.id }
|
20
|
-
@order.update_attribute(:customer_id, (current_customer.id rescue nil)) # either assign it to a user, or don't
|
21
19
|
end
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
@
|
20
|
+
|
21
|
+
if current_user
|
22
|
+
@order.update_attribute(:customer_id, (current_user.id))
|
23
|
+
end
|
24
|
+
|
25
|
+
@order
|
28
26
|
end
|
29
27
|
end
|
30
28
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{radiant-shop-extension}
|
8
|
-
s.version = "0.92.
|
8
|
+
s.version = "0.92.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dirk Kelly", "John Barker", "Darcy Laycock"]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-shop-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 355
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 92
|
9
|
-
-
|
10
|
-
version: 0.92.
|
9
|
+
- 6
|
10
|
+
version: 0.92.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dirk Kelly
|