$product = {"id":8024689967203,"title":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X","handle":"iphone-12-mini-solidsuit-classic-magsafe-kp07","description":null,"published_at":"2026-06-01T13:50:46+08:00","created_at":"2026-06-01T09:37:48+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-kpop-demon-hunter","device-iPhone 12 Mini","merge","reseller-kpop-demon-hunter"],"price":125000,"price_min":125000,"price_max":125000,"available":true,"price_varies":false,"compare_at_price":null,"compare_at_price_min":0,"compare_at_price_max":0,"compare_at_price_varies":false,"variants":[{"id":44226605416547,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"MST01184Z9-KP07","requires_shipping":true,"taxable":true,"featured_image":{"id":35912825307235,"product_id":8024689967203,"position":5,"created_at":"2026-06-01T09:38:12+08:00","updated_at":"2026-06-01T09:38:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bccb204bc728664d45fb4ae945e03ee412c6dbe.webp?v=1780277894","variant_ids":[44226605416547]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01184Z9-KP07","featured_media":{"alt":null,"id":27436615663715,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bccb204bc728664d45fb4ae945e03ee412c6dbe.webp?v=1780277894"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44226616328291,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST011840E-KP07","requires_shipping":true,"taxable":true,"featured_image":{"id":35912824782947,"product_id":8024689967203,"position":1,"created_at":"2026-06-01T09:38:10+08:00","updated_at":"2026-06-01T09:38:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6bfa339448359eb2d642c4ae510843491ef01ac.webp?v=1780277892","variant_ids":[44226616328291]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X - Parakeet Green","public_title":"Parakeet Green","options":["Parakeet Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011840E-KP07","featured_media":{"alt":null,"id":27436615139427,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6bfa339448359eb2d642c4ae510843491ef01ac.webp?v=1780277892"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44226616557667,"title":"Bordeaux Red","option1":"Bordeaux Red","option2":null,"option3":null,"sku":"MST011840D-KP07","requires_shipping":true,"taxable":true,"featured_image":{"id":35912825012323,"product_id":8024689967203,"position":3,"created_at":"2026-06-01T09:38:11+08:00","updated_at":"2026-06-01T09:38:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b88803792e077981bfeaa42c654901bfeeb5e1b.webp?v=1780277893","variant_ids":[44226616557667]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X - Bordeaux Red","public_title":"Bordeaux Red","options":["Bordeaux Red"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011840D-KP07","featured_media":{"alt":null,"id":27436615368803,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b88803792e077981bfeaa42c654901bfeeb5e1b.webp?v=1780277893"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44226616688739,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"MST011840A-KP07","requires_shipping":true,"taxable":true,"featured_image":{"id":35912825110627,"product_id":8024689967203,"position":4,"created_at":"2026-06-01T09:38:11+08:00","updated_at":"2026-06-01T09:38:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9433f7b0b2b61eaa982df76dcd56012118f63c94.webp?v=1780277893","variant_ids":[44226616688739]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011840A-KP07","featured_media":{"alt":null,"id":27436615467107,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9433f7b0b2b61eaa982df76dcd56012118f63c94.webp?v=1780277893"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44226616852579,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"MST01184Z8-KP07","requires_shipping":true,"taxable":true,"featured_image":{"id":35912825536611,"product_id":8024689967203,"position":6,"created_at":"2026-06-01T09:38:13+08:00","updated_at":"2026-06-01T09:38:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd748db2c47e58bf2e933430ae5725c628cc046d.webp?v=1780277895","variant_ids":[44226616852579]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01184Z8-KP07","featured_media":{"alt":null,"id":27436615893091,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd748db2c47e58bf2e933430ae5725c628cc046d.webp?v=1780277895"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44226617081955,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118452-KP07","requires_shipping":true,"taxable":true,"featured_image":{"id":35912824914019,"product_id":8024689967203,"position":2,"created_at":"2026-06-01T09:38:10+08:00","updated_at":"2026-06-01T09:38:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130385f6f2350c95105341846bd4000a6339faac.webp?v=1780277892","variant_ids":[44226617081955]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0118452-KP07","featured_media":{"alt":null,"id":27436615270499,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130385f6f2350c95105341846bd4000a6339faac.webp?v=1780277892"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6bfa339448359eb2d642c4ae510843491ef01ac.webp?v=1780277892","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130385f6f2350c95105341846bd4000a6339faac.webp?v=1780277892","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b88803792e077981bfeaa42c654901bfeeb5e1b.webp?v=1780277893","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9433f7b0b2b61eaa982df76dcd56012118f63c94.webp?v=1780277893","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bccb204bc728664d45fb4ae945e03ee412c6dbe.webp?v=1780277894","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd748db2c47e58bf2e933430ae5725c628cc046d.webp?v=1780277895"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6bfa339448359eb2d642c4ae510843491ef01ac.webp?v=1780277892","options":["color"],"media":[{"alt":null,"id":27436615139427,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6bfa339448359eb2d642c4ae510843491ef01ac.webp?v=1780277892"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6bfa339448359eb2d642c4ae510843491ef01ac.webp?v=1780277892","width":2000},{"alt":null,"id":27436615270499,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130385f6f2350c95105341846bd4000a6339faac.webp?v=1780277892"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130385f6f2350c95105341846bd4000a6339faac.webp?v=1780277892","width":2000},{"alt":null,"id":27436615368803,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b88803792e077981bfeaa42c654901bfeeb5e1b.webp?v=1780277893"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b88803792e077981bfeaa42c654901bfeeb5e1b.webp?v=1780277893","width":2000},{"alt":null,"id":27436615467107,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9433f7b0b2b61eaa982df76dcd56012118f63c94.webp?v=1780277893"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9433f7b0b2b61eaa982df76dcd56012118f63c94.webp?v=1780277893","width":2000},{"alt":null,"id":27436615663715,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bccb204bc728664d45fb4ae945e03ee412c6dbe.webp?v=1780277894"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bccb204bc728664d45fb4ae945e03ee412c6dbe.webp?v=1780277894","width":2000},{"alt":null,"id":27436615893091,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd748db2c47e58bf2e933430ae5725c628cc046d.webp?v=1780277895"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd748db2c47e58bf2e933430ae5725c628cc046d.webp?v=1780277895","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":44226605416547,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"MST01184Z9-KP07","requires_shipping":true,"taxable":true,"featured_image":{"id":35912825307235,"product_id":8024689967203,"position":5,"created_at":"2026-06-01T09:38:12+08:00","updated_at":"2026-06-01T09:38:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bccb204bc728664d45fb4ae945e03ee412c6dbe.webp?v=1780277894","variant_ids":[44226605416547]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01184Z9-KP07","featured_media":{"alt":null,"id":27436615663715,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bccb204bc728664d45fb4ae945e03ee412c6dbe.webp?v=1780277894"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44226616328291,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST011840E-KP07","requires_shipping":true,"taxable":true,"featured_image":{"id":35912824782947,"product_id":8024689967203,"position":1,"created_at":"2026-06-01T09:38:10+08:00","updated_at":"2026-06-01T09:38:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6bfa339448359eb2d642c4ae510843491ef01ac.webp?v=1780277892","variant_ids":[44226616328291]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X - Parakeet Green","public_title":"Parakeet Green","options":["Parakeet Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011840E-KP07","featured_media":{"alt":null,"id":27436615139427,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6bfa339448359eb2d642c4ae510843491ef01ac.webp?v=1780277892"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44226616557667,"title":"Bordeaux Red","option1":"Bordeaux Red","option2":null,"option3":null,"sku":"MST011840D-KP07","requires_shipping":true,"taxable":true,"featured_image":{"id":35912825012323,"product_id":8024689967203,"position":3,"created_at":"2026-06-01T09:38:11+08:00","updated_at":"2026-06-01T09:38:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b88803792e077981bfeaa42c654901bfeeb5e1b.webp?v=1780277893","variant_ids":[44226616557667]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X - Bordeaux Red","public_title":"Bordeaux Red","options":["Bordeaux Red"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011840D-KP07","featured_media":{"alt":null,"id":27436615368803,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b88803792e077981bfeaa42c654901bfeeb5e1b.webp?v=1780277893"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44226616688739,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"MST011840A-KP07","requires_shipping":true,"taxable":true,"featured_image":{"id":35912825110627,"product_id":8024689967203,"position":4,"created_at":"2026-06-01T09:38:11+08:00","updated_at":"2026-06-01T09:38:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9433f7b0b2b61eaa982df76dcd56012118f63c94.webp?v=1780277893","variant_ids":[44226616688739]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011840A-KP07","featured_media":{"alt":null,"id":27436615467107,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9433f7b0b2b61eaa982df76dcd56012118f63c94.webp?v=1780277893"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44226616852579,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"MST01184Z8-KP07","requires_shipping":true,"taxable":true,"featured_image":{"id":35912825536611,"product_id":8024689967203,"position":6,"created_at":"2026-06-01T09:38:13+08:00","updated_at":"2026-06-01T09:38:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd748db2c47e58bf2e933430ae5725c628cc046d.webp?v=1780277895","variant_ids":[44226616852579]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01184Z8-KP07","featured_media":{"alt":null,"id":27436615893091,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd748db2c47e58bf2e933430ae5725c628cc046d.webp?v=1780277895"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44226617081955,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118452-KP07","requires_shipping":true,"taxable":true,"featured_image":{"id":35912824914019,"product_id":8024689967203,"position":2,"created_at":"2026-06-01T09:38:10+08:00","updated_at":"2026-06-01T09:38:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130385f6f2350c95105341846bd4000a6339faac.webp?v=1780277892","variant_ids":[44226617081955]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0118452-KP07","featured_media":{"alt":null,"id":27436615270499,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130385f6f2350c95105341846bd4000a6339faac.webp?v=1780277892"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":44226605416547,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"MST01184Z9-KP07","requires_shipping":true,"taxable":true,"featured_image":{"id":35912825307235,"product_id":8024689967203,"position":5,"created_at":"2026-06-01T09:38:12+08:00","updated_at":"2026-06-01T09:38:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bccb204bc728664d45fb4ae945e03ee412c6dbe.webp?v=1780277894","variant_ids":[44226605416547]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) KPop獵魔女團 HUNTR\/X - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01184Z9-KP07","featured_media":{"alt":null,"id":27436615663715,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bccb204bc728664d45fb4ae945e03ee412c6dbe.webp?v=1780277894"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}; $device_handle = null; $type = ""; var sellingStatus if ($isMerge) { $(document).ready(function() { var productImg = $product.images[0]; var bumperImg = window.getProductImageUrl($defaultVariant.sku.split('-')[0]); var layers = ($type === 'mod-nx-backplate' || $type === 'mod-backplate') ? [productImg, bumperImg] : [bumperImg, productImg]; window.mergeProductImages(layers).then(function (mergedImg) { $('.merged-img').attr('src', mergedImg); }); }); }; var sellingStatusData window.fetchSellingStatus().then(data => { try { sellingStatusData = data; } catch (error) { sellingStatusData = null console.error('Unable to parse selling status', error) } $(document).ready(function() { handleSellingStatus($defaultVariant.sku); }); }) function handleSellingStatus(currentSku) { if (!sellingStatusData) { console.error('No selling status available!') return } const sellingStatusElement = document.getElementById('selling-status') const addToCartButton = document.getElementById('AddToCart-product-template') const currentProductSku = currentSku.replace(/-(.*)$/, '-') if ($variants) { const flattenedSellingStatus = [...sellingStatusData.pending, ...sellingStatusData.preorder] const matchSellingStatusProduct = flattenedSellingStatus.filter(product => currentProductSku === product.sku) if (matchSellingStatusProduct.length > 0) { const isProductPending = matchSellingStatusProduct[0].status === 'pending' const matchDate = matchSellingStatusProduct[0].date sellingStatus = isProductPending ? "缺貨中" : "預購完成出貨日:" + matchDate sellingStatusElement.textContent = sellingStatus if (sellingStatus.includes("缺貨中")){ addToCartButton.disabled ='true'; addToCartButton.textContent = "缺貨中無法加入購物車" } else { addToCartButton.textContent = "加到購物車" } } else { sellingStatusElement.textContent = '' addToCartButton.textContent = "加到購物車" }; }; }; document.addEventListener('DOMContentLoaded', function () { var currentVariantSelect = document.getElementById('SingleOptionSelector-0') currentVariantSelect.addEventListener('change', function() { var currentSku = $('#current_sku').text() var skuElement = document.getElementById('current-sku') skuElement.textContent = currentSku handleSellingStatus(currentSku) }); });
// Override default values of shop.strings for each template. // Alternate product templates can change values of // add to cart button, sold out, and unavailable states here. theme.productStrings = { addToCart: "加到購物車", soldOut: "售完", unavailable: "停產" }