@ikas/storefront 4.0.0-alpha.44 → 4.0.0-alpha.45
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.45",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "Umut Ozan Yıldırım",
|
|
6
6
|
"license": "ISC",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"libphonenumber-js": "^1.10.6"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@ikas/storefront-api": "^4.0.0-alpha.
|
|
28
|
-
"@ikas/storefront-config": "^4.0.0-alpha.
|
|
29
|
-
"@ikas/storefront-model-functions": "^4.0.0-alpha.
|
|
30
|
-
"@ikas/storefront-models": "^4.0.0-alpha.
|
|
31
|
-
"@ikas/storefront-providers": "^4.0.0-alpha.
|
|
27
|
+
"@ikas/storefront-api": "^4.0.0-alpha.45",
|
|
28
|
+
"@ikas/storefront-config": "^4.0.0-alpha.45",
|
|
29
|
+
"@ikas/storefront-model-functions": "^4.0.0-alpha.45",
|
|
30
|
+
"@ikas/storefront-models": "^4.0.0-alpha.45",
|
|
31
|
+
"@ikas/storefront-providers": "^4.0.0-alpha.45",
|
|
32
32
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
33
33
|
"@rollup/plugin-json": "^4.1.0",
|
|
34
34
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"html-react-parser": "^1.4.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@ikas/storefront-api": "^4.0.0-alpha.
|
|
56
|
-
"@ikas/storefront-config": "^4.0.0-alpha.
|
|
57
|
-
"@ikas/storefront-model-functions": "^4.0.0-alpha.
|
|
58
|
-
"@ikas/storefront-models": "^4.0.0-alpha.
|
|
59
|
-
"@ikas/storefront-providers": "^4.0.0-alpha.
|
|
55
|
+
"@ikas/storefront-api": "^4.0.0-alpha.45",
|
|
56
|
+
"@ikas/storefront-config": "^4.0.0-alpha.45",
|
|
57
|
+
"@ikas/storefront-model-functions": "^4.0.0-alpha.45",
|
|
58
|
+
"@ikas/storefront-models": "^4.0.0-alpha.45",
|
|
59
|
+
"@ikas/storefront-providers": "^4.0.0-alpha.45",
|
|
60
60
|
"mobx": "^6.1.3",
|
|
61
61
|
"mobx-react-lite": "^3.1.5",
|
|
62
62
|
"next": "12.2.0",
|
|
@@ -199,11 +199,11 @@ export const CartSummary: React.FC<Props> = observer(({ vm, allowExpand }) => {
|
|
|
199
199
|
checkout.currencySymbol
|
|
200
200
|
)}
|
|
201
201
|
</div>
|
|
202
|
-
{!!checkout
|
|
202
|
+
{!!checkout.$totalTax && !!vm.customizationProps?.showTax && (
|
|
203
203
|
<div className={[styles.TotalTax].join(" ")}>
|
|
204
204
|
{t("checkout-page:cartTaxTitle") +
|
|
205
205
|
" " +
|
|
206
|
-
checkout
|
|
206
|
+
checkout.$formattedTotalTax}
|
|
207
207
|
</div>
|
|
208
208
|
)}
|
|
209
209
|
</div>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { IkasCart } from "../cart";
|
|
2
2
|
import { IkasCheckout as ICheckout } from "@ikas/storefront-models";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
IkasCheckoutFunctions,
|
|
5
|
+
IkasOrderFunctions,
|
|
6
|
+
} from "@ikas/storefront-model-functions";
|
|
4
7
|
import { IkasPaymentGateway } from "../payment-gateway";
|
|
5
8
|
import { formatCurrency } from "../../../utils/currency";
|
|
6
9
|
import { computed, makeObservable, observable } from "mobx";
|
|
@@ -31,6 +34,9 @@ export class IkasCheckout extends IkasCart implements ICheckout {
|
|
|
31
34
|
|
|
32
35
|
isComplete: computed,
|
|
33
36
|
$totalFinalPrice: computed,
|
|
37
|
+
$totalFinalPriceTaxModifier: computed,
|
|
38
|
+
$totalTax: computed,
|
|
39
|
+
$formattedTotalTax: computed,
|
|
34
40
|
$formattedTotalFinalPrice: computed,
|
|
35
41
|
});
|
|
36
42
|
}
|
|
@@ -47,6 +53,24 @@ export class IkasCheckout extends IkasCart implements ICheckout {
|
|
|
47
53
|
);
|
|
48
54
|
}
|
|
49
55
|
|
|
56
|
+
get $totalFinalPriceTaxModifier() {
|
|
57
|
+
return this.$totalFinalPrice / this.totalFinalPrice;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
get $totalTax() {
|
|
61
|
+
return (
|
|
62
|
+
IkasOrderFunctions.getTotalTax(this) * this.$totalFinalPriceTaxModifier
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
get $formattedTotalTax() {
|
|
67
|
+
return formatCurrency(
|
|
68
|
+
this.totalTax,
|
|
69
|
+
this.currencyCode,
|
|
70
|
+
this.currencySymbol || ""
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
50
74
|
get $formattedTotalFinalPrice() {
|
|
51
75
|
return formatCurrency(
|
|
52
76
|
this.$totalFinalPrice,
|