$product = {"id":7934925209699,"title":"iPhone 15 Pro SolidX 怪奇物語 奪心魔崛起","handle":"iphone-15-pro-solidx-str07","description":null,"published_at":"2025-12-05T09:35:33+08:00","created_at":"2025-12-04T12:09:29+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-stranger-things","device-iPhone 15 Pro","merge","reseller-stranger-things"],"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":43870594007139,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-STR07","requires_shipping":true,"taxable":true,"featured_image":{"id":34894024114275,"product_id":7934925209699,"position":10,"created_at":"2025-12-04T12:09:39+08:00","updated_at":"2025-12-04T12:09:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f669ebc8898ce43078a6589caf9e21019d9729.webp?v=1764821381","variant_ids":[43870594007139]},"available":true,"name":"iPhone 15 Pro SolidX 怪奇物語 奪心魔崛起 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970B-STR07","featured_media":{"alt":null,"id":26456596250723,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f669ebc8898ce43078a6589caf9e21019d9729.webp?v=1764821381"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43870596759651,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-STR07","requires_shipping":true,"taxable":true,"featured_image":{"id":34894023917667,"product_id":7934925209699,"position":8,"created_at":"2025-12-04T12:09:38+08:00","updated_at":"2025-12-04T12:09:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3294a4e23136bbc302a8d5b35b4836956b750a72.webp?v=1764821380","variant_ids":[43870596759651]},"available":true,"name":"iPhone 15 Pro SolidX 怪奇物語 奪心魔崛起 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129753-STR07","featured_media":{"alt":null,"id":26456596054115,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3294a4e23136bbc302a8d5b35b4836956b750a72.webp?v=1764821380"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43870596857955,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-STR07","requires_shipping":true,"taxable":true,"featured_image":{"id":34894023721059,"product_id":7934925209699,"position":6,"created_at":"2025-12-04T12:09:37+08:00","updated_at":"2025-12-04T12:09:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1fb700d186604dbe72e5a8bdbb3fd88bb0c5fb8.webp?v=1764821379","variant_ids":[43870596857955]},"available":true,"name":"iPhone 15 Pro SolidX 怪奇物語 奪心魔崛起 - 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":"NST01297Z8-STR07","featured_media":{"alt":null,"id":26456595628131,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1fb700d186604dbe72e5a8bdbb3fd88bb0c5fb8.webp?v=1764821379"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43870596890723,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-STR07","requires_shipping":true,"taxable":true,"featured_image":{"id":34894023557219,"product_id":7934925209699,"position":5,"created_at":"2025-12-04T12:09:36+08:00","updated_at":"2025-12-04T12:09:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fcce1ec4d3f195891f61efe8eaa34b78c7175b2d.webp?v=1764821378","variant_ids":[43870596890723]},"available":true,"name":"iPhone 15 Pro SolidX 怪奇物語 奪心魔崛起 - 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":"NST012970A-STR07","featured_media":{"alt":null,"id":26456595497059,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fcce1ec4d3f195891f61efe8eaa34b78c7175b2d.webp?v=1764821378"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43870596989027,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-STR07","requires_shipping":true,"taxable":true,"featured_image":{"id":34894023393379,"product_id":7934925209699,"position":4,"created_at":"2025-12-04T12:09:36+08:00","updated_at":"2025-12-04T12:09:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8ec30ab4db3900ba2f199dc856ee8c52a2bdb18.webp?v=1764821378","variant_ids":[43870596989027]},"available":true,"name":"iPhone 15 Pro SolidX 怪奇物語 奪心魔崛起 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129752-STR07","featured_media":{"alt":null,"id":26456595333219,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8ec30ab4db3900ba2f199dc856ee8c52a2bdb18.webp?v=1764821378"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b104ba93af73d4a8e82f0827673d7025c913d41.webp?v=1764821375","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/018f9ebc60c71ffadad259d17e50b4c922c56225.webp?v=1764821377","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb361e829b7596d8835495ee6bffb9b9cb082aa.webp?v=1764821377","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8ec30ab4db3900ba2f199dc856ee8c52a2bdb18.webp?v=1764821378","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fcce1ec4d3f195891f61efe8eaa34b78c7175b2d.webp?v=1764821378","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1fb700d186604dbe72e5a8bdbb3fd88bb0c5fb8.webp?v=1764821379","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/787db2fb21d4c9202df624360ec96ac8749f5f2f.webp?v=1764821379","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3294a4e23136bbc302a8d5b35b4836956b750a72.webp?v=1764821380","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a4b6b5fe4569c2dc3881dccdd9a22ab73d1161.webp?v=1764821380","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f669ebc8898ce43078a6589caf9e21019d9729.webp?v=1764821381"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b104ba93af73d4a8e82f0827673d7025c913d41.webp?v=1764821375","options":["color"],"media":[{"alt":null,"id":26456594776163,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b104ba93af73d4a8e82f0827673d7025c913d41.webp?v=1764821375"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b104ba93af73d4a8e82f0827673d7025c913d41.webp?v=1764821375","width":2000},{"alt":null,"id":26456594972771,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/018f9ebc60c71ffadad259d17e50b4c922c56225.webp?v=1764821377"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/018f9ebc60c71ffadad259d17e50b4c922c56225.webp?v=1764821377","width":2000},{"alt":null,"id":26456595202147,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb361e829b7596d8835495ee6bffb9b9cb082aa.webp?v=1764821377"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb361e829b7596d8835495ee6bffb9b9cb082aa.webp?v=1764821377","width":2000},{"alt":null,"id":26456595333219,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8ec30ab4db3900ba2f199dc856ee8c52a2bdb18.webp?v=1764821378"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8ec30ab4db3900ba2f199dc856ee8c52a2bdb18.webp?v=1764821378","width":2000},{"alt":null,"id":26456595497059,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fcce1ec4d3f195891f61efe8eaa34b78c7175b2d.webp?v=1764821378"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fcce1ec4d3f195891f61efe8eaa34b78c7175b2d.webp?v=1764821378","width":2000},{"alt":null,"id":26456595628131,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1fb700d186604dbe72e5a8bdbb3fd88bb0c5fb8.webp?v=1764821379"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1fb700d186604dbe72e5a8bdbb3fd88bb0c5fb8.webp?v=1764821379","width":2000},{"alt":null,"id":26456595988579,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/787db2fb21d4c9202df624360ec96ac8749f5f2f.webp?v=1764821379"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/787db2fb21d4c9202df624360ec96ac8749f5f2f.webp?v=1764821379","width":2000},{"alt":null,"id":26456596054115,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3294a4e23136bbc302a8d5b35b4836956b750a72.webp?v=1764821380"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3294a4e23136bbc302a8d5b35b4836956b750a72.webp?v=1764821380","width":2000},{"alt":null,"id":26456596152419,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a4b6b5fe4569c2dc3881dccdd9a22ab73d1161.webp?v=1764821380"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a4b6b5fe4569c2dc3881dccdd9a22ab73d1161.webp?v=1764821380","width":2000},{"alt":null,"id":26456596250723,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f669ebc8898ce43078a6589caf9e21019d9729.webp?v=1764821381"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f669ebc8898ce43078a6589caf9e21019d9729.webp?v=1764821381","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43870594007139,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-STR07","requires_shipping":true,"taxable":true,"featured_image":{"id":34894024114275,"product_id":7934925209699,"position":10,"created_at":"2025-12-04T12:09:39+08:00","updated_at":"2025-12-04T12:09:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f669ebc8898ce43078a6589caf9e21019d9729.webp?v=1764821381","variant_ids":[43870594007139]},"available":true,"name":"iPhone 15 Pro SolidX 怪奇物語 奪心魔崛起 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970B-STR07","featured_media":{"alt":null,"id":26456596250723,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f669ebc8898ce43078a6589caf9e21019d9729.webp?v=1764821381"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43870596759651,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-STR07","requires_shipping":true,"taxable":true,"featured_image":{"id":34894023917667,"product_id":7934925209699,"position":8,"created_at":"2025-12-04T12:09:38+08:00","updated_at":"2025-12-04T12:09:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3294a4e23136bbc302a8d5b35b4836956b750a72.webp?v=1764821380","variant_ids":[43870596759651]},"available":true,"name":"iPhone 15 Pro SolidX 怪奇物語 奪心魔崛起 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129753-STR07","featured_media":{"alt":null,"id":26456596054115,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3294a4e23136bbc302a8d5b35b4836956b750a72.webp?v=1764821380"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43870596857955,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-STR07","requires_shipping":true,"taxable":true,"featured_image":{"id":34894023721059,"product_id":7934925209699,"position":6,"created_at":"2025-12-04T12:09:37+08:00","updated_at":"2025-12-04T12:09:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1fb700d186604dbe72e5a8bdbb3fd88bb0c5fb8.webp?v=1764821379","variant_ids":[43870596857955]},"available":true,"name":"iPhone 15 Pro SolidX 怪奇物語 奪心魔崛起 - 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":"NST01297Z8-STR07","featured_media":{"alt":null,"id":26456595628131,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1fb700d186604dbe72e5a8bdbb3fd88bb0c5fb8.webp?v=1764821379"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43870596890723,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-STR07","requires_shipping":true,"taxable":true,"featured_image":{"id":34894023557219,"product_id":7934925209699,"position":5,"created_at":"2025-12-04T12:09:36+08:00","updated_at":"2025-12-04T12:09:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fcce1ec4d3f195891f61efe8eaa34b78c7175b2d.webp?v=1764821378","variant_ids":[43870596890723]},"available":true,"name":"iPhone 15 Pro SolidX 怪奇物語 奪心魔崛起 - 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":"NST012970A-STR07","featured_media":{"alt":null,"id":26456595497059,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fcce1ec4d3f195891f61efe8eaa34b78c7175b2d.webp?v=1764821378"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43870596989027,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-STR07","requires_shipping":true,"taxable":true,"featured_image":{"id":34894023393379,"product_id":7934925209699,"position":4,"created_at":"2025-12-04T12:09:36+08:00","updated_at":"2025-12-04T12:09:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8ec30ab4db3900ba2f199dc856ee8c52a2bdb18.webp?v=1764821378","variant_ids":[43870596989027]},"available":true,"name":"iPhone 15 Pro SolidX 怪奇物語 奪心魔崛起 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129752-STR07","featured_media":{"alt":null,"id":26456595333219,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8ec30ab4db3900ba2f199dc856ee8c52a2bdb18.webp?v=1764821378"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43870594007139,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-STR07","requires_shipping":true,"taxable":true,"featured_image":{"id":34894024114275,"product_id":7934925209699,"position":10,"created_at":"2025-12-04T12:09:39+08:00","updated_at":"2025-12-04T12:09:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f669ebc8898ce43078a6589caf9e21019d9729.webp?v=1764821381","variant_ids":[43870594007139]},"available":true,"name":"iPhone 15 Pro SolidX 怪奇物語 奪心魔崛起 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970B-STR07","featured_media":{"alt":null,"id":26456596250723,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f669ebc8898ce43078a6589caf9e21019d9729.webp?v=1764821381"}},"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: "停產" }