$product = {"id":8073947054179,"title":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together","handle":"iphone-16-plus-solidx-tb54","description":null,"published_at":"2026-07-20T11:58:39+08:00","created_at":"2026-07-20T11:35:14+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-oracle-redbull-racing","device-iPhone 16 Plus","merge","reseller-oracle-redbull-racing"],"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":44374195208291,"title":"Raspberry Sorbet","option1":"Raspberry Sorbet","option2":null,"option3":null,"sku":"NST013263P-TB54","requires_shipping":true,"taxable":true,"featured_image":{"id":36318515134563,"product_id":8073947054179,"position":1,"created_at":"2026-07-20T11:35:49+08:00","updated_at":"2026-07-20T11:35:51+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a18c5036ab898a77ea417840998d1df9cb9c2130.webp?v=1784518551","variant_ids":[44374195208291]},"available":true,"name":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together - Raspberry Sorbet","public_title":"Raspberry Sorbet","options":["Raspberry Sorbet"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST013263P-TB54","featured_media":{"alt":null,"id":27822471512163,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a18c5036ab898a77ea417840998d1df9cb9c2130.webp?v=1784518551"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44374199763043,"title":"Deep Mauve","option1":"Deep Mauve","option2":null,"option3":null,"sku":"NST013263S-TB54","requires_shipping":true,"taxable":true,"featured_image":{"id":36318517788771,"product_id":8073947054179,"position":4,"created_at":"2026-07-20T11:36:03+08:00","updated_at":"2026-07-20T11:36:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c3376207f7f936708cf4144561abc30214a3526.webp?v=1784518565","variant_ids":[44374199763043]},"available":true,"name":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together - Deep Mauve","public_title":"Deep Mauve","options":["Deep Mauve"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST013263S-TB54","featured_media":{"alt":null,"id":27822474166371,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c3376207f7f936708cf4144561abc30214a3526.webp?v=1784518565"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44374200025187,"title":"Ultra Marine","option1":"Ultra Marine","option2":null,"option3":null,"sku":"NST013263O-TB54","requires_shipping":true,"taxable":true,"featured_image":{"id":36318517526627,"product_id":8073947054179,"position":3,"created_at":"2026-07-20T11:36:01+08:00","updated_at":"2026-07-20T11:36:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8da44afd77b126f63581c0ec7dd21892cae9597.webp?v=1784518563","variant_ids":[44374200025187]},"available":true,"name":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together - Ultra Marine","public_title":"Ultra Marine","options":["Ultra Marine"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST013263O-TB54","featured_media":{"alt":null,"id":27822473904227,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8da44afd77b126f63581c0ec7dd21892cae9597.webp?v=1784518563"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44374200615011,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01326Z8-TB54","requires_shipping":true,"taxable":true,"featured_image":{"id":36318515396707,"product_id":8073947054179,"position":2,"created_at":"2026-07-20T11:35:49+08:00","updated_at":"2026-07-20T11:35:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08a75c8c8a9e48b694c637cc4dc0c9a6591447e1.webp?v=1784518552","variant_ids":[44374200615011]},"available":true,"name":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together - 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":"NST01326Z8-TB54","featured_media":{"alt":null,"id":27822471774307,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08a75c8c8a9e48b694c637cc4dc0c9a6591447e1.webp?v=1784518552"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44374201204835,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0132652-TB54","requires_shipping":true,"taxable":true,"featured_image":{"id":36318519001187,"product_id":8073947054179,"position":6,"created_at":"2026-07-20T11:36:12+08:00","updated_at":"2026-07-20T11:36:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2fac411bf629ee949b7f39967d279dbc048229d2.webp?v=1784518574","variant_ids":[44374201204835]},"available":true,"name":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0132652-TB54","featured_media":{"alt":null,"id":27822475378787,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2fac411bf629ee949b7f39967d279dbc048229d2.webp?v=1784518574"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44374201434211,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01326O8-TB54","requires_shipping":true,"taxable":true,"featured_image":{"id":36318518378595,"product_id":8073947054179,"position":5,"created_at":"2026-07-20T11:36:06+08:00","updated_at":"2026-07-20T11:36:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8f2dc9c57185d9ddcd726422e21b0f0790752c86.webp?v=1784518568","variant_ids":[44374201434211]},"available":true,"name":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01326O8-TB54","featured_media":{"alt":null,"id":27822474756195,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8f2dc9c57185d9ddcd726422e21b0f0790752c86.webp?v=1784518568"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a18c5036ab898a77ea417840998d1df9cb9c2130.webp?v=1784518551","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08a75c8c8a9e48b694c637cc4dc0c9a6591447e1.webp?v=1784518552","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8da44afd77b126f63581c0ec7dd21892cae9597.webp?v=1784518563","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c3376207f7f936708cf4144561abc30214a3526.webp?v=1784518565","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8f2dc9c57185d9ddcd726422e21b0f0790752c86.webp?v=1784518568","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2fac411bf629ee949b7f39967d279dbc048229d2.webp?v=1784518574"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a18c5036ab898a77ea417840998d1df9cb9c2130.webp?v=1784518551","options":["color"],"media":[{"alt":null,"id":27822471512163,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a18c5036ab898a77ea417840998d1df9cb9c2130.webp?v=1784518551"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a18c5036ab898a77ea417840998d1df9cb9c2130.webp?v=1784518551","width":2000},{"alt":null,"id":27822471774307,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08a75c8c8a9e48b694c637cc4dc0c9a6591447e1.webp?v=1784518552"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08a75c8c8a9e48b694c637cc4dc0c9a6591447e1.webp?v=1784518552","width":2000},{"alt":null,"id":27822473904227,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8da44afd77b126f63581c0ec7dd21892cae9597.webp?v=1784518563"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8da44afd77b126f63581c0ec7dd21892cae9597.webp?v=1784518563","width":2000},{"alt":null,"id":27822474166371,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c3376207f7f936708cf4144561abc30214a3526.webp?v=1784518565"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c3376207f7f936708cf4144561abc30214a3526.webp?v=1784518565","width":2000},{"alt":null,"id":27822474756195,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8f2dc9c57185d9ddcd726422e21b0f0790752c86.webp?v=1784518568"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8f2dc9c57185d9ddcd726422e21b0f0790752c86.webp?v=1784518568","width":2000},{"alt":null,"id":27822475378787,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2fac411bf629ee949b7f39967d279dbc048229d2.webp?v=1784518574"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2fac411bf629ee949b7f39967d279dbc048229d2.webp?v=1784518574","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":44374195208291,"title":"Raspberry Sorbet","option1":"Raspberry Sorbet","option2":null,"option3":null,"sku":"NST013263P-TB54","requires_shipping":true,"taxable":true,"featured_image":{"id":36318515134563,"product_id":8073947054179,"position":1,"created_at":"2026-07-20T11:35:49+08:00","updated_at":"2026-07-20T11:35:51+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a18c5036ab898a77ea417840998d1df9cb9c2130.webp?v=1784518551","variant_ids":[44374195208291]},"available":true,"name":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together - Raspberry Sorbet","public_title":"Raspberry Sorbet","options":["Raspberry Sorbet"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST013263P-TB54","featured_media":{"alt":null,"id":27822471512163,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a18c5036ab898a77ea417840998d1df9cb9c2130.webp?v=1784518551"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44374199763043,"title":"Deep Mauve","option1":"Deep Mauve","option2":null,"option3":null,"sku":"NST013263S-TB54","requires_shipping":true,"taxable":true,"featured_image":{"id":36318517788771,"product_id":8073947054179,"position":4,"created_at":"2026-07-20T11:36:03+08:00","updated_at":"2026-07-20T11:36:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c3376207f7f936708cf4144561abc30214a3526.webp?v=1784518565","variant_ids":[44374199763043]},"available":true,"name":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together - Deep Mauve","public_title":"Deep Mauve","options":["Deep Mauve"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST013263S-TB54","featured_media":{"alt":null,"id":27822474166371,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c3376207f7f936708cf4144561abc30214a3526.webp?v=1784518565"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44374200025187,"title":"Ultra Marine","option1":"Ultra Marine","option2":null,"option3":null,"sku":"NST013263O-TB54","requires_shipping":true,"taxable":true,"featured_image":{"id":36318517526627,"product_id":8073947054179,"position":3,"created_at":"2026-07-20T11:36:01+08:00","updated_at":"2026-07-20T11:36:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8da44afd77b126f63581c0ec7dd21892cae9597.webp?v=1784518563","variant_ids":[44374200025187]},"available":true,"name":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together - Ultra Marine","public_title":"Ultra Marine","options":["Ultra Marine"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST013263O-TB54","featured_media":{"alt":null,"id":27822473904227,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8da44afd77b126f63581c0ec7dd21892cae9597.webp?v=1784518563"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44374200615011,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01326Z8-TB54","requires_shipping":true,"taxable":true,"featured_image":{"id":36318515396707,"product_id":8073947054179,"position":2,"created_at":"2026-07-20T11:35:49+08:00","updated_at":"2026-07-20T11:35:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08a75c8c8a9e48b694c637cc4dc0c9a6591447e1.webp?v=1784518552","variant_ids":[44374200615011]},"available":true,"name":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together - 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":"NST01326Z8-TB54","featured_media":{"alt":null,"id":27822471774307,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08a75c8c8a9e48b694c637cc4dc0c9a6591447e1.webp?v=1784518552"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44374201204835,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0132652-TB54","requires_shipping":true,"taxable":true,"featured_image":{"id":36318519001187,"product_id":8073947054179,"position":6,"created_at":"2026-07-20T11:36:12+08:00","updated_at":"2026-07-20T11:36:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2fac411bf629ee949b7f39967d279dbc048229d2.webp?v=1784518574","variant_ids":[44374201204835]},"available":true,"name":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0132652-TB54","featured_media":{"alt":null,"id":27822475378787,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2fac411bf629ee949b7f39967d279dbc048229d2.webp?v=1784518574"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44374201434211,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01326O8-TB54","requires_shipping":true,"taxable":true,"featured_image":{"id":36318518378595,"product_id":8073947054179,"position":5,"created_at":"2026-07-20T11:36:06+08:00","updated_at":"2026-07-20T11:36:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8f2dc9c57185d9ddcd726422e21b0f0790752c86.webp?v=1784518568","variant_ids":[44374201434211]},"available":true,"name":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01326O8-TB54","featured_media":{"alt":null,"id":27822474756195,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8f2dc9c57185d9ddcd726422e21b0f0790752c86.webp?v=1784518568"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":44374195208291,"title":"Raspberry Sorbet","option1":"Raspberry Sorbet","option2":null,"option3":null,"sku":"NST013263P-TB54","requires_shipping":true,"taxable":true,"featured_image":{"id":36318515134563,"product_id":8073947054179,"position":1,"created_at":"2026-07-20T11:35:49+08:00","updated_at":"2026-07-20T11:35:51+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a18c5036ab898a77ea417840998d1df9cb9c2130.webp?v=1784518551","variant_ids":[44374195208291]},"available":true,"name":"iPhone 16 Plus SolidX Oracle Red Bull Racing Driven Together - Raspberry Sorbet","public_title":"Raspberry Sorbet","options":["Raspberry Sorbet"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST013263P-TB54","featured_media":{"alt":null,"id":27822471512163,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a18c5036ab898a77ea417840998d1df9cb9c2130.webp?v=1784518551"}},"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: "停產" }