$product = {"id":7931219083363,"title":"iPhone 12 mini Mod NX (MagSafe 兼容) 白白日記 By Darylhochi 三原色","handle":"iphone-12-mini-mod-nx-magsafe-ei79","description":null,"published_at":"2025-11-28T11:12:54+08:00","created_at":"2025-11-28T09:21:37+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-darylhochi","device-iPhone 12 Mini","merge","reseller-darylhochi"],"price":110000,"price_min":110000,"price_max":110000,"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":43860639088739,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118424-EI79","requires_shipping":true,"taxable":true,"featured_image":{"id":34861345046627,"product_id":7931219083363,"position":16,"created_at":"2025-11-28T09:50:46+08:00","updated_at":"2025-11-28T09:50:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/285a6c8f2060e40472642eefff294eaa8033cb7e_8f9b8b03-e2f3-4159-95d1-24f944e9e65e.webp?v=1764294647","variant_ids":[43860639088739]},"available":true,"name":"iPhone 12 mini Mod NX (MagSafe 兼容) 白白日記 By Darylhochi 三原色 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118424-EI79","featured_media":{"alt":null,"id":26425764675683,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/285a6c8f2060e40472642eefff294eaa8033cb7e_8f9b8b03-e2f3-4159-95d1-24f944e9e65e.webp?v=1764294647"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62309176de6b48605eb5062478497f4292b7c78f.webp?v=1764292903","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5a4a66b0f0878e6873f2388233e6e515f087c6e.webp?v=1764292904","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ef5e06669d98f2fe178f5bffcfc5b407fa47a4.webp?v=1764292904","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2864b528aa172b47207f0a201e43eb0db23c6ac.webp?v=1764292904","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0750a04584acae2f2ea5c4d6b0b1aa0243c82902.webp?v=1764292904","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea87a4cc110a9505abeab95a48037012b834d8cf.webp?v=1764292905","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d78a01567077fcade2370f9d6f22f31a7ab6a1c2.webp?v=1764292905","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/285a6c8f2060e40472642eefff294eaa8033cb7e.webp?v=1764292906","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/306178306ef626d1209d15f0d3fc22e40109415b.webp?v=1764292906","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/268a07d5c3800ffb375a4fe75840c25f3a2fadc2.webp?v=1764292907","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca9e8e7a3573528176df47f86eac6c33c62052a0.webp?v=1764292907","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ef5e06669d98f2fe178f5bffcfc5b407fa47a4_040ab56f-0d31-4bf7-a328-9d46ff4fcb2d.webp?v=1764294646","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca9e8e7a3573528176df47f86eac6c33c62052a0_ab69dca6-0142-4649-b408-ba744de934ad.webp?v=1764294646","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/268a07d5c3800ffb375a4fe75840c25f3a2fadc2_3d356a09-75c7-46ed-bafe-b2ed6b170f4d.webp?v=1764294647","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/306178306ef626d1209d15f0d3fc22e40109415b_c1c42d4a-5490-4a22-a562-d08f19db734b.webp?v=1764294647","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/285a6c8f2060e40472642eefff294eaa8033cb7e_8f9b8b03-e2f3-4159-95d1-24f944e9e65e.webp?v=1764294647","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0750a04584acae2f2ea5c4d6b0b1aa0243c82902_fe130607-ba9e-4792-b396-72f34c1f3698.webp?v=1764294648","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea87a4cc110a9505abeab95a48037012b834d8cf_d0b27843-efeb-4741-804b-2006e98d4e6d.webp?v=1764294648","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d78a01567077fcade2370f9d6f22f31a7ab6a1c2_23ac49ae-833e-4587-865b-17fd524cf2f3.webp?v=1764294649","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2864b528aa172b47207f0a201e43eb0db23c6ac_09e5fc3f-380a-4c37-a470-d824e7625021.webp?v=1764294649","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5a4a66b0f0878e6873f2388233e6e515f087c6e_2578b6c9-88ec-4737-bddd-c7ce1c85dc4d.webp?v=1764294650","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62309176de6b48605eb5062478497f4292b7c78f_e64dca9b-a399-48fd-b66c-f13bdaf06c35.webp?v=1764294650"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62309176de6b48605eb5062478497f4292b7c78f.webp?v=1764292903","options":["color"],"media":[{"alt":null,"id":26425567019107,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62309176de6b48605eb5062478497f4292b7c78f.webp?v=1764292903"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62309176de6b48605eb5062478497f4292b7c78f.webp?v=1764292903","width":2000},{"alt":null,"id":26425567346787,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5a4a66b0f0878e6873f2388233e6e515f087c6e.webp?v=1764292904"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5a4a66b0f0878e6873f2388233e6e515f087c6e.webp?v=1764292904","width":2000},{"alt":null,"id":26425567608931,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ef5e06669d98f2fe178f5bffcfc5b407fa47a4.webp?v=1764292904"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ef5e06669d98f2fe178f5bffcfc5b407fa47a4.webp?v=1764292904","width":2000},{"alt":null,"id":26425567805539,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2864b528aa172b47207f0a201e43eb0db23c6ac.webp?v=1764292904"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2864b528aa172b47207f0a201e43eb0db23c6ac.webp?v=1764292904","width":2000},{"alt":null,"id":26425568034915,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0750a04584acae2f2ea5c4d6b0b1aa0243c82902.webp?v=1764292904"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0750a04584acae2f2ea5c4d6b0b1aa0243c82902.webp?v=1764292904","width":2000},{"alt":null,"id":26425568198755,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea87a4cc110a9505abeab95a48037012b834d8cf.webp?v=1764292905"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea87a4cc110a9505abeab95a48037012b834d8cf.webp?v=1764292905","width":2000},{"alt":null,"id":26425568428131,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d78a01567077fcade2370f9d6f22f31a7ab6a1c2.webp?v=1764292905"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d78a01567077fcade2370f9d6f22f31a7ab6a1c2.webp?v=1764292905","width":2000},{"alt":null,"id":26425568657507,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/285a6c8f2060e40472642eefff294eaa8033cb7e.webp?v=1764292906"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/285a6c8f2060e40472642eefff294eaa8033cb7e.webp?v=1764292906","width":2000},{"alt":null,"id":26425568854115,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/306178306ef626d1209d15f0d3fc22e40109415b.webp?v=1764292906"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/306178306ef626d1209d15f0d3fc22e40109415b.webp?v=1764292906","width":2000},{"alt":null,"id":26425569083491,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/268a07d5c3800ffb375a4fe75840c25f3a2fadc2.webp?v=1764292907"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/268a07d5c3800ffb375a4fe75840c25f3a2fadc2.webp?v=1764292907","width":2000},{"alt":null,"id":26425569312867,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca9e8e7a3573528176df47f86eac6c33c62052a0.webp?v=1764292907"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca9e8e7a3573528176df47f86eac6c33c62052a0.webp?v=1764292907","width":2000},{"alt":null,"id":26425763889251,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ef5e06669d98f2fe178f5bffcfc5b407fa47a4_040ab56f-0d31-4bf7-a328-9d46ff4fcb2d.webp?v=1764294646"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ef5e06669d98f2fe178f5bffcfc5b407fa47a4_040ab56f-0d31-4bf7-a328-9d46ff4fcb2d.webp?v=1764294646","width":2000},{"alt":null,"id":26425764282467,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca9e8e7a3573528176df47f86eac6c33c62052a0_ab69dca6-0142-4649-b408-ba744de934ad.webp?v=1764294646"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca9e8e7a3573528176df47f86eac6c33c62052a0_ab69dca6-0142-4649-b408-ba744de934ad.webp?v=1764294646","width":2000},{"alt":null,"id":26425764446307,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/268a07d5c3800ffb375a4fe75840c25f3a2fadc2_3d356a09-75c7-46ed-bafe-b2ed6b170f4d.webp?v=1764294647"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/268a07d5c3800ffb375a4fe75840c25f3a2fadc2_3d356a09-75c7-46ed-bafe-b2ed6b170f4d.webp?v=1764294647","width":2000},{"alt":null,"id":26425764610147,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/306178306ef626d1209d15f0d3fc22e40109415b_c1c42d4a-5490-4a22-a562-d08f19db734b.webp?v=1764294647"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/306178306ef626d1209d15f0d3fc22e40109415b_c1c42d4a-5490-4a22-a562-d08f19db734b.webp?v=1764294647","width":2000},{"alt":null,"id":26425764675683,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/285a6c8f2060e40472642eefff294eaa8033cb7e_8f9b8b03-e2f3-4159-95d1-24f944e9e65e.webp?v=1764294647"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/285a6c8f2060e40472642eefff294eaa8033cb7e_8f9b8b03-e2f3-4159-95d1-24f944e9e65e.webp?v=1764294647","width":2000},{"alt":null,"id":26425764872291,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0750a04584acae2f2ea5c4d6b0b1aa0243c82902_fe130607-ba9e-4792-b396-72f34c1f3698.webp?v=1764294648"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0750a04584acae2f2ea5c4d6b0b1aa0243c82902_fe130607-ba9e-4792-b396-72f34c1f3698.webp?v=1764294648","width":2000},{"alt":null,"id":26425765068899,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea87a4cc110a9505abeab95a48037012b834d8cf_d0b27843-efeb-4741-804b-2006e98d4e6d.webp?v=1764294648"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea87a4cc110a9505abeab95a48037012b834d8cf_d0b27843-efeb-4741-804b-2006e98d4e6d.webp?v=1764294648","width":2000},{"alt":null,"id":26425765265507,"position":19,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d78a01567077fcade2370f9d6f22f31a7ab6a1c2_23ac49ae-833e-4587-865b-17fd524cf2f3.webp?v=1764294649"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d78a01567077fcade2370f9d6f22f31a7ab6a1c2_23ac49ae-833e-4587-865b-17fd524cf2f3.webp?v=1764294649","width":2000},{"alt":null,"id":26425765396579,"position":20,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2864b528aa172b47207f0a201e43eb0db23c6ac_09e5fc3f-380a-4c37-a470-d824e7625021.webp?v=1764294649"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2864b528aa172b47207f0a201e43eb0db23c6ac_09e5fc3f-380a-4c37-a470-d824e7625021.webp?v=1764294649","width":2000},{"alt":null,"id":26425765494883,"position":21,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5a4a66b0f0878e6873f2388233e6e515f087c6e_2578b6c9-88ec-4737-bddd-c7ce1c85dc4d.webp?v=1764294650"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5a4a66b0f0878e6873f2388233e6e515f087c6e_2578b6c9-88ec-4737-bddd-c7ce1c85dc4d.webp?v=1764294650","width":2000},{"alt":null,"id":26425765593187,"position":22,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62309176de6b48605eb5062478497f4292b7c78f_e64dca9b-a399-48fd-b66c-f13bdaf06c35.webp?v=1764294650"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62309176de6b48605eb5062478497f4292b7c78f_e64dca9b-a399-48fd-b66c-f13bdaf06c35.webp?v=1764294650","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43860639088739,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118424-EI79","requires_shipping":true,"taxable":true,"featured_image":{"id":34861345046627,"product_id":7931219083363,"position":16,"created_at":"2025-11-28T09:50:46+08:00","updated_at":"2025-11-28T09:50:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/285a6c8f2060e40472642eefff294eaa8033cb7e_8f9b8b03-e2f3-4159-95d1-24f944e9e65e.webp?v=1764294647","variant_ids":[43860639088739]},"available":true,"name":"iPhone 12 mini Mod NX (MagSafe 兼容) 白白日記 By Darylhochi 三原色 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118424-EI79","featured_media":{"alt":null,"id":26425764675683,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/285a6c8f2060e40472642eefff294eaa8033cb7e_8f9b8b03-e2f3-4159-95d1-24f944e9e65e.webp?v=1764294647"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43860639088739,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118424-EI79","requires_shipping":true,"taxable":true,"featured_image":{"id":34861345046627,"product_id":7931219083363,"position":16,"created_at":"2025-11-28T09:50:46+08:00","updated_at":"2025-11-28T09:50:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/285a6c8f2060e40472642eefff294eaa8033cb7e_8f9b8b03-e2f3-4159-95d1-24f944e9e65e.webp?v=1764294647","variant_ids":[43860639088739]},"available":true,"name":"iPhone 12 mini Mod NX (MagSafe 兼容) 白白日記 By Darylhochi 三原色 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118424-EI79","featured_media":{"alt":null,"id":26425764675683,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/285a6c8f2060e40472642eefff294eaa8033cb7e_8f9b8b03-e2f3-4159-95d1-24f944e9e65e.webp?v=1764294647"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}; $device_handle = null; $brand_handle = null; $type = ""; var sellingStatus // 只有設計款(SKU 含 '-')才需要合圖 if ($isMerge && $defaultVariant.sku.includes('-')) { $(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: "停產" }