$product = {"id":7892331954275,"title":"iPhone 15 Pro Max SolidX 小王子 星海漂流","handle":"iphone-15-pro-max-solidx-to59","description":null,"published_at":"2025-10-03T10:21:30+08:00","created_at":"2025-10-01T15:28:00+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-le-petit-prince","device-iPhone 15 Pro Max","merge","reseller-le-petit-prince"],"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":43755332206691,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-TO59","requires_shipping":true,"taxable":true,"featured_image":{"id":34541893550179,"product_id":7892331954275,"position":7,"created_at":"2025-10-01T15:28:10+08:00","updated_at":"2025-10-01T15:28:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a91b77d23c8205a5cd068a7187563f8f8bed54b.webp?v=1759303692","variant_ids":[43755332206691]},"available":true,"name":"iPhone 15 Pro Max 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":"NST0129853-TO59","featured_media":{"alt":null,"id":26111658623075,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a91b77d23c8205a5cd068a7187563f8f8bed54b.webp?v=1759303692"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755332239459,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-TO59","requires_shipping":true,"taxable":true,"featured_image":{"id":34541893288035,"product_id":7892331954275,"position":6,"created_at":"2025-10-01T15:28:09+08:00","updated_at":"2025-10-01T15:28:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aac3a109a758bc1e130b254b2e972f43d266613.webp?v=1759303691","variant_ids":[43755332239459]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 星海漂流 - 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":"NST01298O8-TO59","featured_media":{"alt":null,"id":26111658360931,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aac3a109a758bc1e130b254b2e972f43d266613.webp?v=1759303691"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755332337763,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-TO59","requires_shipping":true,"taxable":true,"featured_image":{"id":34541892501603,"product_id":7892331954275,"position":2,"created_at":"2025-10-01T15:28:06+08:00","updated_at":"2025-10-01T15:28:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80510dd3f5e822a8677b8750d88a7baf4a0d7a6c.webp?v=1759303688","variant_ids":[43755332337763]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 星海漂流 - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-TO59","featured_media":{"alt":null,"id":26111657574499,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80510dd3f5e822a8677b8750d88a7baf4a0d7a6c.webp?v=1759303688"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755332370531,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-TO59","requires_shipping":true,"taxable":true,"featured_image":{"id":34541892567139,"product_id":7892331954275,"position":3,"created_at":"2025-10-01T15:28:07+08:00","updated_at":"2025-10-01T15:28:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32bce08b69146868daa64b670a1dbf91a2d30f6d.webp?v=1759303688","variant_ids":[43755332370531]},"available":true,"name":"iPhone 15 Pro Max 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":"NST0129852-TO59","featured_media":{"alt":null,"id":26111657640035,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32bce08b69146868daa64b670a1dbf91a2d30f6d.webp?v=1759303688"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755332436067,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-TO59","requires_shipping":true,"taxable":true,"featured_image":{"id":34541894140003,"product_id":7892331954275,"position":9,"created_at":"2025-10-01T15:28:12+08:00","updated_at":"2025-10-01T15:28:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ec7381ad8638f05df8dc89f6c5c1b186fd1bee0.webp?v=1759303693","variant_ids":[43755332436067]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 星海漂流 - 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":"NST0129857-TO59","featured_media":{"alt":null,"id":26111659212899,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ec7381ad8638f05df8dc89f6c5c1b186fd1bee0.webp?v=1759303693"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90d88772bd7e9bbc9d6687b192168dc915b9ad7c.webp?v=1759303687","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80510dd3f5e822a8677b8750d88a7baf4a0d7a6c.webp?v=1759303688","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32bce08b69146868daa64b670a1dbf91a2d30f6d.webp?v=1759303688","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/934b3094250a603534b8246c4d7bde849c2f6b5d.webp?v=1759303689","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a2def8c0c630fb8f01bcae2152eb5abd29e508d.webp?v=1759303690","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aac3a109a758bc1e130b254b2e972f43d266613.webp?v=1759303691","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a91b77d23c8205a5cd068a7187563f8f8bed54b.webp?v=1759303692","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6d2437e43ecf4c942690562672537b813b812b88.webp?v=1759303693","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ec7381ad8638f05df8dc89f6c5c1b186fd1bee0.webp?v=1759303693","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ada0b4c141060716cc663de3037c7102da6c2ff.webp?v=1759303694"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90d88772bd7e9bbc9d6687b192168dc915b9ad7c.webp?v=1759303687","options":["color"],"media":[{"alt":null,"id":26111657443427,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90d88772bd7e9bbc9d6687b192168dc915b9ad7c.webp?v=1759303687"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90d88772bd7e9bbc9d6687b192168dc915b9ad7c.webp?v=1759303687","width":2000},{"alt":null,"id":26111657574499,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80510dd3f5e822a8677b8750d88a7baf4a0d7a6c.webp?v=1759303688"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80510dd3f5e822a8677b8750d88a7baf4a0d7a6c.webp?v=1759303688","width":2000},{"alt":null,"id":26111657640035,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32bce08b69146868daa64b670a1dbf91a2d30f6d.webp?v=1759303688"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32bce08b69146868daa64b670a1dbf91a2d30f6d.webp?v=1759303688","width":2000},{"alt":null,"id":26111657803875,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/934b3094250a603534b8246c4d7bde849c2f6b5d.webp?v=1759303689"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/934b3094250a603534b8246c4d7bde849c2f6b5d.webp?v=1759303689","width":2000},{"alt":null,"id":26111658131555,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a2def8c0c630fb8f01bcae2152eb5abd29e508d.webp?v=1759303690"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a2def8c0c630fb8f01bcae2152eb5abd29e508d.webp?v=1759303690","width":2000},{"alt":null,"id":26111658360931,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aac3a109a758bc1e130b254b2e972f43d266613.webp?v=1759303691"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aac3a109a758bc1e130b254b2e972f43d266613.webp?v=1759303691","width":2000},{"alt":null,"id":26111658623075,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a91b77d23c8205a5cd068a7187563f8f8bed54b.webp?v=1759303692"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a91b77d23c8205a5cd068a7187563f8f8bed54b.webp?v=1759303692","width":2000},{"alt":null,"id":26111658917987,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6d2437e43ecf4c942690562672537b813b812b88.webp?v=1759303693"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6d2437e43ecf4c942690562672537b813b812b88.webp?v=1759303693","width":2000},{"alt":null,"id":26111659212899,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ec7381ad8638f05df8dc89f6c5c1b186fd1bee0.webp?v=1759303693"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ec7381ad8638f05df8dc89f6c5c1b186fd1bee0.webp?v=1759303693","width":2000},{"alt":null,"id":26111659573347,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ada0b4c141060716cc663de3037c7102da6c2ff.webp?v=1759303694"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ada0b4c141060716cc663de3037c7102da6c2ff.webp?v=1759303694","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43755332206691,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-TO59","requires_shipping":true,"taxable":true,"featured_image":{"id":34541893550179,"product_id":7892331954275,"position":7,"created_at":"2025-10-01T15:28:10+08:00","updated_at":"2025-10-01T15:28:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a91b77d23c8205a5cd068a7187563f8f8bed54b.webp?v=1759303692","variant_ids":[43755332206691]},"available":true,"name":"iPhone 15 Pro Max 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":"NST0129853-TO59","featured_media":{"alt":null,"id":26111658623075,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a91b77d23c8205a5cd068a7187563f8f8bed54b.webp?v=1759303692"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755332239459,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-TO59","requires_shipping":true,"taxable":true,"featured_image":{"id":34541893288035,"product_id":7892331954275,"position":6,"created_at":"2025-10-01T15:28:09+08:00","updated_at":"2025-10-01T15:28:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aac3a109a758bc1e130b254b2e972f43d266613.webp?v=1759303691","variant_ids":[43755332239459]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 星海漂流 - 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":"NST01298O8-TO59","featured_media":{"alt":null,"id":26111658360931,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aac3a109a758bc1e130b254b2e972f43d266613.webp?v=1759303691"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755332337763,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-TO59","requires_shipping":true,"taxable":true,"featured_image":{"id":34541892501603,"product_id":7892331954275,"position":2,"created_at":"2025-10-01T15:28:06+08:00","updated_at":"2025-10-01T15:28:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80510dd3f5e822a8677b8750d88a7baf4a0d7a6c.webp?v=1759303688","variant_ids":[43755332337763]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 星海漂流 - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-TO59","featured_media":{"alt":null,"id":26111657574499,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80510dd3f5e822a8677b8750d88a7baf4a0d7a6c.webp?v=1759303688"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755332370531,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-TO59","requires_shipping":true,"taxable":true,"featured_image":{"id":34541892567139,"product_id":7892331954275,"position":3,"created_at":"2025-10-01T15:28:07+08:00","updated_at":"2025-10-01T15:28:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32bce08b69146868daa64b670a1dbf91a2d30f6d.webp?v=1759303688","variant_ids":[43755332370531]},"available":true,"name":"iPhone 15 Pro Max 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":"NST0129852-TO59","featured_media":{"alt":null,"id":26111657640035,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32bce08b69146868daa64b670a1dbf91a2d30f6d.webp?v=1759303688"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755332436067,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-TO59","requires_shipping":true,"taxable":true,"featured_image":{"id":34541894140003,"product_id":7892331954275,"position":9,"created_at":"2025-10-01T15:28:12+08:00","updated_at":"2025-10-01T15:28:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ec7381ad8638f05df8dc89f6c5c1b186fd1bee0.webp?v=1759303693","variant_ids":[43755332436067]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 星海漂流 - 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":"NST0129857-TO59","featured_media":{"alt":null,"id":26111659212899,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ec7381ad8638f05df8dc89f6c5c1b186fd1bee0.webp?v=1759303693"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43755332206691,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-TO59","requires_shipping":true,"taxable":true,"featured_image":{"id":34541893550179,"product_id":7892331954275,"position":7,"created_at":"2025-10-01T15:28:10+08:00","updated_at":"2025-10-01T15:28:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a91b77d23c8205a5cd068a7187563f8f8bed54b.webp?v=1759303692","variant_ids":[43755332206691]},"available":true,"name":"iPhone 15 Pro Max 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":"NST0129853-TO59","featured_media":{"alt":null,"id":26111658623075,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a91b77d23c8205a5cd068a7187563f8f8bed54b.webp?v=1759303692"}},"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: "停產" }