LAST DAY 49% OFF – 🎃 Halloween Monster Hood DIY Crochet Kit | Premium Soft Yarn Materials with Step-by-Step Guide DIY Handmade Wearable Character Hood 🧶🎭✨

LAST DAY 49% OFF – 🎃 Halloween Monster Hood DIY Crochet Kit | Premium Soft Yarn Materials with Step-by-Step Guide DIY Handmade Wearable Character Hood 🧶🎭✨

$24.98
$112.41
Style🎁Buy 2— Save 10% OFF & Free Shipping:
Please select a Style🎁Buy 2— Save 10% OFF & Free Shipping
Finished Size:
Please select a Finished Size
Quantity
Product was out of stock.
Product is unavailable.

Description

🎁Don't forget to buy some for your family or friends as it's a unique gift idea.❤️❤️❤️



🎃 Halloween Monster Hood DIY Crochet Kit | Create Your Own Spooky Wearable Costume

Don’t just wear a Halloween costume — crochet the monster yourself.

This Halloween Monster Hood DIY Crochet Kit lets you turn soft yarn, spooky character details, and step-by-step instructions into a bold handmade hood hat you can actually wear.

From creepy horns and monster eyes to bat wings, spider details, pumpkin vines, ghostly accents, and long hanging tassels, each finished hood becomes a fun, dramatic, and unforgettable Halloween creation. 🧶✨

Perfect for Halloween parties, costume photos, haunted-house nights, family craft time, cozy seasonal crafting, and unique handmade gifts.


🧶 Create A Halloween Costume You Made Yourself

Store-bought costumes can feel ordinary.

This kit gives you the joy of making something with your own hands — a wearable crochet monster hood that feels personal, creative, and completely different from mass-produced Halloween accessories.

Once finished, it becomes more than a hat.
It becomes a handmade Halloween statement piece people will ask about.


👁️ Six Spooky Monster Styles To Choose From

Choose the Halloween character that matches your spooky style:

💀 Skull Demon Hood
🎃 Pumpkin Monster Hood
🕷️ Spider Monster Hood
🦇 Vampire Bat Hood
👻 Graveyard Ghost Hood
🐈‍⬛ Witch Cat Hood

Each design has its own monster personality, color palette, 3D details, and Halloween charm.


✨ Dramatic 3D Crochet Details

Every hood is designed with eye-catching handmade texture and bold Halloween features.

You’ll love the details:

✔ Thick soft yarn texture
✔ Dimensional monster eyes
✔ Horns, ears, wings, vines, or spooky accents
✔ Layered crochet structure
✔ Long hanging tassels and character details
✔ Wearable hood-style shape
✔ Handmade costume look with cozy Halloween personality

The finished piece looks magical, playful, and full of spooky-season creativity.


🧘 Relaxing & Beginner-Friendly Craft Experience

This kit is designed to make the creative process enjoyable.

Follow the included guide, crochet the hood base, create the character pieces, and assemble the details step by step.

Perfect for:

🎃 Cozy Halloween craft nights
🧶 Crochet lovers
👩‍👧 Family crafting
📸 Halloween costume photos
🕯️ Spooky movie nights
🎁 Handmade gift projects
🧵 Teens and adults who love creative DIY

A fun way to slow down, create, and enjoy the Halloween season.


🏡 Perfect For Halloween Parties & Photos

Once finished, your monster hood is ready to wear, display, or photograph.

Use it for:

🎃 Halloween parties
📸 Costume photoshoots
🏚️ Haunted-house events
🕯️ Spooky home nights
👻 Trick-or-treat styling
🧶 Crochet project displays
🎁 Handmade Halloween gifts

It adds personality, texture, and handmade charm to every spooky-season moment.


🎁 A Gift With A Creative Experience Inside

Looking for a gift that feels fun, different, and memorable?

This crochet kit gives more than a finished product — it gives hours of creative relaxation, a sense of accomplishment, and a wearable Halloween piece at the end.

A thoughtful gift for crochet lovers, crafty friends, moms, daughters, teens, Halloween fans, and anyone who loves handmade seasonal projects.


🎁📦 What’s Included

Each kit includes the essential materials needed to create your selected monster hood design:

✅ Coordinated yarn in character-specific colors
✅ Crochet hook and basic crafting tools
✅ Decorative monster eyes
✅ Stuffing for dimensional details
✅ Stitch markers and assembly accessories
✅ Step-by-step illustrated instruction guide
✅ Materials for 1 selected hood hat design

All-In-One Complete DIY Crochet Kit

Everything is prepared so you can open the kit, follow the guide, and start crafting your Halloween monster hood.


📏 Product Details

Product Name: Halloween Monster Hood DIY Crochet Kit

Product Type: DIY crochet hood hat kit

Theme: Halloween / Monster / Spooky Costume / Handmade Craft

Available Designs: Skull Demon / Pumpkin Monster / Spider Monster / Vampire Bat / Graveyard Ghost / Witch Cat

Construction: Hand-crocheted and assembled

Finished Fit: Wearable hood-style hat

Materials: Yarn, decorative components, stuffing, and basic crochet tools

Project Quantity: Makes 1 hood hat per kit

Use Scene: Halloween costume / craft night / party wear / photo props / handmade gift / cozy seasonal DIY


🌟 Why You’ll Love It

✔ A Halloween project you can actually wear
✔ Six unforgettable monster designs
✔ Soft thick yarn with handmade crochet texture
✔ Bold 3D monster eyes and spooky character details
✔ Fun alternative to ordinary store-bought costumes
✔ Beginner-friendly guided craft experience
✔ Great for Halloween photos, parties, and creative gifting
✔ A finished hood hat you’ll be proud to say you made yourself


❓ Frequently Asked Questions

Q1: Is this kit suitable for beginners?
A: Yes. The step-by-step guide helps make the project approachable for adventurous beginners, while still being fun and satisfying for experienced crocheters.

Q2: Does the kit include the materials I need?
A: Yes. Each kit includes the coordinated yarn, crochet tools, decorative details, stuffing, stitch markers, assembly accessories, and instructions needed for your selected design.

Q3: How many hood styles are available?
A: There are 6 Halloween monster designs available: Skull Demon, Pumpkin Monster, Spider Monster, Vampire Bat, Graveyard Ghost, and Witch Cat.

Q4: Can the finished hood be worn?
A: Yes. The finished project is a wearable hood-style hat that can be used for Halloween parties, costume photos, spooky events, or seasonal fun.

Q5: Is this a good gift for someone who likes crafts?
A: Absolutely. It makes a creative and memorable gift for crochet lovers, Halloween fans, teens, moms, daughters, and crafty friends.

Q6: Does one kit make all six designs?
A: One kit makes one selected hood hat design. Choose your favorite monster style, or select multiple designs to create a full Halloween collection.


⭐ What Our Customers Say ⭐⭐⭐⭐⭐

(Mother & Daughter Halloween Craft) ⭐⭐⭐⭐⭐
— Jennifer M.

"My daughter and I worked on the Pumpkin Monster hood together, and it became our favorite Halloween activity this year. The yarn colors were perfect, the monster eyes made it feel so fun, and she loved helping with the little pumpkin and vine details. It felt so much more special than buying a costume because we actually made it together."

(Pumpkin Monster Hood) ⭐⭐⭐⭐⭐
— Rachel T.

"The finished Pumpkin Monster hood turned out absolutely adorable. My little one couldn’t stop smiling when she tried it on. The thick crochet texture, long tassels, curly vines, and big monster eyes make it look playful and spooky at the same time. It was perfect for Halloween photos and cozy enough to wear around the house."

(Skull Demon Crochet Project) ⭐⭐⭐⭐⭐
— Amanda L.

"I chose the Skull Demon design, and I’m really impressed by all the details. The skull face, horns, red eyes, and hanging tassels slowly came together as I crocheted, and the process was so relaxing. The kit included the yarn colors and little pieces I needed, so it felt easy to follow without being boring."


🎃 Create A Halloween Monster Hood You’ll Be Proud To Wear

A cozy crochet project.
A spooky handmade costume piece.
A Halloween creation full of personality.

Pick your monster style and start crafting your own Halloween hood today. 🧶✨


🎁Don't forget to buy some for your family or friends as it's a unique gift idea.❤️❤️❤️

WHY US?

  • We work directly with manufacturers all over the world to ensure the best quality of our products. We have Quality Control department which help us to keep our promise!
  • Price is always competitive.
  • Awesome Customer Service
  • Amazing products along with High Quality
  • Read reviews from our lovely customers

⚡️Stock Sells Fast!⚡️

Click On "ADD TO CART" To Get Yours Now!


Return Policy

At hipstermaster, we want you to be fully satisfied with your purchase. If you are not completely happy with your order, we offer a 30-day return window under the conditions outlined below.

This policy applies to all items purchased from our online store.

By placing an order, you agree to the terms of this Return Policy.

Return Window

Customers may request a return within 30 days of delivery.

  • Return requests submitted after 30 days will not be accepted
  • The return period begins once the tracking shows the order as delivered

Eligible Conditions for Return

To qualify for a return, items must meet the following conditions:

  • Items must be unworn, unwashed, and unused
  • Items must be in original condition with all tags attached
  • Items must be returned in original packaging
  • Items must not show signs of damage caused by the customer

Non-returnable items may include:

  • Items marked as final sale
  • Items damaged due to misuse or improper handling

Return Request Process

To ensure a smooth return process, please follow the steps below:

Step 1: Contact Customer Service

Email us at:

hipstermasterstroe@hotmail.com

Please include:

  • Order number
  • Reason for return
  • Photos of the item

Step 2: Return Approval

Our team will review your request within 1–2 business days.

If your return is approved, you will receive:

  • Return authorization confirmation
  • Return instructions
  • Return shipping details

Please do not send items back without authorization, as they may not be accepted.

Step 3: Package the Item

Carefully pack the item in its original packaging.

Make sure:

  • All items and tags are included
  • The package is securely sealed to prevent damage during transit

Step 4: Ship the Return

Send the package to the return address provided by our customer service team.

Customers are responsible for return shipping costs unless the item received was incorrect or defective.

We recommend using a trackable shipping service, as we are not responsible for lost return packages.

Step 5: Inspection & Refund Processing

Once we receive your return:

  • Items will be inspected within 3–5 business days
  • If approved, refunds will be processed to your original payment method
  • Processing time for refunds may vary depending on your bank or payment provider (typically 5–10 business days)

Refund Policy

Refunds will be issued after the returned item has been inspected and approved.

  • Shipping fees are non-refundable
  • Refunds are issued only to the original payment method
  • If items do not meet return conditions, the refund may be declined or partially approved

Exchanges

We currently support exchanges depending on stock availability.

If you would like an exchange:

  • Follow the same return process
  • Place a new order if needed for faster replacement

Damaged or Incorrect Items

If the return is caused by the consumer, consumer should be responsible for the shipping fee. The specific fee should be based on the express company you choose.

If due to our reasons, the goods received are damaged or not correct, and the consumer is not required to bear the shipping fee for this reason.

If you receive a damaged, defective, or incorrect item:

  • Contact us within 48 hours of delivery
  • Provide order details and clear photos
  • We will prioritize your case and offer a replacement or refund solution

Contact Us

If you have any questions regarding returns, please get in touch with us:

Phone Number
+1 802-558-7249

Email Address
hipstermasterstroe@hotmail.com
Business Address
247 Pine Creek Ln
Weston, VT 05161
United States

Customer Service Hours (Central Time, USA):
Monday – Friday: 9:00 AM – 6:00 PM
Saturday – Sunday & Public Holidays: Closed

We appreciate your trust in hipstermaster and are committed to ensuring a smooth and fair return experience.

Shipping Policy

Introduction

Thank you for shopping with hipstermaster.

We understand that when you place an order with us, you're excited to receive your items as soon as possible. This Shipping Policy outlines our shipping and delivery process, ensuring transparency and peace of mind throughout.

By placing an order on our website, you agree to the terms and conditions outlined in this Shipping Policy.

1. Order Processing

All orders are carefully reviewed, packed, and prepared by our team before being handed over to our shipping partners.

  • Processing Time:
  • Please allow approximately 14 business days or more for order processing and dispatch. Each order is handled with care, ensuring that your items meet our quality standards before shipping.
  • Processing Delays:
  • During busy seasons, holidays, or special promotions, processing times may be slightly extended. We appreciate your patience and understanding as we work to ensure that every product meets the level of quality that is known for.

You will receive an email confirmation once your order has shipped, including your tracking number and carrier information (if applicable).

2. Shipping Methods and Carriers

We partner with trusted international carriers to ensure your package arrives safely and efficiently. For orders shipped to the United States, we primarily use reputable logistics providers such as:

  • USPS (United States Postal Service)
  • UPS (United Parcel Service)
  • FedEx or other equivalent carriers, depending on your region and order size

For international deliveries outside the U.S., we use reliable global carriers and postal networks to ensure consistent and secure delivery.

3. Estimated Shipping Time

Shipping times vary based on your location, the carrier, and customs processing. Below are general estimated delivery times once your order has been shipped:

  • United States: Approximately 14–25 business days
  • Europe & United Kingdom: Approximately 15–30 business days
  • Australia & New Zealand: Approximately 15–35 business days
  • Asia: Approximately 10–25 business days
  • Other Regions: May take up to 40 business days, depending on local postal services

Currently unavailable for delivery to the following countries/regions:

India, Egypt, Ethiopia, Saudi Arabia, Bangladesh, Singapore, Philippines, Iraq, Pakistan, Albania, Ecuador, Guatemala, Algeria, Myanmar, Thailand, Tunisia, Morocco, Kenya, Palestine, Iran, Uganda

Please note that these are estimated time frames. Actual delivery times may vary due to factors such as customs inspections, local courier schedules, holidays, or weather conditions beyond our control.

Custom-Made Apparel: Extended Processing Time Notice

We are committed to offering high-quality, personalized clothing that fits your unique style. As many of our garments are custom-made to order—including adjustments for size, color, or design—each piece requires additional time for careful production and quality checks.

Please note that custom apparel typically takes 5-10 business days for processing before it is shipped. This is longer than standard ready-to-wear items because our products are handmade. Once your order is dispatched, you will receive a shipping confirmation email with tracking information.

We appreciate your patience and understanding. Creating something special takes time, and we're dedicated to delivering a product that's worth the wait.

For any questions about your order timeline, feel free to contact our customer service team— we're here to help!

4. Shipping Fees

Shipping costs are calculated based on your order amount, delivery location, and shipping method.

  • For some regions, we may offer free shipping on orders exceeding a specific value.
  • Orders below the free shipping threshold will incur shipping fees, which will be calculated at checkout.
  • Any applicable taxes, duties, or customs fees are the customer's responsibility and may vary depending on local regulations.

We always strive to offer competitive shipping rates while maintaining secure and efficient delivery services.

Range of Order Amount Shipping Fee
$00.00-$48.99 $6.97
$49.00-$59.99 $7.97
$60.00-$69.99 $8.97
$70.00-$79.99 $9.97
$80.00 and up Free Shipping

5. Tracking Your Order

Once your order has shipped, you will receive an email notification with your tracking number and a link to track your shipment.

Tracking information may take 2–5 business days to update after your order leaves our warehouse.

If you have not received tracking details within the expected processing period, please contact us at

hipstermasterstroe@hotmail.com, and our team will assist you promptly.

6. Address Accuracy

To ensure timely delivery, please provide a complete and accurate shipping address at checkout.

hipstermaster is not responsible for delays or lost packages resulting from incorrect or incomplete address information provided by the customer.

If you notice an error after placing your order, please get in touch with us immediately. We'll do our best to update your details before processing your order.

7. Customs, Duties, and Taxes

For international shipments, your order may be subject to import duties, taxes, and fees imposed by the customs office of your destination country. These charges are not included in the item price or shipping cost and must be paid by the recipient upon delivery.

hipstermaster has no control over these charges, and customs policies vary widely by country. We recommend contacting your local customs office for more information before placing an international order.

8. Delivery Issues and Lost Packages

We do our best to ensure every package arrives safely. However, if your order is delayed, lost, or arrives damaged, please contact our customer support team immediately at hipstermasterstroe@hotmail.com.

  • If your package is marked as delivered but you did not receive it, please first check with neighbors, your local post office, or the carrier.
  • If the issue persists, contact us within 15 days of the expected delivery date so we can open an investigation with the carrier.

We will work diligently with our shipping partners to resolve any delivery issues as quickly as possible.

9. Returns and Exchanges

If you wish to return or exchange an item, please review our Return & Refund Policy for full details on eligibility, time frames, and return procedures.

Please note that shipping fees are generally non-refundable, except in cases where an item is defective or shipped in error.

10. Changes to This Shipping Policy

hipstermaster reserves the right to update or modify this Shipping Policy at any time without prior notice. Any changes will take effect immediately upon being posted on our website.

We encourage customers to review this page periodically to stay informed about our latest shipping practices and timelines.

11. Contact Us

If you have any questions or concerns about your order or shipping process, please don't hesitate to contact our customer support team:

📧 Email:hipstermasterstroe@hotmail.com

We are always happy to assist you with your order, tracking, or any shipping-related inquiries.

Thank You

At hipstermaster, excellent service doesn't end at checkout. We take pride in delivering your carefully crafted baby clothing safely and securely, wherever you are in the world.

Thank you for choosing hipstermaster — where care, quality, and trust travel with every package.

const TAG = "spz-custom-product-automatic"; class SpzCustomProductAutomatic extends SPZ.BaseElement { constructor(element) { super(element); this.variant_id = 'ca5ce090-b45c-4265-b728-c305f6e3a138'; 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 = 'c40b390d-882b-42af-bc2e-b54e19bdff5b'; // 抽屉购物车全局注入、不按 templates 区分,主题侧暂不支持限制安装位置,非商详页 // 也会渲染本组件。此时 product_id 为空,接口按 UUID 强校验必然报错,先跳过做兼容。 if (!productId) return; 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 == 'c40b390d-882b-42af-bc2e-b54e19bdff5b' && 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 = 'c40b390d-882b-42af-bc2e-b54e19bdff5b'; 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);
No products viewed