diff --git a/assets/js/theme/product/recommendations/constants.js b/assets/js/theme/product/recommendations/constants.js index 5873b31199..35c79d6a55 100644 --- a/assets/js/theme/product/recommendations/constants.js +++ b/assets/js/theme/product/recommendations/constants.js @@ -1,4 +1,3 @@ export const NUM_OF_PRODUCTS = 6; export const EVENT_TYPE = 'detail-page-view'; export const SERVICE_CONFIG_ID = 'others-you-may-like-ctr-serving-config'; -export const RECOM_TOKEN_PARAM = 'attributionToken'; diff --git a/assets/js/theme/product/recommendations/recommendations-carousel.js b/assets/js/theme/product/recommendations/recommendations-carousel.js index 033d136613..683eb75d8e 100644 --- a/assets/js/theme/product/recommendations/recommendations-carousel.js +++ b/assets/js/theme/product/recommendations/recommendations-carousel.js @@ -1,6 +1,5 @@ /* eslint-disable indent */ -import { addQueryParams } from './utils'; -import { RECOM_TOKEN_PARAM, NUM_OF_PRODUCTS } from './constants'; +import { NUM_OF_PRODUCTS } from './constants'; function renderPrice(node, themeSettings) { const { price, retailPrice } = node.prices || { price: {} }; @@ -25,10 +24,10 @@ function renderRestrictToLogin() { } function renderCard(node, options) { - const { themeSettings, attributionToken } = options; + const { themeSettings } = options; const categories = node.categories.edges.map(({ node: cNode }) => cNode.name).join(','); - const productUrl = addQueryParams(node.path, { [RECOM_TOKEN_PARAM]: attributionToken }); - const addToCartUrl = addQueryParams(node.addToCartUrl, { [RECOM_TOKEN_PARAM]: attributionToken }); + const productUrl = node.path; + const addToCartUrl = node.addToCartUrl; return `
{ - const { attributionToken, results: products } = response.data.site.apiExtensions.googleRetailApiPrediction; + const { results: products } = response.data.site.apiExtensions.googleRetailApiPrediction; injectRecommendations(products, el, { products, themeSettings, productId, - attributionToken, }); }) .catch(err => { diff --git a/assets/js/theme/product/recommendations/utils.js b/assets/js/theme/product/recommendations/utils.js index 9bf7a59db7..b96647641e 100644 --- a/assets/js/theme/product/recommendations/utils.js +++ b/assets/js/theme/product/recommendations/utils.js @@ -1,13 +1,3 @@ -export function addQueryParams(url, params = {}) { - const keys = Object.keys(params); - if (!keys.length) return url; - const newParams = keys - .reduce((acc, key) => - acc.concat([`${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`]), []) - .join('&'); - return (url || '').indexOf('?') === -1 ? `${url}?${newParams}` : `${url}&${newParams}`; -} - export function getSizeFromThemeSettings(setting) { const size = (setting || '').split('x'); return {