wunder 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/wunder/promotional/rule/item_quantity_price_rule.rb +10 -0
- data/lib/wunder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa7a0d61dbaa50905e2c82f6f19728f49cadfe10b753f64e76658f1b5f57fe7f
|
4
|
+
data.tar.gz: 81d508e6c4a66266505d7380f9e63948150cbe85305bffab6dfc7d9ae9332546
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be6c9de276f048b04e1cd5dd23f3a57ef118839077b9082c29fd5c98562ed42ddc4dc85e7815150645efa4c1e7cb30fa7e95d1fbd4fccb9d195d23fb6cb64a55
|
7
|
+
data.tar.gz: 52b975a2d67754070c052d5b39b372d89a175c75042b56f396e87578a1d65900803932f95432f091b50978aaf7df3ee7d11c6debdca85127119a68845bb53a75
|
data/Gemfile.lock
CHANGED
@@ -27,6 +27,16 @@ module Promotional
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
def calculate_total_discounted_price(total, discount_type)
|
31
|
+
if discount_type == "percentage"
|
32
|
+
discount_price = total - ((total * value) / 100)
|
33
|
+
elsif discount_type == "flat_rate"
|
34
|
+
discount_price = total
|
35
|
+
end
|
36
|
+
|
37
|
+
discount_price
|
38
|
+
end
|
39
|
+
|
30
40
|
def validate
|
31
41
|
should_be_present("ItemQuantityPriceRule::Value", value)
|
32
42
|
should_be_a_number("ItemQuantityPriceRule::MinimumQuantity",
|
data/lib/wunder/version.rb
CHANGED