shop_bunny 0.7.4.2 → 0.7.4.3
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/lib/shop_bunny/cart_module.rb +11 -2
- metadata +4 -4
|
@@ -27,7 +27,15 @@ module ShopBunny
|
|
|
27
27
|
|
|
28
28
|
# Calculates the sum of all cart_items, excluding the coupons discount!
|
|
29
29
|
def item_sum
|
|
30
|
-
|
|
30
|
+
begin
|
|
31
|
+
self.cart_items.inject(0) do |sum,e|
|
|
32
|
+
logger.warn "#{e.item.nil?}: #{e.inspect}"
|
|
33
|
+
sum += e.quantity*e.item.price
|
|
34
|
+
end
|
|
35
|
+
rescue
|
|
36
|
+
logger.warn "item_sum could not be calculated"
|
|
37
|
+
t('shop_bunny.incalculatable')
|
|
38
|
+
end
|
|
31
39
|
end
|
|
32
40
|
|
|
33
41
|
def items_with_coupons
|
|
@@ -104,7 +112,8 @@ module ShopBunny
|
|
|
104
112
|
:coupons => coupons.as_json,
|
|
105
113
|
:item_sum => item_sum,
|
|
106
114
|
:shipping_costs => shipping_costs,
|
|
107
|
-
:total => total
|
|
115
|
+
:total => total,
|
|
116
|
+
:items_with_coupons => items_with_coupons
|
|
108
117
|
)
|
|
109
118
|
}
|
|
110
119
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: shop_bunny
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 97
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 7
|
|
9
9
|
- 4
|
|
10
|
-
-
|
|
11
|
-
version: 0.7.4.
|
|
10
|
+
- 3
|
|
11
|
+
version: 0.7.4.3
|
|
12
12
|
platform: ruby
|
|
13
13
|
authors:
|
|
14
14
|
- kopfmaschine.com
|
|
@@ -16,7 +16,7 @@ autorequire:
|
|
|
16
16
|
bindir: bin
|
|
17
17
|
cert_chain: []
|
|
18
18
|
|
|
19
|
-
date: 2010-10-
|
|
19
|
+
date: 2010-10-19 00:00:00 +02:00
|
|
20
20
|
default_executable:
|
|
21
21
|
dependencies: []
|
|
22
22
|
|