/* Add custom Js code below */ // Retrieve the data attributes from the HTML element var productCardPropsElem = document.getElementById('productCardPropsElem'); var hoverStyle = productCardPropsElem.dataset.hoverStyle; var roundedCards = productCardPropsElem.dataset.roundedCards; var quickViewLabel = productCardPropsElem.dataset.quickviewLabel; var bgSize = productCardPropsElem.dataset.sliderBgSize; var inStockLabel = productCardPropsElem.dataset.instockLabel; var boxIcon = productCardPropsElem.dataset.boxIcon; var boxIconWhite = productCardPropsElem.dataset.boxIconWhite; var miniCards = productCardPropsElem.dataset.miniCards; var primaryButtons = !!productCardPropsElem.dataset.primaryButtons || false; var productPromoBg = productCardPropsElem.dataset.productPromoBg; var isDark = !!productCardPropsElem.dataset.isDark || false; var hideCountdown = !!productCardPropsElem.dataset.hideCountdown || false; var hideRatings = !!productCardPropsElem.dataset.hideRatings || false; var showDiscount = !!productCardPropsElem.dataset.showDiscount || false; var showSubtitle = !!productCardPropsElem.dataset.showSubtitle || false; var showTags = !!productCardPropsElem.dataset.showTags || false; var mobileEnhancedAddBtn = !!productCardPropsElem.dataset.mobileEnhancedAddBtn || false; var showRating = !!productCardPropsElem.dataset.showRating || false; var showNormalCountdown = !!productCardPropsElem.dataset.showNormalCountdown || false; var hideCountdownLabels = !!productCardPropsElem.dataset.hideCountdownLabels || false; // Define the productCardProps object window.productCardProps = { hover_style: hoverStyle, rounded_cards: roundedCards, quick_view_label: quickViewLabel, mini_cards: miniCards, primaryButtons: primaryButtons, product_promo_bg: productPromoBg, hideCountdown: hideCountdown, hideRatings: hideRatings, showDiscount: showDiscount, showSubtitle: showSubtitle, mobileEnhancedAddBtn: mobileEnhancedAddBtn, showTags: showTags, showRating: showRating, showNormalCountdown: showNormalCountdown, hideCountdownLabels: hideCountdownLabels }; window.quickViewProps = { bgSize: bgSize, boxIcon: boxIcon, boxIconWhite: boxIconWhite, inStockLabel: inStockLabel, product_promo_bg: productPromoBg, isDark: isDark, hideCountdown: hideCountdown, hideRatings: hideRatings }; if (localStorage.getItem('promotionBanner') === 'hidden') { document.querySelector('.promotion-banner')?.classList.add('hidden'); document.querySelector('body')?.classList.add('promotion-banner-hidden'); } else { document.querySelector('.promotion-banner')?.classList.remove('hidden'); document.querySelector('body')?.classList.remove('promotion-banner-hidden'); } window.renderOptIn = function() { window.gapi.load('surveyoptin', function() { window.gapi.surveyoptin.render( { // REQUIRED FIELDS "merchant_id": 5327732342, "order_id": "ORDER_ID", "email": "CUSTOMER_EMAIL", "delivery_country": "COUNTRY_CODE", "estimated_delivery_date": "YYYY-MM-DD", // OPTIONAL FIELDS "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}] }); }); } window.renderBadge = function() { var ratingBadgeContainer = document.createElement("div"); document.body.appendChild(ratingBadgeContainer); window.gapi.load('ratingbadge', function() { window.gapi.ratingbadge.render(ratingBadgeContainer, {"merchant_id": 5327732342}); }); } fbq('track', 'ViewContent', { content_ids: ['123'], // 'REQUIRED': array of product IDs content_type: 'product', // RECOMMENDED: Either product or product_group based on the content_ids or contents being passed. });