{"product_id":"245a72b3-b522-44b1-af4e-22f457a98616","title":"Women's Vintage Art Print Casual Short Sleeve Top","description":" \u003ch3\u003e Description \u003c\/h3\u003e \u003cspz-accordion animate=\"\" data-full-width=\"true\" i-spzhtml-layout=\"container\" layout=\"container\"\u003e\n\u003ch4 style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eProduct Details:\u003c\/strong\u003e\u003c\/h4\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eProduct ID:\u003c\/strong\u003eBVBCGZ76KFH\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eGender:\u003c\/strong\u003e For Women\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eStyle:\u003c\/strong\u003e Casual\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eFit Type:\u003c\/strong\u003eRegular\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eShirt Length:\u003c\/strong\u003e Regular\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eSleeves Length:\u003c\/strong\u003e Short Sleeve\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eCollar:\u003c\/strong\u003e Shirt Collar\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eMaterial:\u003c\/strong\u003e 100%Cotton \u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eMaterial Stretch:\u003c\/strong\u003e NO Stretch\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003ePattern Type:\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eWeight:\u003c\/strong\u003e 0.3kg\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003ePackage:\u003c\/strong\u003e 1 x shirt\u003c\/p\u003e\n\u003ch3\u003eSize Guide For Women\u003c\/h3\u003e\n\u003ctable style=\"width: 100%;table-layout: fixed;height:0\"\u003e\n\u003ccolgroup contenteditable=\"false\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003c\/colgroup\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eSize\u003c\/th\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eUK\u003c\/th\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eUS\u003c\/th\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eEUR\u003c\/th\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eLength\u003c\/th\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eChest\u003c\/th\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eHip\u003c\/th\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eS\u003c\/td\u003e\n\u003ctd\u003e8~10\u003c\/td\u003e\n\u003ctd\u003e4~6\u003c\/td\u003e\n\u003ctd\u003e34~36\u003c\/td\u003e\n\u003ctd\u003e64\u003c\/td\u003e\n\u003ctd\u003e102\u003c\/td\u003e\n\u003ctd\u003e104\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eM\u003c\/td\u003e\n\u003ctd\u003e12~14\u003c\/td\u003e\n\u003ctd\u003e8~10\u003c\/td\u003e\n\u003ctd\u003e38~40\u003c\/td\u003e\n\u003ctd\u003e65\u003c\/td\u003e\n\u003ctd\u003e108\u003c\/td\u003e\n\u003ctd\u003e110\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eL\u003c\/td\u003e\n\u003ctd\u003e16\u003c\/td\u003e\n\u003ctd\u003e12\u003c\/td\u003e\n\u003ctd\u003e42~44\u003c\/td\u003e\n\u003ctd\u003e66\u003c\/td\u003e\n\u003ctd\u003e114\u003c\/td\u003e\n\u003ctd\u003e116\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eXL\u003c\/td\u003e\n\u003ctd\u003e18\u003c\/td\u003e\n\u003ctd\u003e14\u003c\/td\u003e\n\u003ctd\u003e46\u003c\/td\u003e\n\u003ctd\u003e67\u003c\/td\u003e\n\u003ctd\u003e120\u003c\/td\u003e\n\u003ctd\u003e122\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e2XL\u003c\/td\u003e\n\u003ctd\u003e20\u003c\/td\u003e\n\u003ctd\u003e16~18\u003c\/td\u003e\n\u003ctd\u003e48\u003c\/td\u003e\n\u003ctd\u003e68\u003c\/td\u003e\n\u003ctd\u003e130\u003c\/td\u003e\n\u003ctd\u003e132\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e3XL\u003c\/td\u003e\n\u003ctd\u003e26\u003c\/td\u003e\n\u003ctd\u003e20~22\u003c\/td\u003e\n\u003ctd\u003e50~52\u003c\/td\u003e\n\u003ctd\u003e69\u003c\/td\u003e\n\u003ctd\u003e140\u003c\/td\u003e\n\u003ctd\u003e142\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003c\/tbody\u003e\n\u003c\/table\u003e\n\n\u003cp\u003e\u003cspz-img layout=\"intrinsic\" auto-fit=\"\" alt=\"example\" data-href=\"\" height=\"1976\" i-spzhtml-layout=\"intrinsic\" src=\"https:\/\/img.staticdj.com\/2c6701ebd42f9ab184bdbcb42687b706.jpeg\" style=\"\" width=\"4398\"\u003e\u003c\/spz-img\u003e\u003ci-spzhtml-sizer slot=\"i-spzhtml-svc\"\u003e\u003cspz-img layout=\"intrinsic\" alt=\"\" aria-hidden=\"true\" role=\"presentation\" src='data:image\/svg+xml;charset=utf-8,\u0026lt;svg%20height=\"1976px\"%20width=\"4398px\"%20xmlns=\"http:\/\/www.w3.org\/2000\/svg\"%20version=\"1.1\"\/\u0026gt;'\u003e\u003c\/spz-img\u003e\u003c\/i-spzhtml-sizer\u003e\u003c\/p\u003e\n\u003ch4 style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eProduct Details:\u003c\/strong\u003e\u003c\/h4\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eProduct ID:\u003c\/strong\u003eBVBCGZ76KFH\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eGender:\u003c\/strong\u003e For Women\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eStyle:\u003c\/strong\u003e Casual\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eFit Type:\u003c\/strong\u003eRegular\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eShirt Length:\u003c\/strong\u003e Regular\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eSleeves Length:\u003c\/strong\u003e Short Sleeve\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eCollar:\u003c\/strong\u003e Shirt Collar\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eMaterial:\u003c\/strong\u003e 100%Cotton \u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eMaterial Stretch:\u003c\/strong\u003e NO Stretch\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003ePattern Type:\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003eWeight:\u003c\/strong\u003e 0.3kg\u003c\/p\u003e\n\u003cp style=\"text-align: left; line-height: 1;\"\u003e\u003cstrong\u003ePackage:\u003c\/strong\u003e 1 x shirt\u003c\/p\u003e\n\u003ch3\u003eSize Guide For Women\u003c\/h3\u003e\n\u003ctable style=\"width: 100%;table-layout: fixed;height:0\"\u003e\n\u003ccolgroup contenteditable=\"false\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003ccol width=\"90\"\u003e\n\u003c\/colgroup\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eSize\u003c\/th\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eUK\u003c\/th\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eUS\u003c\/th\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eEUR\u003c\/th\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eLength\u003c\/th\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eChest\u003c\/th\u003e\n\u003cth colspan=\"1\" rowspan=\"1\" style=\"\" width=\"auto\"\u003eHip\u003c\/th\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eS\u003c\/td\u003e\n\u003ctd\u003e8~10\u003c\/td\u003e\n\u003ctd\u003e4~6\u003c\/td\u003e\n\u003ctd\u003e34~36\u003c\/td\u003e\n\u003ctd\u003e\u003cspz-render i-spzhtml-layout=\"container\" id=\"relative-product-render\" items=\"data.products\" layout=\"container\" src=\"\/api\/product\/similar-products?product_id=ed95e736-46a9-4351-ae81-e74895834f8f\u0026amp;page=1\u0026amp;per_page=8\"\u003e\u003ctemplate\u003e\u003ch3\u003e You may also like \u003c\/h3\u003e\n\u003cspz-carousel advance-count=\"(min-width:960px) 1, 1\" controls=\"\" effect=\"scroller\" id=\"recommendations_carousel\" initial-slide=\"0\" layout=\"container\" visible-count=\"(min-width:960px) 4, 2.4\"\u003e\u003cspz-product-snippet : data-source-id=\"relative-product-render\" layout=\"container\" product-id=\"${item.id}\" template=\"product-snippet-template\" thumb-max-num=\"3\" variant-thumb-names=\"color\"\u003e\u003c\/spz-product-snippet\u003e\u003c\/spz-carousel\u003e\u003c\/template\u003e\u003c\/spz-render\u003e\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003c\/tbody\u003e\n\u003c\/table\u003e\n\u003cspz-recently-viewed count=\"8\" i-spzhtml-layout=\"container\" layout=\"container\" list-id=\"recently-view-render\" product-id=\"ed95e736-46a9-4351-ae81-e74895834f8f\"\u003e\u003c\/spz-recently-viewed\u003e\u003cspz-render i-spzhtml-layout=\"container\" id=\"recently-view-render\" items=\"data.list\" layout=\"container\" manual=\"\" src=\"\/api\/product\/list?page=1\u0026amp;limit=8\"\u003e\u003ctemplate\u003e\u003ch3\u003e Recently Viewed \u003c\/h3\u003e\n\u003cspz-carousel advance-count=\"(min-width:960px) 1, 1\" controls=\"\" effect=\"scroller\" id=\"recently_view_carousel\" initial-slide=\"0\" layout=\"container\" visible-count=\"(min-width:960px) 4, 2.4\"\u003e\u003cspz-product-snippet : data-source-id=\"recently-view-render\" layout=\"container\" product-id=\"${item.id}\" template=\"product-snippet-template\" thumb-max-num=\"3\" variant-thumb-names=\"color\"\u003e\u003c\/spz-product-snippet\u003e\u003c\/spz-carousel\u003e\u003c\/template\u003e\u003c\/spz-render\u003e\u003cljs-render i-spzhtml-layout=\"container\" id=\"smart_recommend_block\" layout=\"container\" manual=\"\"\u003e\u003ctemplate data-function=\"() =\u0026gt; { const rules = data.data.rules; return {...data, rules}; }\"\u003e\u003cljs-render id=\"smart_recommend_rule_${rule.id}\" layout=\"container\" manual=\"\" template=\"smart_recommend_grid_template\"\u003e\u003c\/ljs-render\u003e\u003c\/template\u003e\u003c\/ljs-render\u003e\u003cljs-render i-spzhtml-layout=\"container\" id=\"smart_recommend_preview_no_data_placeholder\" layout=\"container\" manual=\"\"\u003e\u003ctemplate data-function=\"() =\u0026gt; { const isCart = data.data.isCart; const isCollection = data.data.isCollection; const isProduct = data.data.isProduct; const isIndex = data.data.isIndex; return {...data, isCart, isCollection, isProduct, isIndex}; }\"\u003eThe items in the shopping cart do not participate in any recommendation rule. Add the participating items to your shopping cart to check the design.This product did not participated in any recommendation rule. Switch to another product to check the design.The items in this collection do not participate in any recommendation rule. Switch the participating items to check the design.The home page do not participate in any recommendation rule. (This prompt would not display on client-side) Recommended Products\u003c\/template\u003e\u003c\/ljs-render\u003e\u003cljs-render i-spzhtml-layout=\"container\" id=\"smart_recommend_product_modal_render\" layout=\"container\" manual=\"\" template=\"smart_recommend_product_modal_template\"\u003e\u003c\/ljs-render\u003e\u003ctemplate id=\"smart_recommend_grid_template\"\u003e ${function(){ const rule = data.data; const quickShopButtonVisible = !rule.config.quick_shop_button_type || rule.config.quick_shop_button_type === 'button'; const getImageHeight = function(image){ const image_size = rule.config.image_size || 0; const imageWidth = image.width || 600; const imageHeight = image.height || 800; let ratio = 0; if(image_size == 0){ ratio = (imageHeight \/ imageWidth).toFixed(2); }else if(image_size == 1){ ratio = 1.5; }else if(image_size == 2){ ratio = 1; }else if(image_size == 3){ ratio = 0.75; } return imageWidth * ratio; }; const toQuery = obj =\u0026gt; Object.keys(obj) .map(k =\u0026gt; Array.isArray(obj[k])  obj[k].map(v =\u0026gt; `${k}[]=${encodeURIComponent(v)}`).join('\u0026amp;') : `${k}=${encodeURIComponent(obj[k])}` ) .join('\u0026amp;'); return ` ${rule.config.title}\u003cul data-spm=\"smart_recommend_${rule.show_type}\" id=\"smart_recommend_rule_ul_${rule.id}\" impr=\"1\" imprevt=\"1\"\u003e\u003cli key=\"product.id\" spz-for=\"(product, productIndex) in rule.products\"\u003e${product.title}\u003cljs-currency layout=\"container\" spz-if=\"${product.min_price_variant.compare_at_price \u0026gt; product.min_price_variant.price ? true : false}\" value=\"${product.min_price_variant.price}\"\u003e\u003c\/ljs-currency\u003e\u003cljs-currency layout=\"container\" spz-if=\"${product.min_price_variant.compare_at_price \u0026lt;= product.min_price_variant.price ? true : false}\" value=\"${product.min_price_variant.price}\"\u003e\u003c\/ljs-currency\u003e\u003cljs-currency layout=\"container\" spz-if=\"${product.min_price_variant.compare_at_price \u0026gt; product.min_price_variant.price ? true : false}\" value=\"${product.min_price_variant.compare_at_price}\"\u003e\u003c\/ljs-currency\u003e\n\u003c\/li\u003e\u003c\/ul\u003e ` }()}\u003c\/template\u003e\u003ctemplate id=\"smart_recommend_product_image_template\"\u003e\u003cljs-img auto-fit=\"\" height=\"66\" layout=\"fixed\" object-fit=\"contain\" src=\"${data.variant.image%20\u0026amp;\u0026amp;%20data.variant.image.src%20||%20data.product.image.src}\" width=\"66\"\u003e\u003c\/ljs-img\u003e\u003c\/template\u003e\u003ctemplate id=\"smart_recommend_price_template\"\u003e\u003cljs-currency layout=\"container\" value=\"${data.variant.price}\"\u003e\u003c\/ljs-currency\u003e\u003cljs-currency layout=\"container\" spz-if=\"${data.variant.compare_at_price \u0026gt; data.variant.price ? true : false}\" value=\"${data.variant.compare_at_price}\"\u003e\u003c\/ljs-currency\u003e\u003c\/template\u003e\u003cspz-custom-smart-block i-spzhtml-layout=\"container\" id=\"smart_recommend_func\" layout=\"container\"\u003e\u003ctemplate\u003e\u003c\/template\u003e\u003c\/spz-custom-smart-block\u003e\u003cljs-script i-spzhtml-layout=\"logic\" layout=\"logic\" type=\"application\/javascript\"\u003e const isSpecialHeroTheme = window.SHOPLAZZA.theme.merchant_theme_name == 'Hero' \u0026amp;\u0026amp; window.SHOPLAZZA.theme.merchant_theme_c_version == '2.2.19'; const specialHeroThemeClassName = 'hero_2_2_19_smart_recommend_block'; class SpzSmartBlockComponent extends SPZ.BaseElement { constructor(element) { super(element); this.templates_ = null; this.container_ = null; this.i18n_ = {}; this.config_ = {}; this.show_type_ = 3; this.product_resource_id_ = ''; this.collection_resource_id_ = ''; this.cart_items_ = []; this.customer_id_ = ''; this.order_id_ = ''; } static deferredMount() { return false; } isLayoutSupported(layout) { return layout == SPZCore.Layout.CONTAINER; } buildCallback() { const template_type = window.C_SETTINGS.meta.page.template_type; if (template_type === 1) { this.show_type_ = 3; this.product_resource_id_ = window.C_SETTINGS.meta.page.resource_id; } else if (template_type === 2) { this.show_type_ = 4; this.collection_resource_id_ = window.C_SETTINGS.meta.page.resource_id; } else if (template_type === 15){ this.show_type_ = 5; } else if (template_type === 13){ this.show_type_ = 6; } else if (template_type === 20){ this.show_type_ = 7; this.customer_id_ = window.C_SETTINGS.customer.customer_id; } else if (template_type === 35){ this.show_type_ = 8; this.order_id_ = window.location.pathname.split('\/').pop(); } this.templates_ = SPZServices.templatesForDoc(this.element); this.setAction_(); } mountCallback() { const that = this; const themeName = window.C_SETTINGS.theme.merchant_theme_name; const isGeek = \/Geek\/.test(themeName); this.fetchRules().then((res) =\u0026gt; { if (res \u0026amp;\u0026amp; res.rules \u0026amp;\u0026amp; res.rules.length) { const blockEl = document.getElementById('smart_recommend_block'); this.initBlockClass(blockEl); this.initItemClass(blockEl); SPZ.whenApiDefined(blockEl).then((api) =\u0026gt; { api.render({data: res}, true).then(() =\u0026gt; { if (isGeek \u0026amp;\u0026amp; that.show_type_ === 6) { blockEl.querySelector('.plugin_container_wrpper').style.padding = '30px 0'; } const recommendStyle = document.createElement('style'); recommendStyle.innerHTML = ` .plugin__recommend_container,.app-recommend-card { display: none !important; } `; document.head.appendChild(recommendStyle); const fetchList = []; res.rules.forEach((rule) =\u0026gt; { fetchList.push(this.fetchRuleProductList(rule.id)); }); const fetchAll = Promise.all(fetchList); fetchAll.then((p_res) =\u0026gt; { res.rules.forEach((rule, index) =\u0026gt; { rule.products = p_res[index] \u0026amp;\u0026amp; p_res[index].products; if (rule.products \u0026amp;\u0026amp; rule.products.length) { const modalRender = document.getElementById('smart_recommend_js_root'); const $dest = document.getElementById('cart'); const isLifeStyle = \/Life.*Style\/.test(window.C_SETTINGS.theme.merchant_theme_name); if (modalRender \u0026amp;\u0026amp; isLifeStyle \u0026amp;\u0026amp; $dest.clientWidth \u0026gt; 767) { modalRender.classList.add('zb-mt-[-180px]') } } const ruleEl = document.getElementById('smart_recommend_rule_' + rule.id); SPZ.whenApiDefined(ruleEl).then((api) =\u0026gt; { api.render({data: rule}, true).then(() =\u0026gt; { that.impressListen(`#smart_recommend_rule_ul_${rule.id}`, function(){ that.trackRuleImpress(rule); }); const btnElList = document.querySelectorAll(`#smart_recommend_rule_ul_${rule.id} button`); btnElList.forEach((btnEl) =\u0026gt; { if (btnEl \u0026amp;\u0026amp; rule.config \u0026amp;\u0026amp; rule.config.quick_shop_button_bg_color \u0026amp;\u0026amp; rule.config.quick_shop_button_text_color) { btnEl.style.backgroundColor = rule.config.quick_shop_button_bg_color; btnEl.style.color = rule.config.quick_shop_button_text_color; } }); if (isSpecialHeroTheme) { ruleEl.querySelectorAll(`.smart_recommend_title`).forEach(dom=\u0026gt;{ dom.classList.add('type-title-font-family'); }); document.querySelectorAll(`.${specialHeroThemeClassName} #smart_recommend_rule_ul_${rule.id} .zb-recommend-price-line-through .money`).forEach(dom=\u0026gt;{ dom.classList.add('type-body-font-family'); }); }; }); }); }); }); }) }) } else { if (window.top !== window.self) { const template_type = window.C_SETTINGS.meta.page.template_type; const holderEl = document.getElementById('smart_recommend_preview_no_data_placeholder'); SPZ.whenApiDefined(holderEl).then((api) =\u0026gt; { api.render({data: { isCart: template_type === 13, isCollection: template_type === 2, isProduct: template_type === 1, isIndex: template_type === 15 }}, true); }); } } }); } initBlockClass(blockEl) { if (!blockEl) return; if (blockEl.parentElement \u0026amp;\u0026amp; blockEl.parentElement.offsetWidth === document.body.clientWidth) { blockEl.classList.add('smart_recommend_block_fullscreen'); }; if (isSpecialHeroTheme) { blockEl.classList.add(specialHeroThemeClassName); }; } initItemClass(blockEl) { if (blockEl) { const containerWidth = blockEl.offsetWidth; let itemWidth = ''; if (containerWidth \u0026gt; 780) { itemWidth = '16%'; } else if (containerWidth \u0026gt; 600) { itemWidth = '20%'; } else { itemWidth = '24%'; } const itemStyleEl = document.createElement('style'); itemStyleEl.innerHTML = `.zb-recommend-li-item{ width: ${itemWidth}; }`; document.body.appendChild(itemStyleEl); } } setAction_() { this.registerAction('quickShop', (data) =\u0026gt; { const that = this; const product_id = data.args.product_id; const productIndex = data.args.productIndex; const rule_id = data.args.rule_id; const ssp = data.args.ssp; const scm = data.args.scm; const cfb = data.args.cfb; const ifb = data.args.ifb; const modalRender = document.getElementById('smart_recommend_product_modal_render'); if (modalRender) { document.body.appendChild(modalRender); } if (product_id) { this.fetchProductData(product_id).then((res) =\u0026gt; { const product = res.products \u0026amp;\u0026amp; res.products.length \u0026amp;\u0026amp; res.products[0] || {}; product.cfb = cfb; product.ifb = ifb; SPZ.whenApiDefined(modalRender).then((api) =\u0026gt; { api.render({product: product, productIndex: productIndex, rule_id: rule_id, ssp: ssp, scm: scm, show_type: that.show_type_}, true).then(() =\u0026gt; { const modalEl = document.getElementById('smart_recommend_product_modal'); SPZ.whenApiDefined(modalEl).then((modal) =\u0026gt; { that.impressListen('#smart_recommend_product_modal', function(){ that.trackQuickShop({ rule_id: rule_id, product_id: product_id }); }); modal.open(); }); const formEl = document.getElementById('smart_recommend_product_form'); SPZ.whenApiDefined(formEl).then((form) =\u0026gt; { form.setProduct(product); }); const variantEl = document.getElementById('smart_recommend_product_variants'); SPZ.whenApiDefined(variantEl).then((variant) =\u0026gt; { variant.handleRender(product); }); }); }) }); } }); this.registerAction('handleScroll', (data) =\u0026gt; { this.directTo(data.args.rule_id, data.args.direction); }); this.registerAction('handleProductChange', (data) =\u0026gt; { const variant = data.args.data.variant; const product = data.args.data.product; const imageRenderEl = document.getElementById('smart_recommend_product_image'); SPZ.whenApiDefined(imageRenderEl).then((api) =\u0026gt; { api.render({ variant: variant, product: product }); }); }); this.registerAction('handleAtcSuccess', (detail) =\u0026gt; { const data = detail.args; data.data.product = data.data.product || {}; data.data.variant = data.data.variant || {}; const product_id = data.data.product.id; const product_title = data.data.product.title; const variant_id = data.data.variant.id; const price = data.data.variant.price; const rule_id = data.rule_id; const aid = `smart_recommend.${this.show_type_}.${rule_id}`; const ifb = data.data.product.ifb; const cfb = data.data.product.cfb; const ssp = data.ssp; const scm = data.scm; const spm = `smart_recommend_${this.show_type_}.${data.spmIndex}`; const params = { id: product_id, product_id: product_id, number: 1, name: product_title, variant_id: variant_id, childrenId: variant_id, item_price: price, source: 'add_to_cart', _extra: { aid: aid, ifb: ifb, cfb: cfb, scm: scm, spm: `..${window.C_SETTINGS.meta.page.template_name}.${spm}`, ssp: ssp, } }; this.tranckAddToCart(params); }); this.registerAction('addATCHook', (data) =\u0026gt; { const params = data.args; const spm = `smart_recommend_${this.show_type_}.${params.spmIndex}`; this.myInterceptor_ = window.djInterceptors \u0026amp;\u0026amp; window.djInterceptors.track.use({ event: 'dj.addToCart', params: { aid: `smart_recommend.${this.show_type_}.` + params.rule_id, ssp: params.ssp, scm: params.scm, cfb: params.cfb, spm: `..${window.C_SETTINGS.meta.page.template_name}.${spm}`, }, once: true }); }); } tranckAddToCart(detail) { if (window.$) { window.$(document.body).trigger('dj.addToCart', detail); } } fetchRules() { const payload = { show_type: this.show_type_, }; let that = this; if (this.show_type_ === 6) { let line_items = []; return this.fetchCart().then((res) =\u0026gt; { if (res \u0026amp;\u0026amp; res.cart \u0026amp;\u0026amp; res.cart.line_items) { line_items = res.cart.line_items.map((item) =\u0026gt; { return { product_id: item.product_id, variant_id: item.variant_id, quantity: item.quantity, price: item.price } }); } payload.line_items = line_items; that.cart_items_ = line_items; return that.fetchRulesRequest(payload); }); } else { if (this.show_type_ === 3) { payload.line_items = [{ product_id: this.product_resource_id_ }]; } else if (this.show_type_ === 4) { payload.collection_id = this.collection_resource_id_; } else if (this.show_type_ === 7) { payload.customer_id = this.customer_id_; } else if (this.show_type_ === 8) { payload.order_id = this.order_id_; } return this.fetchRulesRequest(payload); } } fetchRulesRequest(payload) { return fetch(window.C_SETTINGS.routes.root + \"\/api\/possum\/recommend_query\", { method: \"POST\", headers: { \"Content-Type\": \"application\/json\" }, body: JSON.stringify(payload) }).then(function(res){ if(res.ok){ return res.json(); } }); } fetchCart() { return fetch(`\/api\/cart\/cart-selectr=${Math.random().toString(36).slice(-4)}`) .then((res) =\u0026gt; { if (res.ok) { return res.json(); } }); } fetchRuleProductList(rule_id) { const payload = { page: 1, limit: 100, fields: [\"title\", \"url\", \"image\", \"min_price_variant.price\", \"min_price_variant.compare_at_price\"], rule_id: rule_id, }; if (this.show_type_ === 3) { payload.line_items = [{ product_id: this.product_resource_id_ }]; } else if (this.show_type_ === 4) { payload.collection_id = this.collection_resource_id_; } else if (this.show_type_ === 6) { payload.line_items = this.cart_items_; } else if (this.show_type_ === 7) { payload.customer_id = this.customer_id_; } else if (this.show_type_ === 8) { payload.order_id = this.order_id_; } return fetch(window.C_SETTINGS.routes.root + \"\/api\/possum\/recommend_products\", { method: \"POST\", headers: { \"Content-Type\": \"application\/json\" }, body: JSON.stringify(payload) }).then(function(res){ if(res.ok){ return res.json(); } }).catch(function(err){ console.log(err); }); } fetchProductData(product_id) { return fetch(window.C_SETTINGS.routes.root + \"\/api\/possum\/products\", { method: \"POST\", headers: { \"Content-Type\": \"application\/json\" }, body: JSON.stringify({ product_ids: [product_id], fields: [ \"images\", \"options\", \"min_price_variant\", \"variants\"] }) }).then(function(res){ if(res.ok){ return res.json(); } }).catch(function(err){ console.log(err); const loadingEl = document.getElementById('smart_recommend_loading'); if (loadingEl) { loadingEl.style.display = 'none'; } }); } getStyle(ele, style) { if (!ele) return; if (window.getComputedStyle) { return window.getComputedStyle(ele)[style]; } return ele.currentStyle[style]; } directTo(id, direction) { const scrollElement = document.getElementById(`smart_recommend_rule_ul_${id}`); const blockWidth = parseInt(this.getStyle(scrollElement, 'width')); const scrollLength = (blockWidth * 0.19 - 12) * 5; const scrollPoint = scrollElement.scrollWidth - scrollElement.clientWidth; if (!scrollElement) return; if (direction === 'left') { if (document.dir === 'rtl') { scrollElement.scrollTo({ left: Math.abs(scrollElement.scrollLeft) \u0026gt;= scrollPoint - 100  0 : scrollElement.scrollLeft - scrollLength, behavior: 'smooth' }); return; } scrollElement.scrollTo({ left: Math.max(scrollElement.scrollLeft - scrollLength, 0), behavior: 'smooth' }); } else { if (document.dir === 'rtl') { scrollElement.scrollTo({ left: Math.abs(scrollElement.scrollLeft) \u0026gt;= scrollPoint + 100  0 : scrollElement.scrollLeft + scrollLength, behavior: 'smooth' }); return; } scrollElement.scrollTo({ left: scrollElement.scrollLeft \u0026gt;= scrollPoint - 100  0 : scrollElement.scrollLeft + scrollLength, behavior: 'smooth' }); } } trackRuleImpress(rule) { if (window.sa \u0026amp;\u0026amp; window.sa.track) { window.sa.track(\"plugin_common\", { plugin_name: \"upsell\", event_type: \"impressions\", rule_id: rule.id, ssp: rule.ssp, scm: rule.scm, show_type: this.show_type_, support_app_block: window.C_SETTINGS.theme.support_app_block }); window.sa.track(\"module_impressions\", { aid: `smart_recommend.${this.show_type_}.${rule.id}`, support_app_block: window.C_SETTINGS.theme.support_app_block }); } } trackQuickShop(data) { window.sa \u0026amp;\u0026amp; sa.track \u0026amp;\u0026amp; sa.track(\"plugin_common\", { plugin_name: \"upsell\", event_type: \"quick_shop\", rule_id: data.rule_id, product_id: data.product_id, show_type: this.show_type_, }); } impressListen(selector, cb) { const el = document.querySelector(selector); const onImpress = (e) =\u0026gt; { if (e) { e.stopPropagation(); } cb(); }; if (el \u0026amp;\u0026amp; !el.getAttribute('imprsd')) { el.addEventListener('impress', onImpress) } else if (el) { onImpress(); } } } SPZ.defineElement('spz-custom-smart-block', SpzSmartBlockComponent);\u003c\/ljs-script\u003e\u003ctemplate id=\"smart_recommend_product_modal_template\"\u003e ${(function(){ const product = data.product; const toQuery = obj =\u0026gt; Object.keys(obj) .map(k =\u0026gt; Array.isArray(obj[k])  obj[k].map(v =\u0026gt; `${k}[]=${encodeURIComponent(v)}`).join('\u0026amp;') : `${k}=${encodeURIComponent(obj[k])}` ) .join('\u0026amp;'); return ` \u003cljs-lightbox id=\"smart_recommend_product_modal\" impr=\"1\" imprevt=\"1\" layout=\"nodisplay\" unclose-in-focus=\"\"\u003e\u003cljs-carousel value='true,isScrollIntoView=true);\"' effect=\"scroller\" height=\"800\" id=\"smart_recommend_carousel\" initial-slide=\"0\" layout=\"responsive\" loop=\"\" width=\"640\"\u003e ${product.images.map((image) =\u0026gt; { return `\u003cljs-img height=\"800\" layout=\"responsive\" object-fit=\"cover\" src=\"${image.src}\" width=\"640\"\u003e\u003c\/ljs-img\u003e` }).join('')} \u003c\/ljs-carousel\u003e\u003cljs-selector animate='true);\"' id=\"smart_recommend_selector\" layout=\"container\" spz-if=\"${product.images.length\u0026gt;1}\"\u003e\u003cljs-img alt=\"${image.alt}\" auto-fit=\"\" height=\"72\" layout=\"fixed\" object-fit=\"cover\" option=\"${index}\" spz-for=\"(image, index) in product.images\" src=\"${image.src}\" width=\"72\"\u003e\u003c\/ljs-img\u003e\u003c\/ljs-selector\u003e\u003cljs-product-form duration='1000);\"' id=\"smart_recommend_product_form\" layout=\"container\" product-id=\"${product.id}\" variant-id=\"${product.min_price_variant.id}\"\u003e\u003cform\u003e\n\u003cljs-render id=\"smart_recommend_product_image\" layout=\"container\" manual=\"\" template=\"smart_recommend_product_image_template\"\u003e\u003c\/ljs-render\u003e${product.title}\u003cspz-render id=\"smart_recommend_modal_price\" layout=\"container\" manual=\"\" template=\"smart_recommend_price_template\"\u003e\u003cljs-currency layout=\"container\" value=\"${product.min_price_variant.price}\"\u003e\u003c\/ljs-currency\u003e\u003cljs-currency layout=\"container\" spz-if=\"${product.min_price_variant.compare_at_price \u0026gt; product.min_price_variant.price ? true : false}\" value=\"${product.min_price_variant.compare_at_price}\"\u003e\u003c\/ljs-currency\u003e\u003c\/spz-render\u003e\u003cljs-variants disabled-dj-event=\"\" id=\"smart_recommend_product_variants\" interference=\"\" layout=\"container\" slide=\"smart_recommend_carousel\" template=\"smart_recommend_product_variant_template\"\u003e\u003c\/ljs-variants\u003eQuantity\u003cljs-quantity disabled-dj-event=\"\" height=\"52\" icon-class=\"!zb-p-3\" input-class=\"!zb-text-[1rem]\/[42px] !zb-bg-[#fff]\" layout=\"fixed\" max=\"999999\" min=\"1\" value=\"1\" width=\"250\"\u003e\u003c\/ljs-quantity\u003e\n\u003c\/form\u003e\u003c\/ljs-product-form\u003e\u003c\/ljs-lightbox\u003e`; })()}\u003c\/template\u003e\u003ctemplate id=\"smart_recommend_product_variant_template\"\u003e ${(function(){ const product = data.product; const avail_variants = product.variants.filter(function(variant){ return variant.available; }); const selected_variant = product.min_price_variant.available  product.min_price_variant : avail_variants.length \u0026amp;\u0026amp; avail_variants[0]; return ` \u003cfieldset key=\"option.name\" name=\"${option.name}\" spz-for=\"(option, optionIndex) in product.options\"\u003e\n\u003clegend\u003e${option.name}\u003c\/legend\u003e ${ option.values.map(function(value, index){ const checked = selected_variant[\"option\"+option.position] == value  \"checked\": \"\"; return ` \u003cinput form=\"smart_recommend_product_form_${product.id}\" id=\"smart_recommend_${product.id}_${optionIndex}_${index}\" name=\"smart_recommend_${product.id}_${optionIndex}\" option=\"${value}\" type=\"radio\" value=\"${value}\"\u003e\u003clabel for=\"smart_recommend_${product.id}_${optionIndex}_${index}\"\u003e ${value} \u003c\/label\u003e ` }).join(\"\") } \u003c\/fieldset\u003e ` })()} \u003c\/template\u003e\u003cljs-loading hidden=\"\" i-spzhtml-layout=\"nodisplay\" id=\"smart_recommend_loading\" layout=\"nodisplay\" style=\"display: none\"\u003e\u003c\/ljs-loading\u003e\u003cljs-toast hidden=\"\" i-spzhtml-layout=\"nodisplay\" id=\"smart_recommend_toast\" layout=\"nodisplay\" style=\"display: none\"\u003e\u003c\/ljs-toast\u003e\u003c\/spz-accordion\u003e","brand":"Magnamaya","offers":[{"title":"Multicolor \/ XL","offer_id":67984191455268,"sku":"245a72b3-b522-44b1-af4e-22f457a98616","price":35.99,"currency_code":"USD","in_stock":true},{"title":"Multicolor \/ S","offer_id":67984191488036,"sku":"245a72b3-b522-44b1-af4e-22f457a98616","price":35.99,"currency_code":"USD","in_stock":true},{"title":"Multicolor \/ M","offer_id":67984191520804,"sku":"245a72b3-b522-44b1-af4e-22f457a98616","price":35.99,"currency_code":"USD","in_stock":true},{"title":"Multicolor \/ L","offer_id":67984191553572,"sku":"245a72b3-b522-44b1-af4e-22f457a98616","price":35.99,"currency_code":"USD","in_stock":true},{"title":"Multicolor \/ 5XL","offer_id":67984191586340,"sku":"245a72b3-b522-44b1-af4e-22f457a98616","price":35.99,"currency_code":"USD","in_stock":true},{"title":"Multicolor \/ 4XL","offer_id":67984191619108,"sku":"245a72b3-b522-44b1-af4e-22f457a98616","price":35.99,"currency_code":"USD","in_stock":true},{"title":"Multicolor \/ 3XL","offer_id":67984191651876,"sku":"245a72b3-b522-44b1-af4e-22f457a98616","price":35.99,"currency_code":"USD","in_stock":true},{"title":"Multicolor \/ 2XL","offer_id":67984191684644,"sku":"245a72b3-b522-44b1-af4e-22f457a98616","price":35.99,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0819\/8527\/3892\/files\/89a6cfae1276de8f181219a5e69ec088.webp?v=1793635629","url":"https:\/\/www.wooowlook.com\/products\/245a72b3-b522-44b1-af4e-22f457a98616","provider":"Wooowlook","version":"1.0","type":"link"}