$product = {"id":7998409834595,"title":"iPhone 15 Plus SolidX (MagSafe 兼容) 太空 Arp 142 Galaxies - Bauhaus Style","handle":"iphone-15-plus-solidx-magsafe-xk30","description":null,"published_at":"2026-04-20T11:54:16+08:00","created_at":"2026-04-20T10:03:55+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nasa","device-iPhone 15 Plus","merge","reseller-nasa"],"price":145000,"price_min":145000,"price_max":145000,"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":44126350835811,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"MNS012960A-XK30","requires_shipping":true,"taxable":true,"featured_image":{"id":36255342395491,"product_id":7998409834595,"position":8,"created_at":"2026-07-14T10:42:22+08:00","updated_at":"2026-07-14T10:42:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efe68537876b9af9bf3b4817a2d822a42a9cb8_f9c4d100-830a-4388-a31d-c446e5b28fcd.webp?v=1783996944","variant_ids":[44126350835811]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 太空 Arp 142 Galaxies - Bauhaus Style - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS012960A-XK30","featured_media":{"alt":null,"id":27759457173603,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efe68537876b9af9bf3b4817a2d822a42a9cb8_f9c4d100-830a-4388-a31d-c446e5b28fcd.webp?v=1783996944"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126350966883,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"MNS01296Z7-XK30","requires_shipping":true,"taxable":true,"featured_image":{"id":36255345573987,"product_id":7998409834595,"position":11,"created_at":"2026-07-14T10:42:27+08:00","updated_at":"2026-07-14T10:42:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/668da4159b278303b0dba4d47a166a991d942a5e_3dcc75bf-1e4b-426f-b243-adda28529838.webp?v=1783996949","variant_ids":[44126350966883]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 太空 Arp 142 Galaxies - Bauhaus Style - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS01296Z7-XK30","featured_media":{"alt":null,"id":27759460352099,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/668da4159b278303b0dba4d47a166a991d942a5e_3dcc75bf-1e4b-426f-b243-adda28529838.webp?v=1783996949"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126351163491,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MNS0129652-XK30","requires_shipping":true,"taxable":true,"featured_image":{"id":36255344918627,"product_id":7998409834595,"position":10,"created_at":"2026-07-14T10:42:25+08:00","updated_at":"2026-07-14T10:42:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab160bf5833409d4555e408896601ab76ec2d925_b8ee3f7a-0508-4a04-9406-991d468386d8.webp?v=1783996947","variant_ids":[44126351163491]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 太空 Arp 142 Galaxies - Bauhaus Style - Black","public_title":"Black","options":["Black"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS0129652-XK30","featured_media":{"alt":null,"id":27759459696739,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab160bf5833409d4555e408896601ab76ec2d925_b8ee3f7a-0508-4a04-9406-991d468386d8.webp?v=1783996947"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126351327331,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"MNS01296O8-XK30","requires_shipping":true,"taxable":true,"featured_image":{"id":36255343411299,"product_id":7998409834595,"position":9,"created_at":"2026-07-14T10:42:23+08:00","updated_at":"2026-07-14T10:42:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebd0f89c3d53eae4d93780564ff0f25e925afff9_22f939ed-f884-466e-b35c-d4658651f127.webp?v=1783996945","variant_ids":[44126351327331]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 太空 Arp 142 Galaxies - Bauhaus Style - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS01296O8-XK30","featured_media":{"alt":null,"id":27759458189411,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebd0f89c3d53eae4d93780564ff0f25e925afff9_22f939ed-f884-466e-b35c-d4658651f127.webp?v=1783996945"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab160bf5833409d4555e408896601ab76ec2d925.webp?v=1776650667","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/081dc6856feb4300db037201d8634ad87076a33a.webp?v=1776650668","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebd0f89c3d53eae4d93780564ff0f25e925afff9.webp?v=1776650668","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a57c1337d7a2c97c3bddbb10306f0483c516a24a.webp?v=1776650669","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/668da4159b278303b0dba4d47a166a991d942a5e.webp?v=1776650670","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b2997bd2ea83ecd4653b43e3559764a1ae6cbae.webp?v=1776650670","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efe68537876b9af9bf3b4817a2d822a42a9cb8.webp?v=1776650670","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efe68537876b9af9bf3b4817a2d822a42a9cb8_f9c4d100-830a-4388-a31d-c446e5b28fcd.webp?v=1783996944","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebd0f89c3d53eae4d93780564ff0f25e925afff9_22f939ed-f884-466e-b35c-d4658651f127.webp?v=1783996945","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab160bf5833409d4555e408896601ab76ec2d925_b8ee3f7a-0508-4a04-9406-991d468386d8.webp?v=1783996947","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/668da4159b278303b0dba4d47a166a991d942a5e_3dcc75bf-1e4b-426f-b243-adda28529838.webp?v=1783996949"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab160bf5833409d4555e408896601ab76ec2d925.webp?v=1776650667","options":["color"],"media":[{"alt":null,"id":27200963477603,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab160bf5833409d4555e408896601ab76ec2d925.webp?v=1776650667"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab160bf5833409d4555e408896601ab76ec2d925.webp?v=1776650667","width":2000},{"alt":null,"id":27200963575907,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/081dc6856feb4300db037201d8634ad87076a33a.webp?v=1776650668"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/081dc6856feb4300db037201d8634ad87076a33a.webp?v=1776650668","width":2000},{"alt":null,"id":27200963674211,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebd0f89c3d53eae4d93780564ff0f25e925afff9.webp?v=1776650668"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebd0f89c3d53eae4d93780564ff0f25e925afff9.webp?v=1776650668","width":2000},{"alt":null,"id":27200963838051,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a57c1337d7a2c97c3bddbb10306f0483c516a24a.webp?v=1776650669"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a57c1337d7a2c97c3bddbb10306f0483c516a24a.webp?v=1776650669","width":2000},{"alt":null,"id":27200964132963,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/668da4159b278303b0dba4d47a166a991d942a5e.webp?v=1776650670"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/668da4159b278303b0dba4d47a166a991d942a5e.webp?v=1776650670","width":2000},{"alt":null,"id":27200964296803,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b2997bd2ea83ecd4653b43e3559764a1ae6cbae.webp?v=1776650670"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b2997bd2ea83ecd4653b43e3559764a1ae6cbae.webp?v=1776650670","width":2000},{"alt":null,"id":27200964427875,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efe68537876b9af9bf3b4817a2d822a42a9cb8.webp?v=1776650670"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efe68537876b9af9bf3b4817a2d822a42a9cb8.webp?v=1776650670","width":2000},{"alt":null,"id":27759457173603,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efe68537876b9af9bf3b4817a2d822a42a9cb8_f9c4d100-830a-4388-a31d-c446e5b28fcd.webp?v=1783996944"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efe68537876b9af9bf3b4817a2d822a42a9cb8_f9c4d100-830a-4388-a31d-c446e5b28fcd.webp?v=1783996944","width":2000},{"alt":null,"id":27759458189411,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebd0f89c3d53eae4d93780564ff0f25e925afff9_22f939ed-f884-466e-b35c-d4658651f127.webp?v=1783996945"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebd0f89c3d53eae4d93780564ff0f25e925afff9_22f939ed-f884-466e-b35c-d4658651f127.webp?v=1783996945","width":2000},{"alt":null,"id":27759459696739,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab160bf5833409d4555e408896601ab76ec2d925_b8ee3f7a-0508-4a04-9406-991d468386d8.webp?v=1783996947"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab160bf5833409d4555e408896601ab76ec2d925_b8ee3f7a-0508-4a04-9406-991d468386d8.webp?v=1783996947","width":2000},{"alt":null,"id":27759460352099,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/668da4159b278303b0dba4d47a166a991d942a5e_3dcc75bf-1e4b-426f-b243-adda28529838.webp?v=1783996949"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/668da4159b278303b0dba4d47a166a991d942a5e_3dcc75bf-1e4b-426f-b243-adda28529838.webp?v=1783996949","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":44126350835811,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"MNS012960A-XK30","requires_shipping":true,"taxable":true,"featured_image":{"id":36255342395491,"product_id":7998409834595,"position":8,"created_at":"2026-07-14T10:42:22+08:00","updated_at":"2026-07-14T10:42:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efe68537876b9af9bf3b4817a2d822a42a9cb8_f9c4d100-830a-4388-a31d-c446e5b28fcd.webp?v=1783996944","variant_ids":[44126350835811]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 太空 Arp 142 Galaxies - Bauhaus Style - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS012960A-XK30","featured_media":{"alt":null,"id":27759457173603,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efe68537876b9af9bf3b4817a2d822a42a9cb8_f9c4d100-830a-4388-a31d-c446e5b28fcd.webp?v=1783996944"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126350966883,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"MNS01296Z7-XK30","requires_shipping":true,"taxable":true,"featured_image":{"id":36255345573987,"product_id":7998409834595,"position":11,"created_at":"2026-07-14T10:42:27+08:00","updated_at":"2026-07-14T10:42:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/668da4159b278303b0dba4d47a166a991d942a5e_3dcc75bf-1e4b-426f-b243-adda28529838.webp?v=1783996949","variant_ids":[44126350966883]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 太空 Arp 142 Galaxies - Bauhaus Style - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS01296Z7-XK30","featured_media":{"alt":null,"id":27759460352099,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/668da4159b278303b0dba4d47a166a991d942a5e_3dcc75bf-1e4b-426f-b243-adda28529838.webp?v=1783996949"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126351163491,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MNS0129652-XK30","requires_shipping":true,"taxable":true,"featured_image":{"id":36255344918627,"product_id":7998409834595,"position":10,"created_at":"2026-07-14T10:42:25+08:00","updated_at":"2026-07-14T10:42:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab160bf5833409d4555e408896601ab76ec2d925_b8ee3f7a-0508-4a04-9406-991d468386d8.webp?v=1783996947","variant_ids":[44126351163491]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 太空 Arp 142 Galaxies - Bauhaus Style - Black","public_title":"Black","options":["Black"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS0129652-XK30","featured_media":{"alt":null,"id":27759459696739,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab160bf5833409d4555e408896601ab76ec2d925_b8ee3f7a-0508-4a04-9406-991d468386d8.webp?v=1783996947"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126351327331,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"MNS01296O8-XK30","requires_shipping":true,"taxable":true,"featured_image":{"id":36255343411299,"product_id":7998409834595,"position":9,"created_at":"2026-07-14T10:42:23+08:00","updated_at":"2026-07-14T10:42:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebd0f89c3d53eae4d93780564ff0f25e925afff9_22f939ed-f884-466e-b35c-d4658651f127.webp?v=1783996945","variant_ids":[44126351327331]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 太空 Arp 142 Galaxies - Bauhaus Style - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS01296O8-XK30","featured_media":{"alt":null,"id":27759458189411,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebd0f89c3d53eae4d93780564ff0f25e925afff9_22f939ed-f884-466e-b35c-d4658651f127.webp?v=1783996945"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":44126350835811,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"MNS012960A-XK30","requires_shipping":true,"taxable":true,"featured_image":{"id":36255342395491,"product_id":7998409834595,"position":8,"created_at":"2026-07-14T10:42:22+08:00","updated_at":"2026-07-14T10:42:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efe68537876b9af9bf3b4817a2d822a42a9cb8_f9c4d100-830a-4388-a31d-c446e5b28fcd.webp?v=1783996944","variant_ids":[44126350835811]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 太空 Arp 142 Galaxies - Bauhaus Style - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS012960A-XK30","featured_media":{"alt":null,"id":27759457173603,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efe68537876b9af9bf3b4817a2d822a42a9cb8_f9c4d100-830a-4388-a31d-c446e5b28fcd.webp?v=1783996944"}},"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: "停產" }