radiant-shop-extension 0.93.3 → 0.94.0
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.
- data/VERSION +1 -1
- data/app/models/shop_category.rb +1 -1
- data/app/models/shop_product.rb +1 -1
- data/lib/shop/controllers/site_controller.rb +1 -1
- data/lib/shop/tags/helpers.rb +13 -10
- data/radiant-shop-extension.gemspec +2 -2
- data/spec/models/shop_category_spec.rb +1 -1
- data/spec/models/shop_product_spec.rb +1 -1
- metadata +5 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.94.0
|
data/app/models/shop_category.rb
CHANGED
@@ -23,7 +23,7 @@ class ShopCategory < ActiveRecord::Base
|
|
23
23
|
def url; page.url; end
|
24
24
|
|
25
25
|
# Returns the url of the page formatted as an sku
|
26
|
-
def handle; ShopProduct.to_sku(
|
26
|
+
def handle; ShopProduct.to_sku(slug); end
|
27
27
|
|
28
28
|
# Returns the content of the product's page's description part
|
29
29
|
def description
|
data/app/models/shop_product.rb
CHANGED
@@ -22,7 +22,7 @@ class ShopProduct < ActiveRecord::Base
|
|
22
22
|
def name; page.title; end
|
23
23
|
|
24
24
|
# Returns the url of the page formatted as an sku
|
25
|
-
def sku;
|
25
|
+
def sku; ShopProduct.to_sku(slug); end
|
26
26
|
|
27
27
|
# Returns the url of the product's page
|
28
28
|
def url; page.url; end
|
data/lib/shop/tags/helpers.rb
CHANGED
@@ -145,20 +145,23 @@ module Shop
|
|
145
145
|
|
146
146
|
def current_order(tag)
|
147
147
|
result = nil
|
148
|
+
begin
|
149
|
+
if tag.attr['key'] and tag.attr['value']
|
150
|
+
result = ShopOrder.first(:conditions => { tag.attr['key'].downcase.to_sym => tag.attr['value'] })
|
148
151
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
elsif tag.locals.shop_order.present?
|
153
|
-
result = tag.locals.shop_order
|
152
|
+
elsif tag.locals.shop_order.present?
|
153
|
+
result = tag.locals.shop_order
|
154
154
|
|
155
|
-
|
156
|
-
|
157
|
-
|
155
|
+
elsif tag.locals.page.request.session[:shop_order].present?
|
156
|
+
session = tag.locals.page.request.session[:shop_order]
|
157
|
+
result = ShopOrder.find(session)
|
158
158
|
|
159
|
-
|
160
|
-
|
159
|
+
elsif tag.locals.response.present? and tag.locals.response.result[:checkout].present?
|
160
|
+
result = ShopOrder.find(tag.locals.response.result[:checkout][:order])
|
161
161
|
|
162
|
+
end
|
163
|
+
rescue
|
164
|
+
result = nil
|
162
165
|
end
|
163
166
|
|
164
167
|
result
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{radiant-shop-extension}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.94.0"
|
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"]
|
12
|
-
s.date = %q{2011-01-
|
12
|
+
s.date = %q{2011-01-11}
|
13
13
|
s.description = %q{Radiant Shop is an attempt at a simple but complete store. It includes Products, Categories, Orders and Credit Card Payments}
|
14
14
|
s.email = %q{dk@dirkkelly.com}
|
15
15
|
s.extra_rdoc_files = [
|
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: 359
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 94
|
9
|
+
- 0
|
10
|
+
version: 0.94.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dirk Kelly
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-01-
|
20
|
+
date: 2011-01-11 00:00:00 +08:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|