Cooperation๏ผšWe provide customized bulk production services for distributors, wholesalers, supermarkets and e-commerce platforms.

A Cozy Holiday Hideaway for Your Furry Friend

A Cozy Holiday Hideaway for Your Furry Friend

Christmas Pet Bed

Christmas Pet Bed

const TAG = "spz-custom-product-automatic"; class SpzCustomProductAutomatic extends SPZ.BaseElement { constructor(element) { super(element); this.variant_id = '64bb893c-70d4-467b-9686-02b5d674d3a6'; this.isRTL = SPZ.win.document.dir === 'rtl'; this.isAddingToCart_ = false; // ๅŠ ่ดญไธญ็Šถๆ€ } static deferredMount() { return false; } buildCallback() { this.action_ = SPZServices.actionServiceForDoc(this.element); this.templates_ = SPZServices.templatesForDoc(this.element); this.xhr_ = SPZServices.xhrFor(this.win); this.setupAction_(); this.viewport_ = this.getViewport(); } mountCallback() { this.init(); // ็›‘ๅฌไบ‹ไปถ this.bindEvent_(); } async init() { this.handleFitTheme(); const data = await this.getDiscountList(); this.renderApiData_(data); } async getDiscountList() { const productId = 'b325abab-b516-45e2-bd72-fda229b16fe6'; const variantId = this.variant_id; const productType = 'default'; const reqBody = { product_id: productId, variant_id: variantId, discount_method: "DM_AUTOMATIC", customer: { customer_id: window.C_SETTINGS.customer.customer_id, email: window.C_SETTINGS.customer.customer_email }, product_type: productType } const url = `/api/storefront/promotion/display_setting/text/list`; const data = await this.xhr_.fetchJson(url, { method: "post", body: reqBody }).then(res => { return res; }).catch(err => { this.setContainerDisabled(false); }) return data; } async renderDiscountList() { this.setContainerDisabled(true); const data = await this.getDiscountList(); this.setContainerDisabled(false); // ้‡ๆ–ฐๆธฒๆŸ“ ๆŠ–ๅŠจ้—ฎ้ข˜ๅค„็† this.renderApiData_(data); } clearDom() { const children = this.element.querySelector('*:not(template)'); children && SPZCore.Dom.removeElement(children); } async renderApiData_(data) { const parentDiv = document.querySelector('.automatic_discount_container'); const newTplDom = await this.getRenderTemplate(data); if (parentDiv) { parentDiv.innerHTML = ''; parentDiv.appendChild(newTplDom); } else { console.log('automatic_discount_container is null'); } } doRender_(data) { const renderData = data || {}; return this.templates_ .findAndRenderTemplate(this.element, renderData) .then((el) => { this.clearDom(); this.element.appendChild(el); }); } async getRenderTemplate(data) { const renderData = data || {}; return this.templates_ .findAndRenderTemplate(this.element, { ...renderData, isRTL: this.isRTL }) .then((el) => { this.clearDom(); return el; }); } setContainerDisabled(isDisable) { const automaticDiscountEl = document.querySelector('.automatic_discount_container_outer'); if(isDisable) { automaticDiscountEl.setAttribute('disabled', ''); } else { automaticDiscountEl.removeAttribute('disabled'); } } // ็ป‘ๅฎšไบ‹ไปถ bindEvent_() { window.addEventListener('click', (e) => { let containerNodes = document.querySelectorAll(".automatic-container .panel"); let bool; Array.from(containerNodes).forEach((node) => { if(node.contains(e.target)){ bool = true; } }) // ๆ˜ฏๅฆpopover้ขๆฟ็‚นๅ‡ป่Œƒๅ›ด if (bool) { return; } if(e.target.classList.contains('drowdown-icon') || e.target.parentNode.classList.contains('drowdown-icon')){ return; } const nodes = document.querySelectorAll('.automatic-container'); Array.from(nodes).forEach((node) => { node.classList.remove('open-dropdown'); }) // ๅ…ผๅฎนไธป้ข˜ this.toggleProductSticky(true); }) // ็›‘ๅฌๅ˜ไฝ“ๅ˜ๅŒ– document.addEventListener('dj.variantChange', async(event) => { // ้‡ๆ–ฐๆธฒๆŸ“ const variant = event.detail.selected; if (variant.product_id == 'b325abab-b516-45e2-bd72-fda229b16fe6' && variant.id != this.variant_id) { this.variant_id = variant.id; this.renderDiscountList(); } }); } // ๅ…ผๅฎนไธป้ข˜ handleFitTheme() { // top ๅฑžๆ€งๅฝฑๅ“ๆŠ–ๅŠจ let productInfoEl = null; if (window.SHOPLAZZA.theme.merchant_theme_name === 'Wind' || window.SHOPLAZZA.theme.merchant_theme_name === 'Flash') { productInfoEl = document.querySelector('.product-info-body .product-sticky-container'); } else if (window.SHOPLAZZA.theme.merchant_theme_name === 'Hero') { productInfoEl = document.querySelector('.product__info-wrapper .properties-content'); } if(productInfoEl){ productInfoEl.classList.add('force-top-auto'); } } // ๅ…ผๅฎน wind/flash /hero ไธป้ข˜ (stickyๅฑžๆ€งๅฝฑๅ“ popover ๅฑ‚็บงๅฑ•็คบ, ไผš่ขซๅ…ถไป–ๅ…ƒ็ด ่ฆ†็›–) toggleProductSticky(isSticky) { let productInfoEl = null; if (window.SHOPLAZZA.theme.merchant_theme_name === 'Wind' || window.SHOPLAZZA.theme.merchant_theme_name === 'Flash') { productInfoEl = document.querySelector('.product-info-body .product-sticky-container'); } else if (window.SHOPLAZZA.theme.merchant_theme_name === 'Hero') { productInfoEl = document.querySelector('.product__info-wrapper .properties-content'); } if(productInfoEl){ if(isSticky) { // ่ฟ˜ๅŽŸ่ฏฅไธป้ข˜ๅŽŸๆœ‰็š„stickyๅฑžๆ€งๅ€ผ productInfoEl.classList.remove('force-position-static'); return; } productInfoEl.classList.toggle('force-position-static'); } } setupAction_() { this.registerAction('handleDropdown', (invocation) => { const discount_id = invocation.args.discount_id; const nodes = document.querySelectorAll('.automatic-container'); Array.from(nodes).forEach((node) => { if(node.getAttribute('id') != `automatic-${discount_id}`) { node.classList.remove('open-dropdown'); } }) const $discount_item = document.querySelector(`#automatic-${discount_id}`); $discount_item && $discount_item.classList.toggle('open-dropdown'); // ๅ…ผๅฎนไธป้ข˜ this.toggleProductSticky(); }); // ๅŠ ่ดญไบ‹ไปถ this.registerAction('handleAddToCart', (invocation) => { // ้˜ปๆญขไบ‹ไปถๅ†’ๆณก const event = invocation.event; if (event) { event.stopPropagation(); event.preventDefault(); } // ๅฆ‚ๆžœๆญฃๅœจๅŠ ่ดญไธญ๏ผŒ็›ดๆŽฅ่ฟ”ๅ›ž if (this.isAddingToCart_) { return; } const quantity = invocation.args.quantity || 1; this.addToCart(quantity); }); } // ๅŠ ่ดญๆ–นๆณ• async addToCart(quantity) { // ่ฎพ็ฝฎๅŠ ่ดญไธญ็Šถๆ€ this.isAddingToCart_ = true; const productId = 'b325abab-b516-45e2-bd72-fda229b16fe6'; const variantId = this.variant_id; const url = '/api/cart'; const reqBody = { product_id: productId, variant_id: variantId, quantity: quantity }; try { const data = await this.xhr_.fetchJson(url, { method: 'POST', body: reqBody }); // ่งฆๅ‘ๅŠ ่ดญๆˆๅŠŸๆ็คบ this.triggerAddToCartToast_(); return data; } catch (error) { error.then(err=>{ this.showToast_(err?.message || err?.errors?.[0] || 'Unknown error'); }) } finally { // ๆ— ่ฎบๆˆๅŠŸๅคฑ่ดฅ๏ผŒ้ƒฝ้‡็ฝฎๅŠ ่ดญ็Šถๆ€ this.isAddingToCart_ = false; } } showToast_(message) { const toastEl = document.querySelector("#apps-match-drawer-add_to_cart_toast"); if (toastEl) { SPZ.whenApiDefined(toastEl).then((apis) => { apis.showToast(message); }); } } // ่งฆๅ‘ๅŠ ่ดญๆˆๅŠŸๆ็คบ triggerAddToCartToast_() { // ๅฆ‚ๆžœไธป้ข˜ๆœ‰่‡ชๅทฑ็š„ๅŠ ่ดญๆ็คบ๏ผŒๅˆ™ไธๆ˜พ็คบ const themeAddToCartToastEl = document.querySelector('#add-cart-event-proxy'); if (themeAddToCartToastEl) return; // ๆ˜พ็คบๅบ”็”จ็š„ๅŠ ่ดญๆˆๅŠŸๆ็คบ this.showToast_("Added successfully"); } triggerEvent_(name, data) { const event = SPZUtils.Event.create(this.win, `${ TAG }.${ name }`, data || {}); this.action_.trigger(this.element, name, event); } isLayoutSupported(layout) { return layout == SPZCore.Layout.CONTAINER; } } SPZ.defineElement(TAG, SpzCustomProductAutomatic);
class SpzCustomDiscountBundle extends SPZ.BaseElement { constructor(element) { super(element); } isLayoutSupported(layout) { return layout == SPZCore.Layout.LOGIC; } mountCallback() { // ๅŒไธ€้กตๅฏ่ƒฝๆœ‰ๅคšไธช block ๅ„่‡ชๆธฒๆŸ“ๆœฌ snippet๏ผŒๅฏผ่‡ด้€ป่พ‘ๅ…ƒ็ด  spz-custom-discount-toast(#appsAddCartToastFunc) ้‡ๅคใ€‚ // ไป…ไฟ็•™ DOM ไธญ็ฌฌไธ€ไธชๅฎžไพ‹๏ผŒๅ…ถไฝ™้‡ๅคๅฎžไพ‹็งป้™ค่‡ช่บซ๏ผŒไฟ่ฏ้€ป่พ‘ๅ…ƒ็ด ๅŠๅ…ถ action ๅผ•็”จ(appsAddCartToastFunc)ๅ”ฏไธ€ใ€‚ const funcs = document.querySelectorAll('#appsAddCartToastFunc'); if (funcs.length > 1 && this.element !== funcs[0]) { this.element.remove(); return; } // ๅ…จๅฑ€ๆŠ˜ๆ‰ฃ toast ็š„ๅผนๅ‡บ็‚นๅˆ†ๆ•ฃๅœจๅคšไธชๆจกๆฟ/็ป„ไปถ้‡Œ๏ผˆๅซๅฃฐๆ˜Žๅผ @atcError๏ผ‰๏ผŒๆ— ๆณ•้€ไธ€ๅœจๅผนๅ‡บๅ‰ๅ‰็ฝฎ๏ผŒ // ๆ•…ๆŒ‚่ฝฝๆ—ถๅน‚็ญ‰ๅœฐๅŽป้‡ๅนถๆŒ‚ๅˆฐ body๏ผ›ๅŠ ่ดญ toast ๆ”นไธบๅผนๅ‡บๅ‰ๆŒ‰้œ€ๅŽป้‡๏ผˆ่ง showAddToCartToast๏ผ‰ this.ensureSingleToastInBody_('cart_match_discount_toast_wrap'); } unmountCallback() {} // ๅŒไธ€้กต้ขๅฏ่ƒฝๆœ‰ๅคšไธช block ๅ„่‡ชๆธฒๆŸ“ๆœฌ toast snippet๏ผˆๅฆ‚ๅ•†่ฏฆ็š„ discount_automatic + ่ดญ็‰ฉ่ฝฆๆŠฝๅฑ‰้‡Œ็š„ๆŠ˜ๆ‰ฃๆจชๅน…๏ผ‰๏ผŒ // ๅฏผ่‡ด toast ๅค–ๅฑ‚ๅ‡บ็Žฐ้‡ๅค idใ€‚้‡ๅค id ไธ‹ getElementById/querySelector ๅŠ SPZ ๅŠจไฝœๅผ•็”จ้ƒฝๅชๅ‘ฝไธญ็ฌฌไธ€ไธช๏ผŒ // ไธ”่ขซๅ…ณ่ฟ›ๆŠฝๅฑ‰็š„้‚ฃไปฝไผš่ขซๆŠฝๅฑ‰็š„ transform/overflow ่ฃๅ‰ช/้”™ไฝใ€‚่ฟ™้‡ŒๅœจๆŒ‚่ฝฝๆ—ถๅน‚็ญ‰ๅŽป้‡๏ผš // ๅชไฟ็•™ไธ€ไปฝใ€็งป้™คๅคšไฝ™็š„๏ผŒๅนถๆŠŠไฟ็•™็š„ๆŒ‚ๅˆฐ body๏ผˆbody ๆ˜ฏ position:fixed ๆœ€ๅฎ‰ๅ…จ็š„่ฝ็‚น๏ผŒ้ฟๅ…่ขซไปปไฝ•็ฅ–ๅ…ˆ่ฃๅ‰ช๏ผ‰ใ€‚ๅฏๅๅค่ฐƒ็”จใ€‚ ensureSingleToastInBody_(id) { const els = Array.from(document.querySelectorAll('#' + id)); if (!els.length) return; els.slice(1).forEach((el) => el.remove()); const keep = els[0]; if (keep.parentNode !== document.body) { document.body.appendChild(keep); } } // ไธป้ข˜่ดญ็‰ฉ่ฝฆๆŠฝๅฑ‰ๆ˜ฏๅฆๆ‰“ๅผ€ isInCartDrawer_() { return !!document.querySelector('[data-section-type="cart_drawer"] spz-sidebar[open]'); } setupAction_() { this.registerAction('showAddToCartToast', () => { // ๆŠฝๅฑ‰ๅ†…ๅŠ ่ดญ๏ผšไธป้ข˜ๆœฌๅฐฑไธไผšๆœ‰ๅŠ ่ดญๆ•ˆๆžœ๏ผŒ็ปŸไธ€ๅผนๆ’ไปถ่‡ชๅทฑ็š„ toast // ้žๆŠฝๅฑ‰๏ผšไธป้ข˜ๆœ‰ๅŠ ่ดญไปฃ็†ๅˆ™ๆฒฟ็”จไธป้ข˜ๅŠ ่ดญๆ•ˆๆžœ๏ผŒๅฆๅˆ™ๆ’ไปถๅ…œๅบ• const proxyEl = document.getElementById('add-cart-event-proxy'); const inDrawer = this.isInCartDrawer_(); if (!inDrawer && proxyEl) { return; } // ๅผนๅ‡บๅ‰ๆŒ‰้œ€ๅŽป้‡ๅนถๆŒ‚ๅˆฐ body๏ผˆๅน‚็ญ‰๏ผ‰๏ผŒ้ฟๅ…้‡ๅค id ๅ‘ฝไธญ้”™ๅฏน่ฑกๆˆ–่ขซๆŠฝๅฑ‰่ฃๅ‰ช/้”™ไฝ this.ensureSingleToastInBody_('apps_add_cart_toast_wrap'); const toastEl = document.querySelector('#apps-match-drawer-add_to_cart_toast') SPZ.whenApiDefined(toastEl).then((apis) => { apis.showToast("Added successfully"); }); }); } buildCallback() { this.setupAction_(); }; } SPZ.defineElement('spz-custom-discount-toast', SpzCustomDiscountBundle);
$24.66
$27.19
people are viewing this right now
Size: 13.8" L × 13.8" W × 16.5" H
Quantity
Product was out of stock.
Product is unavailable.
Every Purchase Makes a Difference

For every product sold, we donate 1% of the sale price to the ASPCA (American Society for the Prevention of Cruelty to Animals). Every purchase is made with care, uniting collective effort, and honoring the preciousness of life.

Free Shipping Available on Most Orders

Remote or extended-service areas may require an additional shipping fee, which will be calculated and communicated before shipment.

Return Supported

Shop with confidence with our hassle-free returns policy, ensuring you love what you buy.

Sustainably made

Designed with the planet in mind, all our products are committed to sustainable practices.

Secure payments

Your payment information is always protected with our advanced, encrypted checkout security.

Description

Features

  • ๐ŸŽ„ Festive Christmas Tree Design
    Cute and eye-catching holiday style that adds warmth and charm to any room.
  • โ˜๏ธ Ultra Soft Plush Material
    Made with soft, cozy fabric for maximum comfort and warmth.
  • ๐Ÿพ Cozy Enclosed Space
    Semi-enclosed design helps pets feel safe, calm, and protected while resting.
  • ๐Ÿ› Thick Cushioned Support
    Plush interior provides comfortable support for daily naps and deep sleep.
  • ๐Ÿงผ Easy to Store & Lightweight
    Compressible design makes storage and shipping convenient.

Color

  • Green

Sizes

  • 13.8" L × 13.8" W × 16.5" H
  • 17.7" L × 17.7" W × 20.5" H

Package Size

  • 13.8" × 16.5" × 2"
  • 17.7" × 20.5" × 2"

Perfect For

  • Cats
  • Kittens
  • Small Dogs
  • Holiday Home Décor
  • Winter Comfort & Warmth
No products viewed