piggybak_bundle_discounts 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -22,9 +22,9 @@ module PiggybakBundleDiscounts
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def self.applicable_bundle_discounts(
|
25
|
+
def self.applicable_bundle_discounts(sellables)
|
26
26
|
# Selecting applicable bundle discounts
|
27
|
-
bundle_discounts =
|
27
|
+
bundle_discounts = self.active.select { |bd| bd.sellables_match_bundle_discount?(sellables) }
|
28
28
|
|
29
29
|
# Returning max bundle discount
|
30
30
|
bundle_discounts.present? ? bundle_discounts.sort_by(&:discount).last : nil
|
@@ -15,6 +15,7 @@ module PiggybakBundleDiscounts
|
|
15
15
|
config.line_item_types[:bundle_discount] = { :visible => false,
|
16
16
|
:allow_destroy => false,
|
17
17
|
:fields => [],
|
18
|
+
:reduce_tax_subtotal => true,
|
18
19
|
:class_name => "::PiggybakBundleDiscounts::BundleDiscount",
|
19
20
|
:display_in_cart => "Bundle Discount",
|
20
21
|
:sort => config.line_item_types[:payment][:sort]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: piggybak_bundle_discounts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -99,7 +99,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
segments:
|
101
101
|
- 0
|
102
|
-
hash:
|
102
|
+
hash: 2130170792761902259
|
103
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
104
|
none: false
|
105
105
|
requirements:
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
segments:
|
110
110
|
- 0
|
111
|
-
hash:
|
111
|
+
hash: 2130170792761902259
|
112
112
|
requirements: []
|
113
113
|
rubyforge_project:
|
114
114
|
rubygems_version: 1.8.23
|