${(function(){ const get_random_six_digits = () => { return Math.random().toString().slice(-6) }; const wholesale_enabled = false; const setting_product_image_display = "100%"; const product_image = data.image; const secondary_image = data.secondImage; const image_width = product_image.width | 600; let image_height = product_image.height | 600; if(setting_product_image_display == '100%'){ image_height = image_width }else if(setting_product_image_display == '133.33%'){ image_height = image_width * 1.3333; }; let product_image_hover_on = false; if(secondary_image.src){ product_image_hover_on = true; } const has_save_label = true && ((+data.compare_at_price) > (+data.price)); const is_single_variant = data.variants.length == 1; const min_price_variant_href = (data.min_price_variant && data.min_price_variant.available) ? data.min_price_variant.withinUrl : data.withinUrl; const retail_price_max = data.retail_price_max || data.compare_at_price_max; const THUMBNAILS_MAX_SIZE = 3; const thumbnails = data.thumbVariants.slice(0, THUMBNAILS_MAX_SIZE); const image_wrap_id = 'image_wrap_' + get_random_six_digits(); const image_carousel_id = 'image_carousel_' + get_random_six_digits(); const thumbnails_selector_id = 'thumbnails_selector_' + get_random_six_digits(); const form_id = 'form_' + get_random_six_digits() + ""; const mixed_wholesale = data.mixed_wholesale; return `
${ data.available ? `${ (+data.compare_at_price > +data.price) ? `Save ${ data.off_ratio }% ` : '' }` : "SOLD OUT" }
Mixed Lot
${data.title}
${ data.price_min != data.price_max ? `from
` : `
` }
` })()}
class SpzCustomLabelScript extends SPZ.BaseElement { constructor(element) { super(element); } isLayoutSupported(layout) { return true; } mountCallback() { const script = this.element; const boxEl = script.closest('.product_snippet_label_area'); const labelEl = boxEl.querySelector('.product_snippet__label'); if(!labelEl) return; const observer = new ResizeObserver((entries) => { const labelEls = boxEl.querySelectorAll('.product_snippet__label'); const offsetWidth = Math.max(...Array.from(labelEls).map(el => el.offsetWidth)); if(offsetWidth>0){ const padding = offsetWidth / 2 + 8 + 'px'; boxEl.style.left = padding; boxEl.style.right = padding; boxEl.style.visibility = 'visible'; } }); observer.observe(labelEl); } } SPZ.defineElement('spz-custom-label-script', SpzCustomLabelScript);
(function () { class SPZCustomEventTrack extends SPZ.BaseElement { constructor(element) { super(element); this.action_ = SPZServices.actionServiceForDoc(this.element); } isLayoutSupported(layout) { return true; } buildCallback() { this.setupAction_(); } track(key, value) { console.log('tracking...', key, value); if(window.sa){ window.sa.track(key, value); }else{ let sa = null; Object.defineProperty(window, 'sa',{ get: function() { return sa; }, set(val){ sa = val; sa.track(key, value); } }) } } setupAction_() { const clickParams = { business_type: 'product_theme', event_name: 'function_click', function_name: 'Farida', plugin_name: 'Farida', template_name: "product", template_type: 1, module: 'online_store', module_type: 'online_store', tab_name: '', card_name: '', event_developer: 'ccbGolumn', event_type: 'click', }; this.registerAction('trackClick', (e) => { const event_info = e.args || {}; this.track('function_click', { ...clickParams, event_info: JSON.stringify(event_info), }); }); this.registerAction('trackExpose', (e) => { const event_info = e.args || {}; this.track('function_expose', { ...clickParams, event_name: 'function_expose', event_type: 'expose', event_info: JSON.stringify(event_info), }); }); } } SPZ.defineElement('spz-custom-event-track', SPZCustomEventTrack); }())
FREE INTERNATIONAL EXPRESS SHIPPING
FREE INTERNATIONAL EXPRESS SHIPPING
${item}
Recently searched
${item}
Hot searches
${item.word}
Results
${item.highlightHtml}
const TAG = 'spz-custom-smart-search-location'; const SMART_PRODUCR_SEARCH_WRAP_CLASSNAME = 'app-smart-product-search-wrap'; const THEME_NAME = window.SHOPLAZZA.theme.merchant_theme_name; const BREAKPOINT = 960; const DELAY = 300; class SpzCustomSmartSearchLocation extends SPZ.BaseElement { constructor(element) { super(element); this.mobileHeaderPluginParentEle = null; } static deferredMount() { return false; } isLayoutSupported(layout) { return layout == SPZCore.Layout.LOGIC; } buildCallback() { this.init(); this.listenerResize(); } init() { // PC-end not load if (this.isDesktop()) { return; } if (!window.__isLoadAppSmartSearch__) { this.initSmartSearch(); console.log('__isLoadAppSmartSearch__'); } // B-end must reload if (window.self === window.top && !window.__isLoadAppSmartSearch__) { window.__isLoadAppSmartSearch__ = true; } } initSmartSearch() { if (this.hasMobileUpperRightPlugin()) { this.showMobileSmartSearch(); } else { this.addMobileSmartSearch(); } } listenerResize() { window.removeEventListener('resize', window.smartSearchResizeCallback); window.smartSearchResizeCallback = SPZCore.Types.debounce( this.win, () => { this.init(); }, DELAY ); window.addEventListener('resize', window.smartSearchResizeCallback); } isDesktop() { const mediaQueryList = window.matchMedia(`(min-width: ${BREAKPOINT}px)`); return mediaQueryList.matches; } hasMobileUpperRightPlugin() { return !['geek', 'flash', 'boost'].includes(THEME_NAME.toLocaleLowerCase()); } showMobileSmartSearch() { this.mobileHeaderPluginParentEle = this.getMobileHeaderPluginParentEle(); this.setMobileHeaderIconsPluginStyle(this.mobileHeaderPluginParentEle); } getMobileHeaderPluginParentEle() { const MOBILE_HEADER_PLUGIN_PARENT_ELE_MAP = { nova: '.header__mobile #header__plugin-container', hero: '.header__icons .tw-flex.tw-justify-end.tw-items-center.tw-space-x-7', onePage: '.header__mobile #header__plugin-container', wind: '#header-icons .flex.justify-end.items-center', eva: '#header__icons .plugin_content' }; const headerPluginParentSelector = this.combineMultipleSelectors( Object.values(MOBILE_HEADER_PLUGIN_PARENT_ELE_MAP) ); return document.querySelector(headerPluginParentSelector); } setMobileHeaderIconsPluginStyle(pluginParentEle) { if (!pluginParentEle) { return; } const containHidden = pluginParentEle.classList.contains('md:hidden'); const containTwHidden = pluginParentEle.classList.contains('md:tw-hidden'); if (containHidden || containTwHidden) { Array.from(pluginParentEle.children).forEach((pluginElement) => { if (!this.hasSmartSearchPlugin(pluginElement)) { pluginElement.style.display = 'none'; } }); pluginParentEle.classList.remove('md:hidden', 'md:tw-hidden'); } else { const smartSearchPluginElement = Array.from(pluginParentEle.children).find( (pluginElement) => { return this.hasSmartSearchPlugin(pluginElement); } ); smartSearchPluginElement.style.display = 'block'; } } hasSmartSearchPlugin(pluginElement) { return ( pluginElement.classList.contains(`${SMART_PRODUCR_SEARCH_WRAP_CLASSNAME}`) || pluginElement.querySelectorAll(`.${SMART_PRODUCR_SEARCH_WRAP_CLASSNAME}`).length > 0 ); } addMobileSmartSearch() { this.mobileHeaderIconsEle = this.getMobileHeaderIconsEle(); this.smartSearchWrapEle = this.getSmartSearchWrapEle(); this.appendSmartSearchToHeader(); } getMobileHeaderIconsEle() { // Must be the parent element of the plugin const MOBILE_HEADER_ICONS_ELE_MAP = { geek: '#header-mobile-container .flex.items-center.justify-end.flex-shrink-0', flash: '#header-layout .header__icons', boost: '.header__mobile-bottom .tw-flex.tw-items-center.tw-justify-end.tw-flex-1' }; const headerIconsSelector = this.combineMultipleSelectors( Object.values(MOBILE_HEADER_ICONS_ELE_MAP) ); return document.querySelector(headerIconsSelector); } getSmartSearchWrapEle() { const smartSearchWrapEle = document.querySelector(this.getSmartSearchWrapSelector()); if (!smartSearchWrapEle) { return null; } return smartSearchWrapEle; } appendSmartSearchToHeader() { if (!this.smartSearchWrapEle) { return; } this.mobileHeaderIconsEle.insertAdjacentElement('afterbegin', this.smartSearchWrapEle); } getSmartSearchWrapSelector() { const PLUGIN_POSITION = { DRAWER: 'drawer', HEADER_TOP: 'headerTop' }; // only one this plugin of ancestor element const MOBILE_PLUGIN_POSITION_ELE_MAP = { [PLUGIN_POSITION.DRAWER]: { geek: '#header-menu-mobile #menu-drawer', flash: '#menu-drawer .plugin__header-content', boost: '.header__drawer' }, [PLUGIN_POSITION.HEADER_TOP]: { geek: '#header-menu-mobile #menu-drawer', flash: '#menu-drawer .plugin__header-content', boost: '.header-content .logo-wrap' } }; const MbPluginPositionInTheme = [ ...Object.values(MOBILE_PLUGIN_POSITION_ELE_MAP[PLUGIN_POSITION.DRAWER]), ...Object.values(MOBILE_PLUGIN_POSITION_ELE_MAP[PLUGIN_POSITION.HEADER_TOP]) ]; return Object.values(MbPluginPositionInTheme).reduce((pre, ancestor) => { if (pre === '') { return `${ancestor} .app-smart-product-search-wrap`; } if (pre.includes(ancestor)) { return pre; } return `${pre},${ancestor} .app-smart-product-search-wrap`; }, ''); } combineMultipleSelectors(selectorList) { return selectorList.reduce((pre, selector) => { if (pre === '') { return `${selector}`; } if (pre.includes(selector)) { return pre; } return `${pre},${selector}`; }, ''); } } SPZ.defineElement(TAG, SpzCustomSmartSearchLocation);
Log in
Create an account
${data.data && data.data.count}
HOME
ST. PATRICK
RECHARGEABLE
Rechargeable Table Lamp
Rechargeable Wall Light
LAMPS
Table Lamps
Floor Lamps
Crystal Lights
Night Lights
OUTDOOR LIGHTS
CEILING LIGHTS
WALL LIGHTS
HOME DECOR
TABLEWARE
Cups
Trays
Tableware Set
Bowls
Table Runners
Placemats
DECORATIONS
Vases
Photo Frames
HELP
Check Order
FAQs
Contact Us
About Us
Refund Policy
Shipping Policy
MORE LINKS
${(function(){ const formatLinks = (links) => { return links.map(link => { link.tag = tags[link.title.toUpperCase()] || {}; link.target_attr = link.target == '_blank' ? 'target="_blank"' : ''; link.href_attr = link.url ? `href="${link.url}"` : ''; if(link.children && link.children.length){ link.children = formatLinks(link.children); } return link; }) }; const tags = "{}"; let linkList = [ { id: 74222853, title: "HOME", url: "\/", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 74222855, title: "ST. PATRICK", url: "\/collections\/st-patrick", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 74222857, title: "RECHARGEABLE", url: "\/collections\/rechargeable-lamp", target: "", levels: 1, product0: { id: (null) }, children: [ { title: "Rechargeable Table Lamp", url: "\/collections\/rechargeable-table-lamp", target: "", levels: 0, cover: '', children: [ ] }, { title: "Rechargeable Wall Light", url: "\/collections\/rechargeable-wall-light", target: "", levels: 0, cover: '', children: [ ] }, ] }, { id: 74222863, title: "LAMPS", url: "\/collections\/lamps", target: "", levels: 1, product0: { id: (null) }, children: [ { title: "Table Lamps", url: "\/collections\/table-lamps-1i1j", target: "", levels: 0, cover: '', children: [ ] }, { title: "Floor Lamps", url: "\/collections\/floor-lamps", target: "", levels: 0, cover: '', children: [ ] }, { title: "Crystal Lights", url: "\/collections\/crystal-lights", target: "", levels: 0, cover: '', children: [ ] }, { title: "Night Lights", url: "\/collections\/night-lights", target: "", levels: 0, cover: '', children: [ ] }, ] }, { id: 74222873, title: "OUTDOOR LIGHTS", url: "\/collections\/outdoor-lights", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 74222875, title: "CEILING LIGHTS", url: "\/collections\/ceiling-lights", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 74222877, title: "WALL LIGHTS", url: "\/collections\/wall-lights", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 74222879, title: "HOME DECOR", url: "", target: "", levels: 2, product0: { id: (null) }, children: [ { title: "TABLEWARE", url: "\/collections\/tableware", target: "", levels: 1, cover: '', children: [ { title: "Cups", url: "\/collections\/cups", target: "", levels: 0, }, { title: "Trays", url: "\/collections\/trays", target: "", levels: 0, }, { title: "Tableware Set", url: "\/collections\/tableware-set", target: "", levels: 0, }, { title: "Bowls", url: "\/collections\/bowls", target: "", levels: 0, }, { title: "Table Runners", url: "\/collections\/table-runners", target: "", levels: 0, }, { title: "Placemats", url: "\/collections\/placemats", target: "", levels: 0, }, ] }, { title: "DECORATIONS", url: "\/collections\/decorations", target: "", levels: 1, cover: '', children: [ { title: "Vases", url: "\/collections\/vases", target: "", levels: 0, }, { title: "Photo Frames", url: "\/collections\/photo-frames", target: "", levels: 0, }, ] }, ] }, { id: 74222901, title: "HELP", url: "", target: "", levels: 1, product0: { id: (null) }, children: [ { title: "Check Order", url: "\/account\/order-lookup", target: "", levels: 0, cover: '', children: [ ] }, { title: "FAQs", url: "\/pages\/faqs", target: "", levels: 0, cover: '', children: [ ] }, { title: "Contact Us", url: "\/pages\/contact-us1", target: "", levels: 0, cover: '', children: [ ] }, { title: "About Us", url: "\/pages\/about-us1", target: "", levels: 0, cover: '', children: [ ] }, { title: "Refund Policy", url: "\/pages\/refund-policy", target: "", levels: 0, cover: '', children: [ ] }, { title: "Shipping Policy", url: "\/pages\/shipping-policy1", target: "", levels: 0, cover: '', children: [ ] }, ] }, ].slice(offset); linkList = formatLinks(linkList); const hasChild = linkList.some(link => !!(link.children && link.children.length || link.product0.id)); for (const item of linkList) { if (item.children?.length > 0) { item.active = 'active'; break; } } return `
${link.title}
${link.tag.label}
${second_link.cover}
${second_link.title}
${second_link.tag.label}
${third_links.title}
${third_links.tag.label}
${link.title}
${link.tag.label}
` })()}
HOME
ST. PATRICK
RECHARGEABLE
Rechargeable Table Lamp
Rechargeable Wall Light
LAMPS
Table Lamps
Floor Lamps
Crystal Lights
Night Lights
OUTDOOR LIGHTS
CEILING LIGHTS
WALL LIGHTS
HOME DECOR
TABLEWARE
Cups
Trays
Tableware Set
Bowls
Table Runners
Placemats
DECORATIONS
Vases
Photo Frames
HELP
Check Order
FAQs
Contact Us
About Us
Refund Policy
Shipping Policy
MORE LINKS
${(function(){ const formatLinks = (links) => { return links.map(link => { link.tag = tags[link.title.toUpperCase()] || {}; link.target_attr = link.target == '_blank' ? 'target="_blank"' : ''; link.href_attr = link.url ? `href="${link.url}"` : ''; if(link.children && link.children.length){ link.children = formatLinks(link.children); } return link; }) }; const tags = "{}"; let linkList = [ { id: 74222853, title: "HOME", url: "\/", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 74222855, title: "ST. PATRICK", url: "\/collections\/st-patrick", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 74222857, title: "RECHARGEABLE", url: "\/collections\/rechargeable-lamp", target: "", levels: 1, product0: { id: (null) }, children: [ { title: "Rechargeable Table Lamp", url: "\/collections\/rechargeable-table-lamp", target: "", levels: 0, cover: '', children: [ ] }, { title: "Rechargeable Wall Light", url: "\/collections\/rechargeable-wall-light", target: "", levels: 0, cover: '', children: [ ] }, ] }, { id: 74222863, title: "LAMPS", url: "\/collections\/lamps", target: "", levels: 1, product0: { id: (null) }, children: [ { title: "Table Lamps", url: "\/collections\/table-lamps-1i1j", target: "", levels: 0, cover: '', children: [ ] }, { title: "Floor Lamps", url: "\/collections\/floor-lamps", target: "", levels: 0, cover: '', children: [ ] }, { title: "Crystal Lights", url: "\/collections\/crystal-lights", target: "", levels: 0, cover: '', children: [ ] }, { title: "Night Lights", url: "\/collections\/night-lights", target: "", levels: 0, cover: '', children: [ ] }, ] }, { id: 74222873, title: "OUTDOOR LIGHTS", url: "\/collections\/outdoor-lights", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 74222875, title: "CEILING LIGHTS", url: "\/collections\/ceiling-lights", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 74222877, title: "WALL LIGHTS", url: "\/collections\/wall-lights", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 74222879, title: "HOME DECOR", url: "", target: "", levels: 2, product0: { id: (null) }, children: [ { title: "TABLEWARE", url: "\/collections\/tableware", target: "", levels: 1, cover: '', children: [ { title: "Cups", url: "\/collections\/cups", target: "", levels: 0, }, { title: "Trays", url: "\/collections\/trays", target: "", levels: 0, }, { title: "Tableware Set", url: "\/collections\/tableware-set", target: "", levels: 0, }, { title: "Bowls", url: "\/collections\/bowls", target: "", levels: 0, }, { title: "Table Runners", url: "\/collections\/table-runners", target: "", levels: 0, }, { title: "Placemats", url: "\/collections\/placemats", target: "", levels: 0, }, ] }, { title: "DECORATIONS", url: "\/collections\/decorations", target: "", levels: 1, cover: '', children: [ { title: "Vases", url: "\/collections\/vases", target: "", levels: 0, }, { title: "Photo Frames", url: "\/collections\/photo-frames", target: "", levels: 0, }, ] }, ] }, { id: 74222901, title: "HELP", url: "", target: "", levels: 1, product0: { id: (null) }, children: [ { title: "Check Order", url: "\/account\/order-lookup", target: "", levels: 0, cover: '', children: [ ] }, { title: "FAQs", url: "\/pages\/faqs", target: "", levels: 0, cover: '', children: [ ] }, { title: "Contact Us", url: "\/pages\/contact-us1", target: "", levels: 0, cover: '', children: [ ] }, { title: "About Us", url: "\/pages\/about-us1", target: "", levels: 0, cover: '', children: [ ] }, { title: "Refund Policy", url: "\/pages\/refund-policy", target: "", levels: 0, cover: '', children: [ ] }, { title: "Shipping Policy", url: "\/pages\/shipping-policy1", target: "", levels: 0, cover: '', children: [ ] }, ] }, ].slice(offset); linkList = formatLinks(linkList); const hasChild = linkList.some(link => !!(link.children && link.children.length || link.product0.id)); for (const item of linkList) { if (item.children?.length > 0) { item.active = 'active'; break; } } return `
${link.title}
${link.tag.label}
${second_link.cover}
${second_link.title}
${second_link.tag.label}
${third_links.title}
${third_links.tag.label}
${link.title}
${link.tag.label}
` })()}
${item}
Recently searched
${item}
Hot searches
${item.word}
Results
${item.highlightHtml}
const TAG = 'spz-custom-smart-search-location'; const SMART_PRODUCR_SEARCH_WRAP_CLASSNAME = 'app-smart-product-search-wrap'; const THEME_NAME = window.SHOPLAZZA.theme.merchant_theme_name; const BREAKPOINT = 960; const DELAY = 300; class SpzCustomSmartSearchLocation extends SPZ.BaseElement { constructor(element) { super(element); this.mobileHeaderPluginParentEle = null; } static deferredMount() { return false; } isLayoutSupported(layout) { return layout == SPZCore.Layout.LOGIC; } buildCallback() { this.init(); this.listenerResize(); } init() { // PC-end not load if (this.isDesktop()) { return; } if (!window.__isLoadAppSmartSearch__) { this.initSmartSearch(); console.log('__isLoadAppSmartSearch__'); } // B-end must reload if (window.self === window.top && !window.__isLoadAppSmartSearch__) { window.__isLoadAppSmartSearch__ = true; } } initSmartSearch() { if (this.hasMobileUpperRightPlugin()) { this.showMobileSmartSearch(); } else { this.addMobileSmartSearch(); } } listenerResize() { window.removeEventListener('resize', window.smartSearchResizeCallback); window.smartSearchResizeCallback = SPZCore.Types.debounce( this.win, () => { this.init(); }, DELAY ); window.addEventListener('resize', window.smartSearchResizeCallback); } isDesktop() { const mediaQueryList = window.matchMedia(`(min-width: ${BREAKPOINT}px)`); return mediaQueryList.matches; } hasMobileUpperRightPlugin() { return !['geek', 'flash', 'boost'].includes(THEME_NAME.toLocaleLowerCase()); } showMobileSmartSearch() { this.mobileHeaderPluginParentEle = this.getMobileHeaderPluginParentEle(); this.setMobileHeaderIconsPluginStyle(this.mobileHeaderPluginParentEle); } getMobileHeaderPluginParentEle() { const MOBILE_HEADER_PLUGIN_PARENT_ELE_MAP = { nova: '.header__mobile #header__plugin-container', hero: '.header__icons .tw-flex.tw-justify-end.tw-items-center.tw-space-x-7', onePage: '.header__mobile #header__plugin-container', wind: '#header-icons .flex.justify-end.items-center', eva: '#header__icons .plugin_content' }; const headerPluginParentSelector = this.combineMultipleSelectors( Object.values(MOBILE_HEADER_PLUGIN_PARENT_ELE_MAP) ); return document.querySelector(headerPluginParentSelector); } setMobileHeaderIconsPluginStyle(pluginParentEle) { if (!pluginParentEle) { return; } const containHidden = pluginParentEle.classList.contains('md:hidden'); const containTwHidden = pluginParentEle.classList.contains('md:tw-hidden'); if (containHidden || containTwHidden) { Array.from(pluginParentEle.children).forEach((pluginElement) => { if (!this.hasSmartSearchPlugin(pluginElement)) { pluginElement.style.display = 'none'; } }); pluginParentEle.classList.remove('md:hidden', 'md:tw-hidden'); } else { const smartSearchPluginElement = Array.from(pluginParentEle.children).find( (pluginElement) => { return this.hasSmartSearchPlugin(pluginElement); } ); smartSearchPluginElement.style.display = 'block'; } } hasSmartSearchPlugin(pluginElement) { return ( pluginElement.classList.contains(`${SMART_PRODUCR_SEARCH_WRAP_CLASSNAME}`) || pluginElement.querySelectorAll(`.${SMART_PRODUCR_SEARCH_WRAP_CLASSNAME}`).length > 0 ); } addMobileSmartSearch() { this.mobileHeaderIconsEle = this.getMobileHeaderIconsEle(); this.smartSearchWrapEle = this.getSmartSearchWrapEle(); this.appendSmartSearchToHeader(); } getMobileHeaderIconsEle() { // Must be the parent element of the plugin const MOBILE_HEADER_ICONS_ELE_MAP = { geek: '#header-mobile-container .flex.items-center.justify-end.flex-shrink-0', flash: '#header-layout .header__icons', boost: '.header__mobile-bottom .tw-flex.tw-items-center.tw-justify-end.tw-flex-1' }; const headerIconsSelector = this.combineMultipleSelectors( Object.values(MOBILE_HEADER_ICONS_ELE_MAP) ); return document.querySelector(headerIconsSelector); } getSmartSearchWrapEle() { const smartSearchWrapEle = document.querySelector(this.getSmartSearchWrapSelector()); if (!smartSearchWrapEle) { return null; } return smartSearchWrapEle; } appendSmartSearchToHeader() { if (!this.smartSearchWrapEle) { return; } this.mobileHeaderIconsEle.insertAdjacentElement('afterbegin', this.smartSearchWrapEle); } getSmartSearchWrapSelector() { const PLUGIN_POSITION = { DRAWER: 'drawer', HEADER_TOP: 'headerTop' }; // only one this plugin of ancestor element const MOBILE_PLUGIN_POSITION_ELE_MAP = { [PLUGIN_POSITION.DRAWER]: { geek: '#header-menu-mobile #menu-drawer', flash: '#menu-drawer .plugin__header-content', boost: '.header__drawer' }, [PLUGIN_POSITION.HEADER_TOP]: { geek: '#header-menu-mobile #menu-drawer', flash: '#menu-drawer .plugin__header-content', boost: '.header-content .logo-wrap' } }; const MbPluginPositionInTheme = [ ...Object.values(MOBILE_PLUGIN_POSITION_ELE_MAP[PLUGIN_POSITION.DRAWER]), ...Object.values(MOBILE_PLUGIN_POSITION_ELE_MAP[PLUGIN_POSITION.HEADER_TOP]) ]; return Object.values(MbPluginPositionInTheme).reduce((pre, ancestor) => { if (pre === '') { return `${ancestor} .app-smart-product-search-wrap`; } if (pre.includes(ancestor)) { return pre; } return `${pre},${ancestor} .app-smart-product-search-wrap`; }, ''); } combineMultipleSelectors(selectorList) { return selectorList.reduce((pre, selector) => { if (pre === '') { return `${selector}`; } if (pre.includes(selector)) { return pre; } return `${pre},${selector}`; }, ''); } } SPZ.defineElement(TAG, SpzCustomSmartSearchLocation);
Log in
Create an account
${data.data && data.data.count}
HOME
ST. PATRICK
RECHARGEABLE
Rechargeable Table Lamp
Rechargeable Wall Light
LAMPS
Table Lamps
Floor Lamps
Crystal Lights
Night Lights
OUTDOOR LIGHTS
CEILING LIGHTS
WALL LIGHTS
HOME DECOR
TABLEWARE
Cups
Trays
Tableware Set
Bowls
Table Runners
Placemats
DECORATIONS
Vases
Photo Frames
HELP
Check Order
FAQs
Contact Us
About Us
Refund Policy
Shipping Policy
${item}
Recently searched
${item}
Hot searches
${item.word}
Results
${item.highlightHtml}
const TAG = 'spz-custom-smart-search-location'; const SMART_PRODUCR_SEARCH_WRAP_CLASSNAME = 'app-smart-product-search-wrap'; const THEME_NAME = window.SHOPLAZZA.theme.merchant_theme_name; const BREAKPOINT = 960; const DELAY = 300; class SpzCustomSmartSearchLocation extends SPZ.BaseElement { constructor(element) { super(element); this.mobileHeaderPluginParentEle = null; } static deferredMount() { return false; } isLayoutSupported(layout) { return layout == SPZCore.Layout.LOGIC; } buildCallback() { this.init(); this.listenerResize(); } init() { // PC-end not load if (this.isDesktop()) { return; } if (!window.__isLoadAppSmartSearch__) { this.initSmartSearch(); console.log('__isLoadAppSmartSearch__'); } // B-end must reload if (window.self === window.top && !window.__isLoadAppSmartSearch__) { window.__isLoadAppSmartSearch__ = true; } } initSmartSearch() { if (this.hasMobileUpperRightPlugin()) { this.showMobileSmartSearch(); } else { this.addMobileSmartSearch(); } } listenerResize() { window.removeEventListener('resize', window.smartSearchResizeCallback); window.smartSearchResizeCallback = SPZCore.Types.debounce( this.win, () => { this.init(); }, DELAY ); window.addEventListener('resize', window.smartSearchResizeCallback); } isDesktop() { const mediaQueryList = window.matchMedia(`(min-width: ${BREAKPOINT}px)`); return mediaQueryList.matches; } hasMobileUpperRightPlugin() { return !['geek', 'flash', 'boost'].includes(THEME_NAME.toLocaleLowerCase()); } showMobileSmartSearch() { this.mobileHeaderPluginParentEle = this.getMobileHeaderPluginParentEle(); this.setMobileHeaderIconsPluginStyle(this.mobileHeaderPluginParentEle); } getMobileHeaderPluginParentEle() { const MOBILE_HEADER_PLUGIN_PARENT_ELE_MAP = { nova: '.header__mobile #header__plugin-container', hero: '.header__icons .tw-flex.tw-justify-end.tw-items-center.tw-space-x-7', onePage: '.header__mobile #header__plugin-container', wind: '#header-icons .flex.justify-end.items-center', eva: '#header__icons .plugin_content' }; const headerPluginParentSelector = this.combineMultipleSelectors( Object.values(MOBILE_HEADER_PLUGIN_PARENT_ELE_MAP) ); return document.querySelector(headerPluginParentSelector); } setMobileHeaderIconsPluginStyle(pluginParentEle) { if (!pluginParentEle) { return; } const containHidden = pluginParentEle.classList.contains('md:hidden'); const containTwHidden = pluginParentEle.classList.contains('md:tw-hidden'); if (containHidden || containTwHidden) { Array.from(pluginParentEle.children).forEach((pluginElement) => { if (!this.hasSmartSearchPlugin(pluginElement)) { pluginElement.style.display = 'none'; } }); pluginParentEle.classList.remove('md:hidden', 'md:tw-hidden'); } else { const smartSearchPluginElement = Array.from(pluginParentEle.children).find( (pluginElement) => { return this.hasSmartSearchPlugin(pluginElement); } ); smartSearchPluginElement.style.display = 'block'; } } hasSmartSearchPlugin(pluginElement) { return ( pluginElement.classList.contains(`${SMART_PRODUCR_SEARCH_WRAP_CLASSNAME}`) || pluginElement.querySelectorAll(`.${SMART_PRODUCR_SEARCH_WRAP_CLASSNAME}`).length > 0 ); } addMobileSmartSearch() { this.mobileHeaderIconsEle = this.getMobileHeaderIconsEle(); this.smartSearchWrapEle = this.getSmartSearchWrapEle(); this.appendSmartSearchToHeader(); } getMobileHeaderIconsEle() { // Must be the parent element of the plugin const MOBILE_HEADER_ICONS_ELE_MAP = { geek: '#header-mobile-container .flex.items-center.justify-end.flex-shrink-0', flash: '#header-layout .header__icons', boost: '.header__mobile-bottom .tw-flex.tw-items-center.tw-justify-end.tw-flex-1' }; const headerIconsSelector = this.combineMultipleSelectors( Object.values(MOBILE_HEADER_ICONS_ELE_MAP) ); return document.querySelector(headerIconsSelector); } getSmartSearchWrapEle() { const smartSearchWrapEle = document.querySelector(this.getSmartSearchWrapSelector()); if (!smartSearchWrapEle) { return null; } return smartSearchWrapEle; } appendSmartSearchToHeader() { if (!this.smartSearchWrapEle) { return; } this.mobileHeaderIconsEle.insertAdjacentElement('afterbegin', this.smartSearchWrapEle); } getSmartSearchWrapSelector() { const PLUGIN_POSITION = { DRAWER: 'drawer', HEADER_TOP: 'headerTop' }; // only one this plugin of ancestor element const MOBILE_PLUGIN_POSITION_ELE_MAP = { [PLUGIN_POSITION.DRAWER]: { geek: '#header-menu-mobile #menu-drawer', flash: '#menu-drawer .plugin__header-content', boost: '.header__drawer' }, [PLUGIN_POSITION.HEADER_TOP]: { geek: '#header-menu-mobile #menu-drawer', flash: '#menu-drawer .plugin__header-content', boost: '.header-content .logo-wrap' } }; const MbPluginPositionInTheme = [ ...Object.values(MOBILE_PLUGIN_POSITION_ELE_MAP[PLUGIN_POSITION.DRAWER]), ...Object.values(MOBILE_PLUGIN_POSITION_ELE_MAP[PLUGIN_POSITION.HEADER_TOP]) ]; return Object.values(MbPluginPositionInTheme).reduce((pre, ancestor) => { if (pre === '') { return `${ancestor} .app-smart-product-search-wrap`; } if (pre.includes(ancestor)) { return pre; } return `${pre},${ancestor} .app-smart-product-search-wrap`; }, ''); } combineMultipleSelectors(selectorList) { return selectorList.reduce((pre, selector) => { if (pre === '') { return `${selector}`; } if (pre.includes(selector)) { return pre; } return `${pre},${selector}`; }, ''); } } SPZ.defineElement(TAG, SpzCustomSmartSearchLocation);
Log in
(function () { let w = window.innerWidth; function setHeaderCssVar() { const headerEle = document.getElementById( "shoplaza-section-header", ); if (!headerEle) { return; } document.body.style.setProperty( "--window-height", `${window.innerHeight}px`, ); document.body.style.setProperty( "--header-height", `${headerEle.clientHeight}px`, ); const mdScorllHideEle = headerEle.querySelector( ".header__mobile .header__scroll_hide", ); if (mdScorllHideEle) { document.body.style.setProperty( "--header-scroll-hide-height-md", `${mdScorllHideEle.clientHeight}px`, ); } const pcScorllHideEle = headerEle.querySelector( ".header__desktop .header__scroll_hide", ); if (pcScorllHideEle) { document.body.style.setProperty( "--header-scroll-hide-height-pc", `${pcScorllHideEle.clientHeight}px`, ); } } function handlResize() { if (w == window.innerWidth) { return; } w = window.innerWidth; setHeaderCssVar(); } function init() { setHeaderCssVar(); window.removeEventListener("resize", window._theme_header_listener); window._theme_header_listener = handlResize; window.addEventListener("resize", window._theme_header_listener); } init(); })();
21/21
${data.index + 1}/${data.total}
21/21
${data.index + 1}/${data.total}
Rechargeable Dimmable Cordless Metal Table Lamp
$99.00
${function() { const variantData = data.variant || {"id":"eccf78c9-ee59-48d1-932e-d4386be39e04","product_id":"96acf278-47b6-45c0-a935-058319e584a1","title":"Brown","weight_unit":"kg","inventory_quantity":0,"sku":"EM-Brown-A00321465","barcode":"","position":3,"option1":"Brown","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/66b748e974bfb17bba7ca9b2f87542b2.jpeg","path":"66b748e974bfb17bba7ca9b2f87542b2.jpeg","width":800,"height":800,"alt":"Rechargeable Dimmable Cordless Metal Table Lamp","aspect_ratio":1},"wholesale_price":[{"price":99,"min_quantity":1}],"weight":"0","compare_at_price":"0","price":"99","retail_price":"0","available":true,"url":"\/products\/rechargeable-dimmable-cordless-metal-table-lamp?variant=eccf78c9-ee59-48d1-932e-d4386be39e04","available_quantity":999999999,"options":[{"name":"Color","value":"Brown"}],"off_ratio":0,"flashsale_info":[],"sales":46}; const saveType = "percentage"; const productLabelDiscountOn = true; const map = { B: `
`, C: `
`, A: `
${saveType == 'percentage' ? `-${variantData.off_ratio}%` : `
-
` }
` } const price_group_arr = ["B","C","A"]; const price_str_arr = price_group_arr.map(type => map[type]); return `
-
${price_str_arr.join('')}
`; }()}
Color:
Brown
${function(){ const optName = "Color"; const optionValue = data.originData.selectData ? data.originData.selectData[optName].value : data.originData.value; const optionValueText = optionValue ? (optionValue) : ''; return `
${optionValueText}
`; }()}
Black
White
Brown
${function(){ const tipText = "Please select a {{ name }}".replace(/\{\{\s+name\s+\}\}/g, data); return `
${tipText}
` }()}