$product = {"id":8012528746595,"title":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙","handle":"iphone-14-plus-solidsuit-classic-magsafe-fug19","description":null,"published_at":"2026-05-14T16:29:44+08:00","created_at":"2026-05-14T15:26:56+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-fuggler","device-iPhone 14 Plus","merge","reseller-fuggler"],"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":44180227260515,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012610F-FUG19","requires_shipping":true,"taxable":true,"featured_image":{"id":35814679248995,"product_id":8012528746595,"position":6,"created_at":"2026-05-14T15:27:32+08:00","updated_at":"2026-05-14T15:27:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/215f22aedb220298f6b0ce49f87a881d74147898.webp?v=1778743654","variant_ids":[44180227260515]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙 - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610F-FUG19","featured_media":{"alt":null,"id":27339642011747,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/215f22aedb220298f6b0ce49f87a881d74147898.webp?v=1778743654"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44180236370019,"title":"Bordeaux Red","option1":"Bordeaux Red","option2":null,"option3":null,"sku":"MST012610D-FUG19","requires_shipping":true,"taxable":true,"featured_image":{"id":35814677774435,"product_id":8012528746595,"position":3,"created_at":"2026-05-14T15:27:27+08:00","updated_at":"2026-05-14T15:27:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc481de3c010464af821b340fcd2df601454e9be.webp?v=1778743649","variant_ids":[44180236370019]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙 - 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":"MST012610D-FUG19","featured_media":{"alt":null,"id":27339640537187,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc481de3c010464af821b340fcd2df601454e9be.webp?v=1778743649"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44180237025379,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012610C-FUG19","requires_shipping":true,"taxable":true,"featured_image":{"id":35814676693091,"product_id":8012528746595,"position":1,"created_at":"2026-05-14T15:27:24+08:00","updated_at":"2026-05-14T15:27:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69219b25699dc475256e3a372d42c76e8e4eb6e2.webp?v=1778743646","variant_ids":[44180237025379]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙 - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610C-FUG19","featured_media":{"alt":null,"id":27339639455843,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69219b25699dc475256e3a372d42c76e8e4eb6e2.webp?v=1778743646"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44180237484131,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01261O9-FUG19","requires_shipping":true,"taxable":true,"featured_image":{"id":35814678888547,"product_id":8012528746595,"position":5,"created_at":"2026-05-14T15:27:30+08:00","updated_at":"2026-05-14T15:27:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0061eb6a2c2f2f141873f2c480ea8764bc535c06.webp?v=1778743652","variant_ids":[44180237484131]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙 - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01261O9-FUG19","featured_media":{"alt":null,"id":27339641651299,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0061eb6a2c2f2f141873f2c480ea8764bc535c06.webp?v=1778743652"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44180238499939,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"MST0126157-FUG19","requires_shipping":true,"taxable":true,"featured_image":{"id":35814678364259,"product_id":8012528746595,"position":4,"created_at":"2026-05-14T15:27:29+08:00","updated_at":"2026-05-14T15:27:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/751dc2aba5f6cc89974e840e709e2a449821c392.webp?v=1778743651","variant_ids":[44180238499939]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126157-FUG19","featured_media":{"alt":null,"id":27339641094243,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/751dc2aba5f6cc89974e840e709e2a449821c392.webp?v=1778743651"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44180238958691,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0126152-FUG19","requires_shipping":true,"taxable":true,"featured_image":{"id":35814677184611,"product_id":8012528746595,"position":2,"created_at":"2026-05-14T15:27:25+08:00","updated_at":"2026-05-14T15:27:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b8fab2175cbff131c009488bf8ec5354f683728.webp?v=1778743648","variant_ids":[44180238958691]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126152-FUG19","featured_media":{"alt":null,"id":27339639947363,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b8fab2175cbff131c009488bf8ec5354f683728.webp?v=1778743648"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69219b25699dc475256e3a372d42c76e8e4eb6e2.webp?v=1778743646","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b8fab2175cbff131c009488bf8ec5354f683728.webp?v=1778743648","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc481de3c010464af821b340fcd2df601454e9be.webp?v=1778743649","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/751dc2aba5f6cc89974e840e709e2a449821c392.webp?v=1778743651","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0061eb6a2c2f2f141873f2c480ea8764bc535c06.webp?v=1778743652","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/215f22aedb220298f6b0ce49f87a881d74147898.webp?v=1778743654"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69219b25699dc475256e3a372d42c76e8e4eb6e2.webp?v=1778743646","options":["color"],"media":[{"alt":null,"id":27339639455843,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69219b25699dc475256e3a372d42c76e8e4eb6e2.webp?v=1778743646"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69219b25699dc475256e3a372d42c76e8e4eb6e2.webp?v=1778743646","width":2000},{"alt":null,"id":27339639947363,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b8fab2175cbff131c009488bf8ec5354f683728.webp?v=1778743648"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b8fab2175cbff131c009488bf8ec5354f683728.webp?v=1778743648","width":2000},{"alt":null,"id":27339640537187,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc481de3c010464af821b340fcd2df601454e9be.webp?v=1778743649"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc481de3c010464af821b340fcd2df601454e9be.webp?v=1778743649","width":2000},{"alt":null,"id":27339641094243,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/751dc2aba5f6cc89974e840e709e2a449821c392.webp?v=1778743651"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/751dc2aba5f6cc89974e840e709e2a449821c392.webp?v=1778743651","width":2000},{"alt":null,"id":27339641651299,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0061eb6a2c2f2f141873f2c480ea8764bc535c06.webp?v=1778743652"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0061eb6a2c2f2f141873f2c480ea8764bc535c06.webp?v=1778743652","width":2000},{"alt":null,"id":27339642011747,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/215f22aedb220298f6b0ce49f87a881d74147898.webp?v=1778743654"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/215f22aedb220298f6b0ce49f87a881d74147898.webp?v=1778743654","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":44180227260515,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012610F-FUG19","requires_shipping":true,"taxable":true,"featured_image":{"id":35814679248995,"product_id":8012528746595,"position":6,"created_at":"2026-05-14T15:27:32+08:00","updated_at":"2026-05-14T15:27:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/215f22aedb220298f6b0ce49f87a881d74147898.webp?v=1778743654","variant_ids":[44180227260515]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙 - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610F-FUG19","featured_media":{"alt":null,"id":27339642011747,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/215f22aedb220298f6b0ce49f87a881d74147898.webp?v=1778743654"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44180236370019,"title":"Bordeaux Red","option1":"Bordeaux Red","option2":null,"option3":null,"sku":"MST012610D-FUG19","requires_shipping":true,"taxable":true,"featured_image":{"id":35814677774435,"product_id":8012528746595,"position":3,"created_at":"2026-05-14T15:27:27+08:00","updated_at":"2026-05-14T15:27:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc481de3c010464af821b340fcd2df601454e9be.webp?v=1778743649","variant_ids":[44180236370019]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙 - 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":"MST012610D-FUG19","featured_media":{"alt":null,"id":27339640537187,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc481de3c010464af821b340fcd2df601454e9be.webp?v=1778743649"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44180237025379,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012610C-FUG19","requires_shipping":true,"taxable":true,"featured_image":{"id":35814676693091,"product_id":8012528746595,"position":1,"created_at":"2026-05-14T15:27:24+08:00","updated_at":"2026-05-14T15:27:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69219b25699dc475256e3a372d42c76e8e4eb6e2.webp?v=1778743646","variant_ids":[44180237025379]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙 - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610C-FUG19","featured_media":{"alt":null,"id":27339639455843,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69219b25699dc475256e3a372d42c76e8e4eb6e2.webp?v=1778743646"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44180237484131,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01261O9-FUG19","requires_shipping":true,"taxable":true,"featured_image":{"id":35814678888547,"product_id":8012528746595,"position":5,"created_at":"2026-05-14T15:27:30+08:00","updated_at":"2026-05-14T15:27:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0061eb6a2c2f2f141873f2c480ea8764bc535c06.webp?v=1778743652","variant_ids":[44180237484131]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙 - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01261O9-FUG19","featured_media":{"alt":null,"id":27339641651299,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0061eb6a2c2f2f141873f2c480ea8764bc535c06.webp?v=1778743652"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44180238499939,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"MST0126157-FUG19","requires_shipping":true,"taxable":true,"featured_image":{"id":35814678364259,"product_id":8012528746595,"position":4,"created_at":"2026-05-14T15:27:29+08:00","updated_at":"2026-05-14T15:27:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/751dc2aba5f6cc89974e840e709e2a449821c392.webp?v=1778743651","variant_ids":[44180238499939]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126157-FUG19","featured_media":{"alt":null,"id":27339641094243,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/751dc2aba5f6cc89974e840e709e2a449821c392.webp?v=1778743651"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44180238958691,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0126152-FUG19","requires_shipping":true,"taxable":true,"featured_image":{"id":35814677184611,"product_id":8012528746595,"position":2,"created_at":"2026-05-14T15:27:25+08:00","updated_at":"2026-05-14T15:27:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b8fab2175cbff131c009488bf8ec5354f683728.webp?v=1778743648","variant_ids":[44180238958691]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126152-FUG19","featured_media":{"alt":null,"id":27339639947363,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b8fab2175cbff131c009488bf8ec5354f683728.webp?v=1778743648"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":44180227260515,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012610F-FUG19","requires_shipping":true,"taxable":true,"featured_image":{"id":35814679248995,"product_id":8012528746595,"position":6,"created_at":"2026-05-14T15:27:32+08:00","updated_at":"2026-05-14T15:27:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/215f22aedb220298f6b0ce49f87a881d74147898.webp?v=1778743654","variant_ids":[44180227260515]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 常態系列 跟著你牙 - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610F-FUG19","featured_media":{"alt":null,"id":27339642011747,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/215f22aedb220298f6b0ce49f87a881d74147898.webp?v=1778743654"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}; $device_handle = null var sellingStatus if ($bumper) { $(document).ready(function() { var productImg = $product.images[0] var bumperVariants = $bumper.variants; var bumperColors = new Object(); var currentVariant = ''; var productType = ''; bumperVariants.forEach(variant => { bumperColors[`${variant.title.split(' (')[0].toLowerCase()}`] = variant.featured_image.src; }); if (productType === 'mod-nx-backplate' || productType === 'mod-backplate') { mergeImages( [productImg, bumperColors[currentVariant]], { crossOrigin: 'anonymous' } ).then(mergedImg => { $('.merged-img').attr('src', mergedImg); }); } else { mergeImages( [bumperColors[currentVariant], productImg], { crossOrigin: 'anonymous' } ).then(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: "停產" }