File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { Product } from '../../../../src/interfaces/product.ts '
1+ import { Product } from '@piwikpro/react-piwik-pro '
22import { FunctionComponent } from 'react'
33import {
44 Dialog ,
Original file line number Diff line number Diff line change 11import { FunctionComponent , useEffect , useState } from 'react'
2- import { Product } from '../../../src/interfaces/product.ts'
3- import { PaymentInformation } from '../../../src/interfaces/payment.ts'
4- import { eCommerce } from '@piwikpro/react-piwik-pro'
2+ import { eCommerce , Product , PaymentInformation } from '@piwikpro/react-piwik-pro'
53import { useSnackbar } from 'notistack'
64import {
75 Box ,
@@ -29,8 +27,8 @@ const products: Product[] = [
2927 variant : 'Variant 1' ,
3028 price : 9.99 ,
3129 customDimensions : {
32- dimension1 : 'value1' ,
33- dimension2 : 'value2'
30+ 1 : 'value1' ,
31+ 2 : 'value2'
3432 }
3533 } ,
3634 {
@@ -41,8 +39,8 @@ const products: Product[] = [
4139 variant : 'Variant 2' ,
4240 price : 19.98 ,
4341 customDimensions : {
44- dimension1 : 'value1' ,
45- dimension2 : 'value2'
42+ 1 : 'value1' ,
43+ 2 : 'value2'
4644 }
4745 } ,
4846 {
@@ -53,8 +51,8 @@ const products: Product[] = [
5351 variant : 'Variant 3' ,
5452 price : 29.97 ,
5553 customDimensions : {
56- dimension1 : 'value1' ,
57- dimension2 : 'value2'
54+ 1 : 'value1' ,
55+ 2 : 'value2'
5856 }
5957 } ,
6058 {
@@ -65,8 +63,8 @@ const products: Product[] = [
6563 variant : 'Variant 4' ,
6664 price : 39.96 ,
6765 customDimensions : {
68- dimension1 : 'value1' ,
69- dimension2 : 'value2'
66+ 1 : 'value1' ,
67+ 2 : 'value2'
7068 }
7169 } ,
7270 {
@@ -77,8 +75,8 @@ const products: Product[] = [
7775 variant : 'Variant 5' ,
7876 price : 49.95 ,
7977 customDimensions : {
80- dimension1 : 'value1' ,
81- dimension2 : 'value2'
78+ 1 : 'value1' ,
79+ 2 : 'value2'
8280 }
8381 } ,
8482 {
@@ -89,8 +87,8 @@ const products: Product[] = [
8987 variant : 'Variant 6' ,
9088 price : 59.94 ,
9189 customDimensions : {
92- dimension1 : 'value1' ,
93- dimension2 : 'value2'
90+ 1 : 'value1' ,
91+ 2 : 'value2'
9492 }
9593 }
9694]
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ export * as SiteSearch from './services/site-search/site-search.service';
1212export * as UserManagement from './services/user-management/userManagement.service' ;
1313export * as DataLayer from './services/dataLayer/dataLayer.service' ;
1414
15+ export * from './interfaces/payment' ;
16+ export * from './interfaces/product' ;
17+
1518export default {
1619 initialize : PiwikPro . default . init ,
1720}
Original file line number Diff line number Diff line change 11import { LimitedArrayFiveStrings } from './utils'
22
3+ type DimensionId = number ;
4+
35export type Product = {
46 sku : string ,
57 name ?: string ,
@@ -8,5 +10,5 @@ export type Product = {
810 quantity ?: number ,
911 brand ?: string ,
1012 variant ?: string ,
11- customDimensions ?: object ,
13+ customDimensions ?: Record < DimensionId , string > ,
1214}
You can’t perform that action at this time.
0 commit comments