@woosmap/ui 4.232.1 → 4.232.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.
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
|
|
|
@@ -170,7 +160,7 @@ export default class PricingSimulator extends Component {
|
|
|
170
160
|
render() {
|
|
171
161
|
const { sliders, displayCompetitorsProduct } = this.state;
|
|
172
162
|
const { currency, hlPricings, planId } = this.props;
|
|
173
|
-
const { total, contactSale
|
|
163
|
+
const { total, contactSale } = this.computeTotal();
|
|
174
164
|
const totalDisplayed = this.displayAmount(parseInt(total, 10), currency);
|
|
175
165
|
// if (contactSale) {
|
|
176
166
|
// totalDisplayed = <a href="/contact">Contact Sales</a>;
|
|
@@ -195,7 +185,7 @@ export default class PricingSimulator extends Component {
|
|
|
195
185
|
)}
|
|
196
186
|
</div>
|
|
197
187
|
<div className="pricing-total__amount">
|
|
198
|
-
{this.displayAmount(
|
|
188
|
+
{this.displayAmount(total, currency)}
|
|
199
189
|
{contactSale && <span className="pricing-total__amount__asterisk">*</span>}
|
|
200
190
|
</div>
|
|
201
191
|
</div>
|