Skip to content

Commit

Permalink
[PPI-976] ecommerce product detail view
Browse files Browse the repository at this point in the history
  • Loading branch information
lysy-vlc committed Dec 11, 2023
1 parent b53a207 commit 4e475b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
3 changes: 1 addition & 2 deletions src/constants/track-event.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ export enum TRACK_EVENT {
SEARCH = 'trackSiteSearch',
ADD_ECOMMERCE_ITEM = 'ecommerceAddToCart',
REMOVE_ECOMMERCE_ITEM = 'ecommerceAddToCart',
CLEAR_ECOMMERCE_CART = 'clearEcommerceCart',
SET_ECOMMERCE_VIEW = 'setEcommerceView',
ECOMMERCE_PRODUCT_DETAIL_VIEW = 'ecommerceProductDetailView',
UPDATE_ECOMMERCE_CART = 'ecommerceCartUpdate',
ORDER_ECOMMERCE = 'ecommerceOrder',
SET_CUSTOM_VARIABLE = 'setCustomVariable',
Expand Down
15 changes: 3 additions & 12 deletions src/services/e-commerce/e-commerce.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ export function removeEcommerceItem(products: Product) {
])
}

export function clearEcommerceCart() {
PaqService.push([
TRACK_EVENT.CLEAR_ECOMMERCE_CART,
])
}

export function getEcommerceItems(): Promise<object> {
return new Promise((resolve, reject) => {
try {
Expand Down Expand Up @@ -55,12 +49,9 @@ export function updateEcommerceCart(products: Product[], grandTotal: number | st
]);
}

export function setEcommerceView(productSKU: string, productName?: string, productCategory?: string[], productPrice?: string) {
export function ecommerceProductDetailView(products: Product[]) {
PaqService.push([
TRACK_EVENT.SET_ECOMMERCE_VIEW,
productSKU,
productName,
productCategory,
productPrice
TRACK_EVENT.ECOMMERCE_PRODUCT_DETAIL_VIEW,
products,
]);
}

0 comments on commit 4e475b3

Please sign in to comment.