@woosmap/ui 4.232.1 → 4.232.2
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.
package/package.json
CHANGED
|
@@ -484,7 +484,7 @@ const Pricing = {
|
|
|
484
484
|
pricing_gmp: [],
|
|
485
485
|
pricing_mbx: [],
|
|
486
486
|
discountEligible: false,
|
|
487
|
-
productId: "
|
|
487
|
+
productId: "itm_LoKNg1CsAw0o65",
|
|
488
488
|
},
|
|
489
489
|
'Timezone': {
|
|
490
490
|
docLink: 'https://developers.woosmap.com/products/geolocation-api/timezone',
|
|
@@ -35,14 +35,13 @@ export default class PricingSimulator extends Component {
|
|
|
35
35
|
|
|
36
36
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
37
37
|
computeTotal = () => {
|
|
38
|
-
let
|
|
39
|
-
|
|
38
|
+
let total = 0;
|
|
39
|
+
|
|
40
40
|
let contactSale = false;
|
|
41
41
|
|
|
42
42
|
const { sliders } = this.state;
|
|
43
43
|
Object.keys(sliders).forEach((category) => {
|
|
44
44
|
Object.keys(sliders[category]).forEach((pricingKey) => {
|
|
45
|
-
const { discountEligible } = PricingData[category].pricings[pricingKey];
|
|
46
45
|
const { amount, computedQueries } = sliders[category][pricingKey];
|
|
47
46
|
if (typeof amount !== 'number' || typeof computedQueries !== 'number') {
|
|
48
47
|
if (computedQueries === '∞') {
|
|
@@ -50,24 +49,15 @@ export default class PricingSimulator extends Component {
|
|
|
50
49
|
}
|
|
51
50
|
return;
|
|
52
51
|
}
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
} else if (computedQueries > 0) {
|
|
56
|
-
notEligibleTotal += amount;
|
|
52
|
+
if (computedQueries > 0) {
|
|
53
|
+
total += amount;
|
|
57
54
|
}
|
|
58
55
|
});
|
|
59
56
|
});
|
|
60
|
-
|
|
61
|
-
const discount = currency === '£' ? 170 : 200;
|
|
62
|
-
const total = notEligibleTotal + Math.max(eligibleTotal - discount, 0);
|
|
63
|
-
const totalBeforeDiscount = notEligibleTotal + eligibleTotal;
|
|
57
|
+
|
|
64
58
|
return {
|
|
65
59
|
total,
|
|
66
|
-
notEligibleTotal,
|
|
67
|
-
eligibleTotal,
|
|
68
60
|
contactSale,
|
|
69
|
-
discount,
|
|
70
|
-
totalBeforeDiscount,
|
|
71
61
|
};
|
|
72
62
|
};
|
|
73
63
|
|