@ikas/storefront 0.0.147 → 0.0.149
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/build/analytics/googleTagManager.d.ts +6 -12
- package/build/index.es.js +19 -8
- package/build/index.js +19 -8
- package/package.json +1 -1
|
@@ -12,11 +12,7 @@ export declare class GoogleTagManager {
|
|
|
12
12
|
items: {
|
|
13
13
|
item_name: string;
|
|
14
14
|
item_id: string;
|
|
15
|
-
parent_id: string;
|
|
16
15
|
price: number;
|
|
17
|
-
currency: string;
|
|
18
|
-
url: string;
|
|
19
|
-
item_image: string;
|
|
20
16
|
item_brand: string;
|
|
21
17
|
item_category: string;
|
|
22
18
|
item_category_2: string;
|
|
@@ -28,6 +24,12 @@ export declare class GoogleTagManager {
|
|
|
28
24
|
index: number;
|
|
29
25
|
quantity: number;
|
|
30
26
|
}[];
|
|
27
|
+
extraParams: {
|
|
28
|
+
parent_id: string;
|
|
29
|
+
currency: string;
|
|
30
|
+
url: string;
|
|
31
|
+
item_image: string;
|
|
32
|
+
};
|
|
31
33
|
};
|
|
32
34
|
} | undefined;
|
|
33
35
|
static addToCart(item: IkasProductDetail | IkasOrderLineItem, quantity: number): {
|
|
@@ -36,11 +38,7 @@ export declare class GoogleTagManager {
|
|
|
36
38
|
items: ({
|
|
37
39
|
item_name: string;
|
|
38
40
|
item_id: string;
|
|
39
|
-
parent_id: string;
|
|
40
41
|
price: number;
|
|
41
|
-
currency: string;
|
|
42
|
-
url: string;
|
|
43
|
-
item_image: string;
|
|
44
42
|
item_brand: string;
|
|
45
43
|
item_category: string;
|
|
46
44
|
item_category_2: string;
|
|
@@ -74,11 +72,7 @@ export declare class GoogleTagManager {
|
|
|
74
72
|
items: ({
|
|
75
73
|
item_name: string;
|
|
76
74
|
item_id: string;
|
|
77
|
-
parent_id: string;
|
|
78
75
|
price: number;
|
|
79
|
-
currency: string;
|
|
80
|
-
url: string;
|
|
81
|
-
item_image: string;
|
|
82
76
|
item_brand: string;
|
|
83
77
|
item_category: string;
|
|
84
78
|
item_category_2: string;
|
package/build/index.es.js
CHANGED
|
@@ -16983,11 +16983,18 @@ var GoogleTagManager = /** @class */ (function () {
|
|
|
16983
16983
|
}
|
|
16984
16984
|
};
|
|
16985
16985
|
GoogleTagManager.productView = function (productDetail) {
|
|
16986
|
+
var _a;
|
|
16986
16987
|
try {
|
|
16987
16988
|
var event_2 = {
|
|
16988
16989
|
event: "view_item",
|
|
16989
16990
|
ecommerce: {
|
|
16990
16991
|
items: [productToGTMItem(productDetail)],
|
|
16992
|
+
extraParams: {
|
|
16993
|
+
parent_id: productDetail.product.id,
|
|
16994
|
+
currency: productDetail.selectedVariant.price.currency,
|
|
16995
|
+
url: "https://" + window.location.hostname + productDetail.href,
|
|
16996
|
+
item_image: ((_a = productDetail.selectedVariant.mainImage) === null || _a === void 0 ? void 0 : _a.src) || "",
|
|
16997
|
+
},
|
|
16991
16998
|
},
|
|
16992
16999
|
};
|
|
16993
17000
|
//@ts-ignore
|
|
@@ -17213,17 +17220,13 @@ var GoogleTagManager = /** @class */ (function () {
|
|
|
17213
17220
|
return GoogleTagManager;
|
|
17214
17221
|
}());
|
|
17215
17222
|
function productToGTMItem(productDetail, quantity) {
|
|
17216
|
-
var _a
|
|
17223
|
+
var _a;
|
|
17217
17224
|
if (quantity === void 0) { quantity = 1; }
|
|
17218
17225
|
return {
|
|
17219
17226
|
item_name: productDetail.product.name,
|
|
17220
17227
|
item_id: productDetail.selectedVariant.id,
|
|
17221
|
-
parent_id: productDetail.product.id,
|
|
17222
17228
|
price: productDetail.selectedVariant.price.finalPrice,
|
|
17223
|
-
|
|
17224
|
-
url: "https://" + window.location.hostname + productDetail.href,
|
|
17225
|
-
item_image: ((_a = productDetail.selectedVariant.mainImage) === null || _a === void 0 ? void 0 : _a.src) || "",
|
|
17226
|
-
item_brand: ((_b = productDetail.product.brand) === null || _b === void 0 ? void 0 : _b.name) || "",
|
|
17229
|
+
item_brand: ((_a = productDetail.product.brand) === null || _a === void 0 ? void 0 : _a.name) || "",
|
|
17227
17230
|
item_category: productDetail.product.categories.length
|
|
17228
17231
|
? productDetail.product.categories[0].name
|
|
17229
17232
|
: "",
|
|
@@ -28681,7 +28684,9 @@ var AddressFormViewModel = /** @class */ (function () {
|
|
|
28681
28684
|
get: function () {
|
|
28682
28685
|
var list = this.countries.map(this.modelToOption);
|
|
28683
28686
|
list.sort(function (a, b) {
|
|
28684
|
-
return a.label.
|
|
28687
|
+
return a.label.toLocaleLowerCase("tr-TR") > b.label.toLocaleLowerCase("tr-TR")
|
|
28688
|
+
? 1
|
|
28689
|
+
: -1;
|
|
28685
28690
|
});
|
|
28686
28691
|
return list;
|
|
28687
28692
|
},
|
|
@@ -28704,7 +28709,13 @@ var AddressFormViewModel = /** @class */ (function () {
|
|
|
28704
28709
|
});
|
|
28705
28710
|
Object.defineProperty(AddressFormViewModel.prototype, "districtOptions", {
|
|
28706
28711
|
get: function () {
|
|
28707
|
-
|
|
28712
|
+
var list = this.districts.map(this.modelToOption);
|
|
28713
|
+
list.sort(function (a, b) {
|
|
28714
|
+
return a.label.toLocaleLowerCase("tr-TR") > b.label.toLocaleLowerCase("tr-TR")
|
|
28715
|
+
? 1
|
|
28716
|
+
: -1;
|
|
28717
|
+
});
|
|
28718
|
+
return list;
|
|
28708
28719
|
},
|
|
28709
28720
|
enumerable: false,
|
|
28710
28721
|
configurable: true
|
package/build/index.js
CHANGED
|
@@ -16989,11 +16989,18 @@ var GoogleTagManager = /** @class */ (function () {
|
|
|
16989
16989
|
}
|
|
16990
16990
|
};
|
|
16991
16991
|
GoogleTagManager.productView = function (productDetail) {
|
|
16992
|
+
var _a;
|
|
16992
16993
|
try {
|
|
16993
16994
|
var event_2 = {
|
|
16994
16995
|
event: "view_item",
|
|
16995
16996
|
ecommerce: {
|
|
16996
16997
|
items: [productToGTMItem(productDetail)],
|
|
16998
|
+
extraParams: {
|
|
16999
|
+
parent_id: productDetail.product.id,
|
|
17000
|
+
currency: productDetail.selectedVariant.price.currency,
|
|
17001
|
+
url: "https://" + window.location.hostname + productDetail.href,
|
|
17002
|
+
item_image: ((_a = productDetail.selectedVariant.mainImage) === null || _a === void 0 ? void 0 : _a.src) || "",
|
|
17003
|
+
},
|
|
16997
17004
|
},
|
|
16998
17005
|
};
|
|
16999
17006
|
//@ts-ignore
|
|
@@ -17219,17 +17226,13 @@ var GoogleTagManager = /** @class */ (function () {
|
|
|
17219
17226
|
return GoogleTagManager;
|
|
17220
17227
|
}());
|
|
17221
17228
|
function productToGTMItem(productDetail, quantity) {
|
|
17222
|
-
var _a
|
|
17229
|
+
var _a;
|
|
17223
17230
|
if (quantity === void 0) { quantity = 1; }
|
|
17224
17231
|
return {
|
|
17225
17232
|
item_name: productDetail.product.name,
|
|
17226
17233
|
item_id: productDetail.selectedVariant.id,
|
|
17227
|
-
parent_id: productDetail.product.id,
|
|
17228
17234
|
price: productDetail.selectedVariant.price.finalPrice,
|
|
17229
|
-
|
|
17230
|
-
url: "https://" + window.location.hostname + productDetail.href,
|
|
17231
|
-
item_image: ((_a = productDetail.selectedVariant.mainImage) === null || _a === void 0 ? void 0 : _a.src) || "",
|
|
17232
|
-
item_brand: ((_b = productDetail.product.brand) === null || _b === void 0 ? void 0 : _b.name) || "",
|
|
17235
|
+
item_brand: ((_a = productDetail.product.brand) === null || _a === void 0 ? void 0 : _a.name) || "",
|
|
17233
17236
|
item_category: productDetail.product.categories.length
|
|
17234
17237
|
? productDetail.product.categories[0].name
|
|
17235
17238
|
: "",
|
|
@@ -28660,7 +28663,9 @@ var AddressFormViewModel = /** @class */ (function () {
|
|
|
28660
28663
|
get: function () {
|
|
28661
28664
|
var list = this.countries.map(this.modelToOption);
|
|
28662
28665
|
list.sort(function (a, b) {
|
|
28663
|
-
return a.label.
|
|
28666
|
+
return a.label.toLocaleLowerCase("tr-TR") > b.label.toLocaleLowerCase("tr-TR")
|
|
28667
|
+
? 1
|
|
28668
|
+
: -1;
|
|
28664
28669
|
});
|
|
28665
28670
|
return list;
|
|
28666
28671
|
},
|
|
@@ -28683,7 +28688,13 @@ var AddressFormViewModel = /** @class */ (function () {
|
|
|
28683
28688
|
});
|
|
28684
28689
|
Object.defineProperty(AddressFormViewModel.prototype, "districtOptions", {
|
|
28685
28690
|
get: function () {
|
|
28686
|
-
|
|
28691
|
+
var list = this.districts.map(this.modelToOption);
|
|
28692
|
+
list.sort(function (a, b) {
|
|
28693
|
+
return a.label.toLocaleLowerCase("tr-TR") > b.label.toLocaleLowerCase("tr-TR")
|
|
28694
|
+
? 1
|
|
28695
|
+
: -1;
|
|
28696
|
+
});
|
|
28697
|
+
return list;
|
|
28687
28698
|
},
|
|
28688
28699
|
enumerable: false,
|
|
28689
28700
|
configurable: true
|