@instockng/storefront-ui 1.0.33 → 1.0.34

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.
Files changed (145) hide show
  1. package/dist/contexts/CartContext.d.ts.map +1 -1
  2. package/dist/index100.mjs +8 -8
  3. package/dist/index101.mjs +6 -6
  4. package/dist/index102.mjs +3 -3
  5. package/dist/index103.mjs +1 -1
  6. package/dist/index104.mjs +1 -1
  7. package/dist/index105.mjs +1 -1
  8. package/dist/index106.mjs +2 -2
  9. package/dist/index107.mjs +2 -2
  10. package/dist/index108.mjs +3 -3
  11. package/dist/index109.mjs +1 -1
  12. package/dist/index110.mjs +3 -3
  13. package/dist/index111.mjs +2 -2
  14. package/dist/index112.mjs +2 -2
  15. package/dist/index113.mjs +1 -1
  16. package/dist/index114.mjs +3 -3
  17. package/dist/index115.mjs +1 -1
  18. package/dist/index116.mjs +1 -1
  19. package/dist/index117.mjs +3 -3
  20. package/dist/index118.mjs +2 -2
  21. package/dist/index119.mjs +4 -4
  22. package/dist/index120.mjs +1 -1
  23. package/dist/index121.mjs +3 -3
  24. package/dist/index122.mjs +4 -4
  25. package/dist/index123.mjs +1 -1
  26. package/dist/index124.mjs +1 -1
  27. package/dist/index125.mjs +1 -1
  28. package/dist/index126.mjs +1 -1
  29. package/dist/index127.mjs +1 -1
  30. package/dist/index128.mjs +1 -1
  31. package/dist/index129.mjs +1 -1
  32. package/dist/index130.mjs +2 -2
  33. package/dist/index131.mjs +3 -3
  34. package/dist/index134.mjs +1 -1
  35. package/dist/index148.mjs +2 -2
  36. package/dist/index150.mjs +2 -2
  37. package/dist/index151.mjs +2 -18
  38. package/dist/index152.mjs +11 -25
  39. package/dist/index153.mjs +26 -32
  40. package/dist/index154.mjs +32 -12
  41. package/dist/index155.mjs +9 -9
  42. package/dist/index156.mjs +18 -2
  43. package/dist/index157.mjs +2 -20
  44. package/dist/index158.mjs +13 -39
  45. package/dist/index159.mjs +46 -2
  46. package/dist/index160.mjs +2 -30
  47. package/dist/index161.mjs +24 -12
  48. package/dist/index162.mjs +18 -2
  49. package/dist/index163.mjs +2 -2
  50. package/dist/index164.mjs +2 -2
  51. package/dist/index165.mjs +2 -2
  52. package/dist/index166.mjs +2 -72
  53. package/dist/index167.mjs +72 -2
  54. package/dist/index168.mjs +2 -53
  55. package/dist/index169.mjs +53 -2
  56. package/dist/index170.mjs +2 -36
  57. package/dist/index171.mjs +30 -146
  58. package/dist/index172.mjs +152 -2
  59. package/dist/index173.mjs +2 -2
  60. package/dist/index174.mjs +2 -19
  61. package/dist/index175.mjs +19 -2
  62. package/dist/index176.mjs +2 -2
  63. package/dist/index177.mjs +2 -26
  64. package/dist/index178.mjs +26 -2
  65. package/dist/index179.mjs +2 -2
  66. package/dist/index180.mjs +2 -24
  67. package/dist/index181.mjs +17 -16
  68. package/dist/index182.mjs +23 -2
  69. package/dist/index184.mjs +2 -2
  70. package/dist/index185.mjs +2 -23
  71. package/dist/index186.mjs +23 -2
  72. package/dist/index187.mjs +2 -23
  73. package/dist/index188.mjs +23 -2
  74. package/dist/index189.mjs +2 -2
  75. package/dist/index191.mjs +2 -23
  76. package/dist/index192.mjs +23 -2
  77. package/dist/index193.mjs +2 -23
  78. package/dist/index194.mjs +23 -2
  79. package/dist/index195.mjs +2 -2
  80. package/dist/index196.mjs +2 -2
  81. package/dist/index198.mjs +2 -2
  82. package/dist/index199.mjs +2 -2
  83. package/dist/index200.mjs +2 -2
  84. package/dist/index201.mjs +2 -2
  85. package/dist/index202.mjs +2 -127
  86. package/dist/index203.mjs +127 -2
  87. package/dist/index204.mjs +2 -74
  88. package/dist/index205.mjs +60 -60
  89. package/dist/index206.mjs +74 -2
  90. package/dist/index222.mjs +2 -2
  91. package/dist/index223.mjs +108 -2
  92. package/dist/index224.mjs +2 -2
  93. package/dist/index225.mjs +2 -2
  94. package/dist/index226.mjs +2 -2
  95. package/dist/index227.mjs +2 -37
  96. package/dist/index228.mjs +2 -2
  97. package/dist/index229.mjs +2 -2
  98. package/dist/index230.mjs +36 -243
  99. package/dist/index231.mjs +2 -2
  100. package/dist/index232.mjs +2 -33
  101. package/dist/index233.mjs +240 -61
  102. package/dist/index234.mjs +2 -25
  103. package/dist/index235.mjs +33 -2
  104. package/dist/index236.mjs +56 -99
  105. package/dist/index237.mjs +25 -2
  106. package/dist/index239.mjs +2 -2
  107. package/dist/index240.mjs +2 -2
  108. package/dist/index241.mjs +2 -2
  109. package/dist/index247.mjs +1 -1
  110. package/dist/index257.mjs +2 -2
  111. package/dist/index258.mjs +2 -18
  112. package/dist/index259.mjs +13 -42
  113. package/dist/index260.mjs +47 -2
  114. package/dist/index261.mjs +2 -2
  115. package/dist/index262.mjs +2 -2
  116. package/dist/index263.mjs +2 -2
  117. package/dist/index264.mjs +2 -91
  118. package/dist/index265.mjs +91 -2
  119. package/dist/index3.mjs +75 -71
  120. package/dist/index38.mjs +2 -2
  121. package/dist/index40.mjs +2 -2
  122. package/dist/index44.mjs +1 -1
  123. package/dist/index5.mjs +36 -35
  124. package/dist/index50.mjs +2 -2
  125. package/dist/index63.mjs +21 -20
  126. package/dist/index64.mjs +2 -24
  127. package/dist/index65.mjs +19 -149
  128. package/dist/index66.mjs +153 -2
  129. package/dist/index69.mjs +1 -1
  130. package/dist/index87.mjs +34 -2
  131. package/dist/index88.mjs +42 -5
  132. package/dist/index89.mjs +2 -1134
  133. package/dist/index90.mjs +5 -19
  134. package/dist/index91.mjs +1119 -40
  135. package/dist/index92.mjs +14 -27
  136. package/dist/index93.mjs +55 -2
  137. package/dist/index94.mjs +33 -34
  138. package/dist/index95.mjs +2 -43
  139. package/dist/index98.mjs +1 -1
  140. package/dist/index99.mjs +1 -1
  141. package/dist/providers/TikTokPixelProvider.d.ts +5 -1
  142. package/dist/providers/TikTokPixelProvider.d.ts.map +1 -1
  143. package/package.json +1 -1
  144. package/src/contexts/CartContext.tsx +8 -1
  145. package/src/providers/TikTokPixelProvider.tsx +10 -3
package/dist/index92.mjs CHANGED
@@ -1,36 +1,23 @@
1
1
  'use client';
2
- import { __module as u } from "./index135.mjs";
3
- import d from "react/jsx-runtime";
4
- import "react";
5
- import { __require as c } from "./index65.mjs";
6
- var n;
7
- function y() {
8
- return n ? u.exports : (n = 1, function(a, e) {
9
- Object.defineProperty(e, "__esModule", {
2
+ import { __exports as e } from "./index132.mjs";
3
+ import "./index90.mjs";
4
+ import u from "react";
5
+ import { __exports as n } from "./index95.mjs";
6
+ var o;
7
+ function d() {
8
+ return o ? e : (o = 1, function(t) {
9
+ Object.defineProperty(t, "__esModule", {
10
10
  value: !0
11
- }), Object.defineProperty(e, "default", {
11
+ }), Object.defineProperty(t, "RouterContext", {
12
12
  enumerable: !0,
13
13
  get: function() {
14
- return l;
14
+ return r;
15
15
  }
16
16
  });
17
- const f = d, o = c();
18
- function l(t) {
19
- function r(i) {
20
- return /* @__PURE__ */ (0, f.jsx)(t, {
21
- router: (0, o.useRouter)(),
22
- ...i
23
- });
24
- }
25
- if (r.getInitialProps = t.getInitialProps, r.origGetInitialProps = t.origGetInitialProps, process.env.NODE_ENV !== "production") {
26
- const i = t.displayName || t.name || "Unknown";
27
- r.displayName = "withRouter(" + i + ")";
28
- }
29
- return r;
30
- }
31
- (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), a.exports = e.default);
32
- }(u, u.exports), u.exports);
17
+ const r = (/* @__PURE__ */ n._(u)).default.createContext(null);
18
+ process.env.NODE_ENV !== "production" && (r.displayName = "RouterContext");
19
+ }(e), e);
33
20
  }
34
21
  export {
35
- y as __require
22
+ d as __require
36
23
  };
package/dist/index93.mjs CHANGED
@@ -1,5 +1,58 @@
1
1
  'use client';
2
- var e = {};
2
+ import { __exports as o } from "./index133.mjs";
3
+ import { __require as p } from "./index134.mjs";
4
+ var u;
5
+ function m() {
6
+ return u ? o : (u = 1, function(i) {
7
+ Object.defineProperty(i, "__esModule", {
8
+ value: !0
9
+ });
10
+ function f(e, r) {
11
+ for (var t in r) Object.defineProperty(e, t, {
12
+ enumerable: !0,
13
+ get: r[t]
14
+ });
15
+ }
16
+ f(i, {
17
+ /**
18
+ * Checks whether the given value is a NextError.
19
+ * This can be used to print a more detailed error message with properties like `code` & `digest`.
20
+ */
21
+ default: function() {
22
+ return s;
23
+ },
24
+ getProperError: function() {
25
+ return a;
26
+ }
27
+ });
28
+ const c = p();
29
+ function s(e) {
30
+ return typeof e == "object" && e !== null && "name" in e && "message" in e;
31
+ }
32
+ function d(e) {
33
+ const r = /* @__PURE__ */ new WeakSet();
34
+ return JSON.stringify(e, (t, n) => {
35
+ if (typeof n == "object" && n !== null) {
36
+ if (r.has(n))
37
+ return "[Circular]";
38
+ r.add(n);
39
+ }
40
+ return n;
41
+ });
42
+ }
43
+ function a(e) {
44
+ if (s(e))
45
+ return e;
46
+ if (process.env.NODE_ENV === "development") {
47
+ if (typeof e > "u")
48
+ return new Error("An undefined error was thrown, see here for more info: https://nextjs.org/docs/messages/threw-undefined");
49
+ if (e === null)
50
+ return new Error("A null error was thrown, see here for more info: https://nextjs.org/docs/messages/threw-undefined");
51
+ }
52
+ return new Error((0, c.isPlainObject)(e) ? d(e) : e + "");
53
+ }
54
+ }(o), o);
55
+ }
3
56
  export {
4
- e as __exports
57
+ m as __require
5
58
  };
package/dist/index94.mjs CHANGED
@@ -1,37 +1,36 @@
1
1
  'use client';
2
- var a = (i, t, e = {}) => {
3
- let r = `${i}=${t}`;
4
- if (i.startsWith("__Secure-") && !e.secure)
5
- throw new Error("__Secure- Cookie must have Secure attributes");
6
- if (i.startsWith("__Host-")) {
7
- if (!e.secure)
8
- throw new Error("__Host- Cookie must have Secure attributes");
9
- if (e.path !== "/")
10
- throw new Error('__Host- Cookie must have Path attributes with "/"');
11
- if (e.domain)
12
- throw new Error("__Host- Cookie must not have Domain attributes");
13
- }
14
- if (e && typeof e.maxAge == "number" && e.maxAge >= 0) {
15
- if (e.maxAge > 3456e4)
16
- throw new Error(
17
- "Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration."
18
- );
19
- r += `; Max-Age=${e.maxAge | 0}`;
20
- }
21
- if (e.domain && e.prefix !== "host" && (r += `; Domain=${e.domain}`), e.path && (r += `; Path=${e.path}`), e.expires) {
22
- if (e.expires.getTime() - Date.now() > 3456e7)
23
- throw new Error(
24
- "Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future."
25
- );
26
- r += `; Expires=${e.expires.toUTCString()}`;
27
- }
28
- if (e.httpOnly && (r += "; HttpOnly"), e.secure && (r += "; Secure"), e.sameSite && (r += `; SameSite=${e.sameSite.charAt(0).toUpperCase() + e.sameSite.slice(1)}`), e.priority && (r += `; Priority=${e.priority.charAt(0).toUpperCase() + e.priority.slice(1)}`), e.partitioned) {
29
- if (!e.secure)
30
- throw new Error("Partitioned Cookie must have Secure attributes");
31
- r += "; Partitioned";
32
- }
33
- return r;
34
- }, s = (i, t, e) => (t = encodeURIComponent(t), a(i, t, e));
2
+ import { __module as u } from "./index135.mjs";
3
+ import d from "react/jsx-runtime";
4
+ import "react";
5
+ import { __require as c } from "./index66.mjs";
6
+ var n;
7
+ function y() {
8
+ return n ? u.exports : (n = 1, function(a, e) {
9
+ Object.defineProperty(e, "__esModule", {
10
+ value: !0
11
+ }), Object.defineProperty(e, "default", {
12
+ enumerable: !0,
13
+ get: function() {
14
+ return l;
15
+ }
16
+ });
17
+ const f = d, o = c();
18
+ function l(t) {
19
+ function r(i) {
20
+ return /* @__PURE__ */ (0, f.jsx)(t, {
21
+ router: (0, o.useRouter)(),
22
+ ...i
23
+ });
24
+ }
25
+ if (r.getInitialProps = t.getInitialProps, r.origGetInitialProps = t.origGetInitialProps, process.env.NODE_ENV !== "production") {
26
+ const i = t.displayName || t.name || "Unknown";
27
+ r.displayName = "withRouter(" + i + ")";
28
+ }
29
+ return r;
30
+ }
31
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), a.exports = e.default);
32
+ }(u, u.exports), u.exports);
33
+ }
35
34
  export {
36
- s as serialize
35
+ y as __require
37
36
  };
package/dist/index95.mjs CHANGED
@@ -1,46 +1,5 @@
1
1
  'use client';
2
- var s = (e, r) => (e = e.replace(/\/+$/, ""), e = e + "/", r = r.replace(/^\/+/, ""), e + r), p = (e, r) => {
3
- for (const [n, t] of Object.entries(r)) {
4
- const c = new RegExp("/:" + n + "(?:{[^/]+})?\\??");
5
- e = e.replace(c, t ? `/${t}` : "");
6
- }
7
- return e;
8
- }, f = (e) => {
9
- const r = new URLSearchParams();
10
- for (const [n, t] of Object.entries(e))
11
- if (t !== void 0)
12
- if (Array.isArray(t))
13
- for (const c of t)
14
- r.append(n, c);
15
- else
16
- r.set(n, t);
17
- return r;
18
- }, i = (e, r) => {
19
- switch (r) {
20
- case "ws":
21
- return e.replace(/^http/, "ws");
22
- case "http":
23
- return e.replace(/^ws/, "http");
24
- }
25
- }, l = (e) => /^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e) ? e.replace(/\/index(?=\?|$)/, "/") : e.replace(/\/index(?=\?|$)/, "");
26
- function a(e) {
27
- return typeof e == "object" && e !== null && !Array.isArray(e);
28
- }
29
- function o(e, r) {
30
- if (!a(e) && !a(r))
31
- return r;
32
- const n = { ...e };
33
- for (const t in r) {
34
- const c = r[t];
35
- a(n[t]) && a(c) ? n[t] = o(n[t], c) : n[t] = c;
36
- }
37
- return n;
38
- }
2
+ var e = {};
39
3
  export {
40
- f as buildSearchParams,
41
- o as deepMerge,
42
- s as mergePath,
43
- l as removeIndexString,
44
- p as replaceUrlParam,
45
- i as replaceUrlProtocol
4
+ e as __exports
46
5
  };
package/dist/index98.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { __exports as u } from "./index148.mjs";
2
+ import { __exports as u } from "./index149.mjs";
3
3
  var c;
4
4
  function o() {
5
5
  if (c) return u;
package/dist/index99.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { __exports as e } from "./index149.mjs";
2
+ import { __exports as e } from "./index150.mjs";
3
3
  var i;
4
4
  function u() {
5
5
  return i ? e : (i = 1, function(r) {
@@ -4,7 +4,11 @@ interface TikTokPixelContextType {
4
4
  trackPageView: () => void;
5
5
  trackProductView: (productId: string, productName: string, price: number, eventID?: string) => void;
6
6
  trackAddToCart: (productId: string, productName: string, price: number, quantity: number, eventID?: string) => void;
7
- trackInitiateCheckout: (cartTotal: number, itemCount: number, eventID?: string) => void;
7
+ trackInitiateCheckout: (cartTotal: number, itemCount: number, eventID?: string, contents?: Array<{
8
+ content_id: string;
9
+ quantity: number;
10
+ price: number;
11
+ }>) => void;
8
12
  trackPurchase: (orderTotal: number, currency: string, orderId: string, items: Array<{
9
13
  id: string;
10
14
  quantity: number;
@@ -1 +1 @@
1
- {"version":3,"file":"TikTokPixelProvider.d.ts","sourceRoot":"","sources":["../../src/providers/TikTokPixelProvider.tsx"],"names":[],"mappings":"AAEA,OAAc,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,UAAU,sBAAsB;IAC9B,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjF,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,gBAAgB,EAAE,CAChB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,MAAM,KACb,IAAI,CAAC;IACV,cAAc,EAAE,CACd,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,KACb,IAAI,CAAC;IACV,qBAAqB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxF,aAAa,EAAE,CACb,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,EAClE,OAAO,CAAC,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAID,UAAU,wBAAwB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAID,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,OAAO,EACP,KAAa,GACd,EAAE,wBAAwB,2CAuK1B;AAED,wBAAgB,cAAc,IAAI,sBAAsB,CAMvD"}
1
+ {"version":3,"file":"TikTokPixelProvider.d.ts","sourceRoot":"","sources":["../../src/providers/TikTokPixelProvider.tsx"],"names":[],"mappings":"AAEA,OAAc,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,UAAU,sBAAsB;IAC9B,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjF,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,gBAAgB,EAAE,CAChB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,MAAM,KACb,IAAI,CAAC;IACV,cAAc,EAAE,CACd,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,KACb,IAAI,CAAC;IACV,qBAAqB,EAAE,CACrB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,KACtE,IAAI,CAAC;IACV,aAAa,EAAE,CACb,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,EAClE,OAAO,CAAC,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAID,UAAU,wBAAwB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAID,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,OAAO,EACP,KAAa,GACd,EAAE,wBAAwB,2CAyK1B;AAED,wBAAgB,cAAc,IAAI,sBAAsB,CAMvD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instockng/storefront-ui",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "Pre-built UI components for OMS e-commerce sites",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -342,11 +342,18 @@ export function CartProvider({ children, brandSlug, initialCartId, shoppingCartP
342
342
  // Generate event ID matching backend format: cart_{cartId}_checkout
343
343
  const eventID = `cart_${cartId}_checkout`;
344
344
 
345
+ // Prepare contents array for TikTok Pixel
346
+ const contents = cart.items?.map((item) => ({
347
+ content_id: item.variant.sku,
348
+ quantity: item.quantity,
349
+ price: Number(item.variant.price),
350
+ })) || [];
351
+
345
352
  // Track InitiateCheckout event with Meta Pixel
346
353
  trackMetaInitiateCheckout(cartTotal, itemCount, eventID);
347
354
 
348
355
  // Track InitiateCheckout event with TikTok Pixel
349
- trackTikTokInitiateCheckout(cartTotal, itemCount, eventID);
356
+ trackTikTokInitiateCheckout(cartTotal, itemCount, eventID, contents);
350
357
  }, [cart, cartId, trackMetaInitiateCheckout, trackTikTokInitiateCheckout]);
351
358
 
352
359
  const value: CartContextValue = {
@@ -24,7 +24,12 @@ interface TikTokPixelContextType {
24
24
  quantity: number,
25
25
  eventID?: string
26
26
  ) => void;
27
- trackInitiateCheckout: (cartTotal: number, itemCount: number, eventID?: string) => void;
27
+ trackInitiateCheckout: (
28
+ cartTotal: number,
29
+ itemCount: number,
30
+ eventID?: string,
31
+ contents?: Array<{ content_id: string; quantity: number; price: number }>
32
+ ) => void;
28
33
  trackPurchase: (
29
34
  orderTotal: number,
30
35
  currency: string,
@@ -153,7 +158,7 @@ export function TikTokPixelProvider({
153
158
  content_type: 'product',
154
159
  content_id: productId,
155
160
  content_name: productName,
156
- price: price,
161
+ value: price * quantity,
157
162
  quantity: quantity,
158
163
  currency: 'NGN',
159
164
  },
@@ -164,7 +169,8 @@ export function TikTokPixelProvider({
164
169
  const trackInitiateCheckout = (
165
170
  cartTotal: number,
166
171
  itemCount: number,
167
- eventID?: string
172
+ eventID?: string,
173
+ contents?: Array<{ content_id: string; quantity: number; price: number }>
168
174
  ) => {
169
175
  track(
170
176
  'InitiateCheckout',
@@ -173,6 +179,7 @@ export function TikTokPixelProvider({
173
179
  value: cartTotal,
174
180
  currency: 'NGN',
175
181
  num_items: itemCount,
182
+ ...(contents && contents.length > 0 ? { contents } : {}),
176
183
  },
177
184
  eventID
178
185
  );