2024 Christmas Building Blocks Advent Calendar

$32.33
$63.69
-$31.36
The current produc does not participate any Rebate. Switch the participating product to check the design.
(This prompt will not be displayed on the client-side.)
if(window.self === window.top) { (window.disabled_exts ||=[]).push('product_detail_rebate'); } class SpzRebateComponent extends SPZ.BaseElement { constructor(element) { super(element); } xhr_ = SPZServices.xhrFor(this.win); viewport_ = this.getViewport(); action_ = null; lang = document.documentElement.lang || 'en-US'; landPage = "\/promotions\/rebate\/"; pageType = 1; cart = []; initData = null; rebateInfo = null; renderData = null; footerImage = `${this.win.SHOPLAZZA["image_domain"]}oss/operation/e8ebb03dbb710457ca3b4b6a70898ab2.svg`; isLayoutSupported(layout) { return layout == SPZCore.Layout.LOGIC; } buildCallback() { this.initData = this.getProduct(); this.action_ = SPZServices.actionServiceForDoc(this.element); this.registerAction("triggerGetRenderData", () => { const event = SPZUtils.Event.create(this.win, "triggerGetRenderData", this.renderData); this.action_.trigger(this.element, "getRenderData", event); }); this.registerAction("bindPropagation", () => { document.querySelector(".product_detail_rebate_list").addEventListener("click", e => { e.stopPropagation(); this.win.sa && this.win.sa.track("plugin_rebate_promotion_click", { plugin_timestamp: Date.now(), plugin_location: "info", product_id: this.initData.product.id, discount_id: this.rebateInfo.discount_list.map((item) => item.discount_id)[0], }); }); }); } async mountCallback() { document.addEventListener("dj.variantChange", e => { const data = e.detail; if (document.querySelector("#product-select-modal.show")) return; if (this.initData && this.initData.product && data.product && this.initData.product.id === data.product.id) { this.initData = data; this.initRebate(this.initData, true); } else { this.initData = data; this.getRebateInfo(); } }); document.addEventListener("dj.addToCart", e => { const v = e.detail; this.rebateInfo && this.win.sa && this.win.sa.track("plugin_rebate_atc", { variant_discount_id: this.getVariantDiscountId(v.variant_id).map(item => item.discount_id), discount_ids: this.rebateInfo.discount_list.map(item => item.discount_id), variant_id: v.variant_id, product_id: v.product_id, price: v.item_price, number: v.number, }); }); await this.getRebateInfo(); if (document.querySelector(".plugin-container__bottom-fixed")) { this.showDiscountPopupsInfoBar(); } else { this.win.addEventListener("extloaded", () => { this.showDiscountPopupsInfoBar(); }); } } getProduct = (() => { document.addEventListener("dj.variantChange", e => { if (!e.detail || !e.detail.product) return; const productJson = document.querySelector("#product-json"); if (productJson && productJson.textContent && JSON.parse(productJson.textContent)) { productJson.textContent = JSON.stringify(e.detail); } if (this.win.jQuery && this.win.jQuery.fn && this.win.jQuery(document).data("djproduct")) { this.win.jQuery(document).data("djproduct", e.detail); } }); return () => { let productData = null; if (this.win.jQuery && this.win.jQuery.fn) { try { let product = this.win.jQuery(document).data("djproduct"); if (product) { productData = JSON.parse(JSON.stringify(product)); } else { productData = null; } } catch (error) { productData = null; } } if (!productData) { const productJson = document.querySelector("#product-json"); productData = (productJson && productJson.textContent && JSON.parse(productJson.textContent)) || null; } return productData; }; })(); initRebate = this.win.SPZCore.Types.debounce( this.win, (async (data, variantChange) => { let discount_list = Object.assign([], this.rebateInfo.discount_list); /* 按子商品的多少对优惠信息进行排序 */ discount_list && discount_list.sort((a, b) => { return b.variant_ids.length - a.variant_ids.length; }); /* 选中子商品时 筛选子商品的优惠信息 */ if (data.selected && data.selected.id) { discount_list = this.getVariantDiscountId(data.selected.id); } /* 无满减信息 */ if (!(discount_list && discount_list.length)) { return; } const isSection = !!document.querySelector( `div[data-section-type^="shoplazza://apps/publicapp/blocks/rebate"] #rebate_custom_component` ); if ( (this.rebateInfo.rebate_type == "sku" && data && data.selected && data.selected.id) || this.rebateInfo.rebate_type == "spu" ) { let nowLandpage = this.landPage; if (discount_list[0]) { nowLandpage = this.landPage + discount_list[0].discount_id || ""; } const info = { rebate: discount_list[0], maxShowCount: this.win.innerWidth > 768 ? 3 : 1, landPage: nowLandpage, modalFooterImg: `url(${`${this.win.SHOPLAZZA["image_domain"]}oss/operation/e8ebb03dbb710457ca3b4b6a70898ab2.svg`})`, }; this.renderData = info; if(isSection) { SPZ.whenApiDefined( document.getElementById("app_rebate_section") ).then(apis => { apis.render(info, true); }); } else { // 重新渲染 抖动问题处理 this.templates_ = SPZServices.templatesForDoc(); const newTplDom = await this.templates_.renderTemplate(document.querySelector('#appRebateBlockTpl'), info) const parentDiv = document.querySelector('#app_rebate_block'); const oldDom = parentDiv.querySelector('.app_rebate_list'); if(oldDom){ parentDiv.replaceChild(newTplDom, oldDom); } else { parentDiv.appendChild(newTplDom); } } } this.insertSlideTag(this.rebateInfo.tag, variantChange); var pluginCurrencyEvent = new CustomEvent("plugin_currency_update"); document.dispatchEvent(pluginCurrencyEvent); }).bind(this), 10 ); getRebateInfo = async () => { if (this.initData && this.initData.product && this.initData.product.id) { var variant_ids = this.initData.product.variants.map(variant => variant.id); const res = await this.xhr_.fetchJson( "\/api\/discount-rebate\/product-discount", { method: "POST", body: { product_id: this.initData.product.id, product_type: this.initData.product.product_type, variant_ids: variant_ids, }, } ); if (!SPZCore.Types.isEmptyObject(res.rebate_info)) { res.rebate_info.tag = res.tag; res.rebate_info.rebate_type = res.rebate_type; this.rebateInfo = res.rebate_info; this.initRebate(this.initData); } else { if (this.win.top !== this.win.self) { const noActivity = document.getElementById("no-rebate-activity"); noActivity && (noActivity["style"].display = "block"); } } } }; getVariantDiscountId = (variant_id) => { if (!variant_id || !this.rebateInfo) return []; var rebateId = this.rebateInfo.variant_discount_map[variant_id]; return this.rebateInfo.discount_list.filter(item => item.discount_id == rebateId) || []; }; insertSlideTag = (tag, variantChange) => { setTimeout(() => { if (tag) { var tag_container; var modal = document.getElementById("product-select-modal"); if (modal && modal.classList.contains("show")) { if (!variantChange && modal.querySelector(".slider-discount-tag")) return; if ( variantChange && modal.querySelector(".slider-discount-tag:not(.rebate-tag)") ) return; tag_container = modal; } else { var product_detail_card = document.querySelector( '.page_container > [data-section-type="product_detail"], .page_container > [data-section-type="product-template"]' ); if(!product_detail_card) return; if (!variantChange && product_detail_card.querySelector(".slider-discount-tag")) return; if (variantChange && product_detail_card.querySelector(".slider-discount-tag:not(.rebate-tag)")) return; tag_container = product_detail_card; } if (tag_container.matches("#product-select-modal") && this.pageType === 13 && document.documentElement.clientWidth < 768) return; const tagDom = `<div class="slider-discount-tag dj_skin_product_title rebate-tag">${tag}</div>` if (document.querySelector(".sep-loaded-slider")) { var loadedSlider = tag_container.querySelector(".sep-loaded-slider"); loadedSlider.querySelectorAll(".slider-discount-tag").forEach(function(element) { element.remove(); }); loadedSlider.insertAdjacentHTML("beforeend", tagDom); } else { if (tag_container.querySelector(".support-slick")) { var supportSlick = tag_container.querySelectorAll(".support-slick, .sep-slider"); supportSlick.forEach((element) => { element.querySelectorAll(".slider-discount-tag").forEach((element) => { element.remove(); }); element.insertAdjacentHTML("beforeend",tagDom); }); } else { var sepSlider = tag_container.querySelector(".sep-slider"); sepSlider.querySelectorAll(".slider-discount-tag").forEach(function(element) { element.remove(); }); sepSlider.insertAdjacentHTML("beforeend",tagDom); } } if (document.documentElement.clientWidth < 768) { const sliderDiscountTagHeight = tag_container.querySelector(".slider-discount-tag").offsetHeight || 0; document.querySelector(".product-image__swiper_bullets").style.bottom = `${sliderDiscountTagHeight + 15}px`; } } }, 1000); }; fetchInfoBar = () => { let discount_ids = []; if (this.pageType === 1) { discount_ids = this.rebateInfo && this.rebateInfo.discount_list.map(item => item.discount_id); } else if (this.pageType === 38) { discount_ids = [this.win.rebateObj.rebateCollection_id] || []; } const productObj = this.getProduct(); return this.xhr_.fetchJson("\/api\/discount-rebate\/global-text", { method: "POST", body: { product_type: productObj && productObj.product && productObj.product.product_type, line_items: (this.cart.line_items || []).map(item => ({ variant_id: item.variant_id, product_id: item.product_id, quantity: item.quantity, price: item.price, selected: !item.unchecked, })), discount_ids: discount_ids, }, }); }; renderBottomBanner = res => { if (!res.tips) return; if (document.querySelector(".discount__info-bar")) return; var bar_style = `background:linear-gradient(90deg,${res.config.background_color_start},${res.config.background_color_end}); color:${res.config.color};`; let data = { tips: res.tips, landPage: this.landPage + res.id, bar_style }; const html = SPZCore.Dom.htmlFor(this.element); const banner = html([ `<a impr="1" imprevt="1" id="rebate_bottom_bar" href=${data.landPage} class="discount__info-bar text-truncate" data-activity-type="rebate" style="${data.bar_style}">${data.tips}</a>`, ]); document.querySelector(".plugin-container__bottom-fixed").appendChild(banner); const pluginCurrencyEvent = new CustomEvent("plugin_currency_update"); document.dispatchEvent(pluginCurrencyEvent); if (res.id) { var trackParams = { page: this.pageType, discount_id: res.id, product_id: this.getProduct()?.product.id, }; banner.addEventListener("click", () => { this.win.sa && this.win.sa.track("plugin_rebate_promotion_click", { plugin_timestamp: Date.now(), plugin_location: "bottom_bar", product_id: trackParams.product_id, discount_id: trackParams.discount_id, }); }); this.win.sa && this.win.sa.track("plugin_rebate_banner_pv", trackParams); } }; showDiscountPopupsInfoBar = () => { if ([13, 14, 19, 30, 31].includes(this.pageType)) return; if (document.querySelector(".plugin-container__bottom-fixed .discount__info-bar")) return; this.fetchInfoBar().then(this.renderBottomBanner); document.addEventListener("dj.cartChange", () => { this.fetchInfoBar().then(this.renderBottomBanner); }); }; } SPZ.defineElement("spz-custom-rebate", SpzRebateComponent);
Style:  Santa Claus
Quantity
people are viewing this right now
Shipping
/** @private {string} */ class SpzCustomAnchorScroll extends SPZ.BaseElement { static deferredMount() { return false; } constructor(element) { super(element); /** @private {Element} */ this.scrollableContainer_ = null; } isLayoutSupported(layout) { return layout == SPZCore.Layout.LOGIC; } buildCallback() { this.viewport_ = this.getViewport(); this.initActions_(); } setTarget(containerId, targetId) { this.containerId = '#' + containerId; this.targetId = '#' + targetId; } scrollToTarget() { const container = document.querySelector(this.containerId); const target = container.querySelector(this.targetId); const {scrollTop} = container; const eleOffsetTop = this.getOffsetTop_(target, container); this.viewport_ .interpolateScrollIntoView_( container, scrollTop, scrollTop + eleOffsetTop ); } initActions_() { this.registerAction( 'scrollToTarget', (invocation) => this.scrollToTarget(invocation?.caller) ); this.registerAction( 'setTarget', (invocation) => this.setTarget(invocation?.args?.containerId, invocation?.args?.targetId) ); } /** * @param {Element} element * @param {Element} container * @return {number} * @private */ getOffsetTop_(element, container) { if (!element./*OK*/ getClientRects().length) { return 0; } const rect = element./*OK*/ getBoundingClientRect(); if (rect.width || rect.height) { return rect.top - container./*OK*/ getBoundingClientRect().top; } return rect.top; } } SPZ.defineElement('spz-custom-anchor-scroll', SpzCustomAnchorScroll); const STRENGTHEN_TRUST_URL = "/api/strengthen_trust/settings"; class SpzCustomStrengthenTrust extends SPZ.BaseElement { constructor(element) { super(element); this.renderElement_ = null; } isLayoutSupported(layout) { return layout == SPZCore.Layout.CONTAINER; } buildCallback() { this.xhr_ = SPZServices.xhrFor(this.win); const renderId = this.element.getAttribute('render-id'); SPZCore.Dom.waitForChild( document.body, () => !!document.getElementById(renderId), () => { this.renderElement_ = SPZCore.Dom.scopedQuerySelector( document.body, `#${renderId}` ); if (this.renderElement_) { this.render_(); } this.registerAction('track', (invocation) => { this.track_(invocation.args); }); } ); } render_() { this.fetchData_().then((data) => { if (!data) { return; } SPZ.whenApiDefined(this.renderElement_).then((apis) => { apis?.render(data); document.querySelector('#strengthen-trust-render-1539149753700').addEventListener('click',(event)=>{ if(event.target.nodeName == 'A'){ this.track_({type: 'trust_content_click'}); } }) }); }); } track_(data = {}) { const track = window.sa && window.sa.track; if (!track) { return; } track('trust_enhancement_event', data); } parseJSON_(string) { let result = {}; try { result = JSON.parse(string); } catch (e) {} return result; } fetchData_() { return this.xhr_ .fetchJson(STRENGTHEN_TRUST_URL) .then((responseData) => { if (!responseData || !responseData.data) { return null; } const data = responseData.data; const moduleSettings = (data.module_settings || []).reduce((result, moduleSetting) => { return result.concat(Object.assign(moduleSetting, { logos: (moduleSetting.logos || []).map((item) => { return moduleSetting.logos_type == 'custom' ? this.parseJSON_(item) : item; }) })); }, []); return Object.assign(data, { module_settings: moduleSettings, isEditor: window.self !== window.top, }); }); } } SPZ.defineElement('spz-custom-strengthen-trust', SpzCustomStrengthenTrust);

Description

Looking for best 24 days christmas countdown advent calendar?Do you wanna a advent calendar gift that your kids will feel exited?

There's a christmas building blocks toy surprise gift behind each of the 24 doors of the Advent Calendar.

24 DAYS COUNTDOWN SURPRISE GIFTS:

Every morning can open the doors of the calendar and get a small surprise of building toys. From December 1. counting down the days until December 24. Advent calendar is an interesting way for children to count down before Christmas and get some surprises every day.

6 in 1 DESIGN:

There's a christmas building blocks toy surprise gift behind each of the 24 doors of the Advent Calendar for boy girl. Kids get to start off each day building a new toy and then each 6 small Christmas models can be assembled into a large Santa Claus. Christmas Train. Christmas house & Christmas tree. Kids can easy to follow & build the blocks toys. getting fun 24 days christmas countdown.

Easy to Assemble

This Building block advent calendars contain individually two sided building instruction in each boxes. helping your kids assemble into complete model step by step. If you need to build the 24 individual models. you need to follow the instructions on the front of the model to build it. and if you want to rebuild the big one model. you should follow back side of 6 models instruction. You end up with 24 small models or 4 larger models.

Safety & Durability Material

Building blocks conform to all safety standards and all are made of ABS plastic with no bad odor. which is not harmful to the health of humans or animals. The creative toy building sets help your kids improve their fine motor skills and creative thinking when they build. also encourage them to do role-play and storytelling.

Perfect to Wait for Christmas

Our Christmas Advent Calendar will improve your child's concentration and patience while making these dry block toys. Building blocks playsets put open-ended play and self-expression into the hands of budding young builders. With 24 days of surprises and imaginative fun that lasts all year long. this supercool Advent calendar is the perfect pre-Christmas gift for any young aged 7 and up.

DETAILS:

  • Child-Safe Material
  • 6 in 1 Design
  • Size:38*26*7.2cm

Package includes:

  • 24 Little Boxes  Christmas Buildings Blocks Set
  • Instruction Manual Guide
  • Train includes LED light strips

Shipping Policy

Our Goal Is To Provide You With The Best Shipping Options No Matter Where You Live. We Serve Hundreds Of Customers Around The World Every Day And We Strive To Provide You With The Highest Level Of Service.

The Time Frame For Order Delivery Is Divided Into Two Parts:

Processing Time: 2 To 5 Business Days
Free Shipping On Orders Of $29.99 And Up

1. Freight

Free Shipping On Orders $29.99 And Up. Otherwise Your Shipping Cost Will Depend On The Shipping Method You Choose:

$29.99 And Up. Standard Express (7-12 Business Days)  Free Shipping
Under $29.99 Standard Express (7-12 Business Days) $5.99
$29.99 And Up. Vip Express Shipping (5-10 Business Days) $4.99
Under $29.98. Vip Express Shipping (5-10 Business Days) $7.99

2. Shipping Time:

Default Standard Shipping: 7 To 12 Business Days
Vip Express: 5 To 10 Working Days
Once Your Order Has Been Processed, Transit Times Will Vary Based On Your Location, As Shown In The Table Below:

Country Transit Times
Us 12 - 18 Business Days
Canada 12-18 Working Days
12-25 Working Days In Europe (7-15 Working Days In Uk, Germany, France, Switzerland)
Australia 12-15 Working Days
12-20 Working Days Worldwide

3. Processing
Your Order Usually Takes 1-4 Business Days (Some Items May Take 6-9 Business Days). If Processing Takes Longer Than Expected, We Will Send You An Email To Let You Know.

During high volume processing or crises, processing time may take an additional 2-4 days.
Once shipped, you will be notified by email and can log in to our website or app for real-time tracking. Please note that some orders may be sent using multiple packages. In these cases, you will receive multiple emails and tracking numbers.

4. How Can I Track My Order?
A Tracking Number Will Be Provided In Your Shipping Confirmation Email. You Can Use This Number And Track Your Order On www.lwinai.com.

5. How Do I Know My Order Has Been Submitted Successfully?
You Will Receive A Confirmation Email With Your Order Number And Purchase Details.

6. What If An Item Is Missing Or The Product Is Incorrect When I Receive My Order?
For Lost Or Wrongly Shipped Items, Please Contact Us At support@lwinai.com Please Provide Your Transaction Reference Number (Order Number) And Provide Us With Proof (Image File Size Should Be Under 1mb). We'Ll Be More Than Happy To Reship You The Correct Item For Free, And We Won'T Ask You To Return An Item That Was Sent To You By Mistake! You Can Keep It As A Gift From Us.

7. I Want To Change The Item I Ordered. What Should I Do?
Amendments To Your Order Are Allowed On Or Before 11:00 Pm Pst (Gmt -7 Pm) On The Day The Order Is Placed. You Can Request Changes By Contacting Us At support@lwinai.com.

8. How Do I Change My Shipping Address?
Address Changes Are Permitted On Or Before 11:00 Pm (Pst, -7:00 Gmt) On The Day The Order Is Placed. You May Request Such Changes By Contacting Us At support@lwinai.com.

9. What Is Your Return Policy?
Please See Our Return Policy Regarding Returns.
Our Customer Service Is Available 24/7. We Will Respond To Your Inquiry As Soon As Possible.
10. How To Cancel My Order?
We Accept Cancellations Within 24 Hours Of Placing An Order.
You Can Reach Us At support@lwinai.comTo Request Cancellation.
We Do Not Allow Order Cancellations After 24 Hours Of Successful Payment. If You Still Wish To Make Changes, Please Contact Us As Soon As Possible And We Will Do Our Best To Help.
*If The Product Has Already Shipped, We Regret That We Cannot Cancel The Order For You.
For More Details And Instructions, Please Visit Our Returns Policy.

*Due To The Impact Of Covid-19 On Our Warehouse And Shipping Operations, Order Processing And Shipping Times May Be Delayed By Up To An Additional 7 Business Days. You Can Check The Details In The Table Below. We Are Improving Our Delivery Process To Make Your Package More Secure, So There May Be A 2-5 Day Delay In Processing Your Order.

If There Is Any After-Sales Service Quality Problem During Shipping Or After Receiving The Goods, Please Feel Free To Email To support@lwinai.com
, Our Customer Service Agent Table Will Provide You With A Satisfactory Solution.

Returns & Refund Policy

We are committed to providing quality and hassle-free returns

At lwinai, we take pride in the quality of our products and take strict quality control measures. Your satisfaction is our top priority and we want to ensure that your shopping experience is as smooth and enjoyable as possible. However, we understand that problems can occasionally occur and we will do our best to help you.

**Return Policy**

We offer a flexible return policy that allows you to return or exchange your item within 30 days of the date you received it. If you encounter any problems with your purchase, please feel free to contact our customer service team at support@lwinai.com.

**Return Process**

When you decide to return an item, you can arrange for a local post office collection or send the item to the nearest post office. Shipping compensation will be determined based on the reason for the return. If the problem is attributable to us, we will cover the return shipping costs. However, if the problem is attributable to you, we will not be able to compensate for shipping costs.

**Wrong or Damaged Items**

If the item you received is wrong or damaged, please take clear photos and contact our customer service in time. Depending on the specific situation, we will arrange a replacement or refund.

**Before Returning**

Before returning any product, please contact our Customer Service team to obtain the return address. This step is critical to ensure a smooth and efficient return process.

**Return Requirements**

(1) For items with no quality issues, we would like our valued customers to return items in their original condition - unworn, unwashed, undamaged, with all original tags and packaging materials intact.

(2) Approval from our lwinai Customer Service team is required before shipping items back to us.

(3) In the event of a quality issue or the wrong product was delivered, customers should provide photographic evidence of the problem and contact our Customer Service team for instructions on the return address.

**Eligible for Return**

You can contact us for a return or refund under the following conditions:

1. **Defective Issues**: Includes stains, zipper failures, tears, extremely poor quality materials, significant color differences, and large differences between the product photographed and the actual item received.

2. **Personal Preference**: If you simply don't like the item, you can return it. However, you will be responsible for the shipping costs of the returned items

3. **Shipping Responsibility**: In case of a return, customers have the option to contact the nearest post office to arrange for pickup or delivery of the item. Shipping compensation will be determined based on the reason for the return - if it is our responsibility, we will cover the shipping costs; if it is your responsibility, we will not be able to compensate the shipping costs.

At lwinai, we stand behind our commitment to quality and customer satisfaction. Our return policy is designed to be fair and inclusive, ensuring that you have a worry-free shopping experience with us. If you encounter a problem, please feel free to contact us and we will work hard to resolve the issue to your satisfaction.

**Refund Policy**
At lwinai, we prioritize your satisfaction and our refund policy is designed to ensure that you have a worry-free shopping experience with us.

**Quality-Related Issues**

We will take full responsibility for any misprinted, damaged or defective items caused by production or shipping. You will receive a full refund and we will also refund the return shipping costs.

**Cancellation of Order**

Your order can be fully refunded in the following cases:

- If you cancel the order within 24 hours of purchase.

- If you cancel the order before it is shipped.

However, please note that we will not accept order cancellation requests after the order has been shipped.

**Package Lost in Transit**

If your package is unfortunately lost in transit, we will provide a full refund to compensate you for your loss. Or resend your package.

**Address Accuracy**

It is essential to provide an accurate delivery address. If the courier cannot recognize the address provided, the goods will be returned to our facility. In this case, you will be responsible for the cost of re-shipping once we confirm the updated address (if applicable). If you provide an incorrect address when placing an order and do not contact us to change the address, you will be responsible for any related losses.

**Intact Condition**

To ensure that you are eligible for a refund, please return the item in its original condition. Returned items with obvious signs of use, makeup, animal hair, dander, deodorant, perfume or similar product stains may be rejected and no refund will be given.

**Refund Processing**

Please keep in mind that it may take up to 7 business days for the refund to be reflected in your account due to different processing times for different payment providers.

At lwinai, we value your trust and satisfaction and are committed to making your shopping experience smooth and enjoyable. Our refund policy is designed to be transparent, fair and customer-centric. If you have any questions or issues regarding a refund, please feel free to contact us and we will do our best to help you.

If you have any questions, please contact us.
Email: support@lwinai.com

Working hours: Monday to Friday 08:00-17:00 (UTC+8)

On weekdays, we will respond to you within 24 hours

Customer Reviews
Here are what our customers say.
Write a Review
Customer Reviews
Wow you reached the bottom
Newest
Most liked
Highest ratings
Lowest ratings
×
class SpzCustomFileUpload extends SPZ.BaseElement { constructor(element) { super(element); this.uploadCount_ = 0; this.fileList_ = []; } buildCallback() { this.action = SPZServices.actionServiceForDoc(this.element); this.registerAction('upload', (data) => { this.handleFileUpload_(data.event?.detail?.data || []); }); this.registerAction('delete', (data) => { this.handleFileDelete_(data?.args?.data); }); this.registerAction('preview', (data) => { this.handleFilePreview_(data?.args?.data); }); this.registerAction('limit', (data) => { this.handleFileLimit_(); }); this.registerAction('sizeLimit', (data) => { this.handleFileSizeLimit_(); }); } isLayoutSupported(layout) { return layout == SPZCore.Layout.LOGIC; } setData_(count, file) { this.uploadCount_ = count; this.fileList_ = file; } handleFileUpload_(data) { data.forEach(i => { if(this.fileList_.some(j => j.url === i.url)) return; this.fileList_.push(i); }) this.uploadCount_++; sessionStorage.setItem('fileList', JSON.stringify(this.fileList_)); this.triggerEvent_("handleFileUpload", { count: this.uploadCount_, files: this.fileList_}); if(this.fileList_.length >= 5){ document.querySelector('#review_upload').style.display = 'none'; } if(this.fileList_.length > 0){ document.querySelector('.apps-reviews-write-anonymous-box').style.marginTop = '8px'; } } handleFileDelete_(index) { this.fileList_.splice(index, 1); this.uploadCount_--; sessionStorage.setItem('fileList', JSON.stringify(this.fileList_)); this.triggerEvent_("handleFileDelete", { count: this.uploadCount_, files: this.fileList_}); document.querySelector('#review_upload').style.display = 'block'; if(this.fileList_?.length === 0){ document.querySelector('.apps-reviews-write-anonymous-box').style.marginTop = '132px'; } } handleFilePreview_(index) { const finalPreviewData = this.fileList_[index]; const filePreviewModal = document.getElementById('filePreviewModal'); const fullScreenVideo = document.getElementById('fullScreenVideo'); const fullScreenImage = document.getElementById('fullScreenImage'); const previewModalClose = document.getElementById('previewModalClose'); const previewLoading = document.getElementById('previewLoading'); filePreviewModal.style.display = 'block'; previewLoading.style.display = 'flex'; if(finalPreviewData?.type === 'video'){ const media = this.mediaParse_(this.fileList_[index]?.url); fullScreenVideo.addEventListener('canplaythrough', function() { previewLoading.style.display = 'none'; }); fullScreenImage.src = ''; fullScreenImage.style.display = 'none'; fullScreenVideo.style.display = 'block'; fullScreenVideo.src = media.mp4 || ''; } else { fullScreenImage.onload = function() { previewLoading.style.display = 'none'; }; fullScreenVideo.src = ''; fullScreenVideo.style.display = 'none'; fullScreenImage.style.display = 'block'; fullScreenImage.src = finalPreviewData.url; } previewModalClose.addEventListener('click', function() { filePreviewModal.style.display = 'none'; }); } handleFileLimit_() { alert(window.AppReviewsLocale.comment_file_limit || 'please do not upload files more than 5'); this.triggerEvent_("handleFileLimit"); } handleFileSizeLimit_() { alert(window.AppReviewsLocale.comment_file_size_limit || 'File size does not exceed 10M'); } clear(){ this.fileList_ = []; this.uploadCount_ = 0; sessionStorage.setItem('fileList', JSON.stringify(this.fileList_)); this.triggerEvent_("handleClear", { count: this.uploadCount_, files: this.fileList_}); document.querySelector('#review_upload').style.display = 'block'; } mediaParse_(url) { var result = {}; try { url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (str, key, value) { try { result[key] = decodeURIComponent(value); } catch (e) { result[key] = value; } }); result.preview_image = url.split('?')[0]; } catch (e) {}; return result; } triggerEvent_(name, data) { const event = SPZUtils.Event.create(this.win, name, data); this.action.trigger(this.element, name, event); } } SPZ.defineElement('spz-custom-file-upload', SpzCustomFileUpload);
The review would not show in product details on storefront since it does not support to.