$product = {"id":7829083095139,"title":"iPhone 15 Pro Max SolidX 中信兄弟 BROTHERS 洲際高校心動粉-詹子賢","handle":"iphone-15-pro-max-solidx-bumper-back-crossover-design-jz51","description":null,"published_at":"2025-07-01T16:32:30+08:00","created_at":"2025-06-30T16:12:20+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-brothers","device-iPhone 15 Pro Max","merge","reseller-brothers"],"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":43502891597923,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-JZ51","requires_shipping":true,"taxable":true,"featured_image":{"id":34099846381667,"product_id":7829083095139,"position":3,"created_at":"2025-06-30T16:12:25+08:00","updated_at":"2025-06-30T16:12:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/024bdfad2aa23bfa14a68538c15a617e2639a2a9.webp?v=1751271147","variant_ids":[43502891597923]},"available":true,"name":"iPhone 15 Pro Max SolidX 中信兄弟 BROTHERS 洲際高校心動粉-詹子賢 - 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-JZ51","featured_media":{"alt":null,"id":25756349825123,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/024bdfad2aa23bfa14a68538c15a617e2639a2a9.webp?v=1751271147"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502895857763,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-JZ51","requires_shipping":true,"taxable":true,"featured_image":{"id":34099849560163,"product_id":7829083095139,"position":10,"created_at":"2025-06-30T16:12:29+08:00","updated_at":"2025-06-30T16:12:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e749c1ac075315a959c1054ba4cc6cc13056aaa8.webp?v=1751271151","variant_ids":[43502895857763]},"available":true,"name":"iPhone 15 Pro Max SolidX 中信兄弟 BROTHERS 洲際高校心動粉-詹子賢 - 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-JZ51","featured_media":{"alt":null,"id":25756351856739,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e749c1ac075315a959c1054ba4cc6cc13056aaa8.webp?v=1751271151"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502896021603,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-JZ51","requires_shipping":true,"taxable":true,"featured_image":{"id":34099845267555,"product_id":7829083095139,"position":1,"created_at":"2025-06-30T16:12:24+08:00","updated_at":"2025-06-30T16:12:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b22081697419551807ae03032aeb8e907307dbd3.webp?v=1751271146","variant_ids":[43502896021603]},"available":true,"name":"iPhone 15 Pro Max SolidX 中信兄弟 BROTHERS 洲際高校心動粉-詹子賢 - 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-JZ51","featured_media":{"alt":null,"id":25756349071459,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b22081697419551807ae03032aeb8e907307dbd3.webp?v=1751271146"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502896054371,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-JZ51","requires_shipping":true,"taxable":true,"featured_image":{"id":34099848970339,"product_id":7829083095139,"position":8,"created_at":"2025-06-30T16:12:28+08:00","updated_at":"2025-06-30T16:12:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/948cef0bf5db914e35335a012ab9c86748552b2c.webp?v=1751271150","variant_ids":[43502896054371]},"available":true,"name":"iPhone 15 Pro Max SolidX 中信兄弟 BROTHERS 洲際高校心動粉-詹子賢 - 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-JZ51","featured_media":{"alt":null,"id":25756351201379,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/948cef0bf5db914e35335a012ab9c86748552b2c.webp?v=1751271150"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502896087139,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-JZ51","requires_shipping":true,"taxable":true,"featured_image":{"id":34099848577123,"product_id":7829083095139,"position":7,"created_at":"2025-06-30T16:12:27+08:00","updated_at":"2025-06-30T16:12:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/966ad28a4382be03296107917632930a41422d70.webp?v=1751271149","variant_ids":[43502896087139]},"available":true,"name":"iPhone 15 Pro Max SolidX 中信兄弟 BROTHERS 洲際高校心動粉-詹子賢 - 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-JZ51","featured_media":{"alt":null,"id":25756351004771,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/966ad28a4382be03296107917632930a41422d70.webp?v=1751271149"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b22081697419551807ae03032aeb8e907307dbd3.webp?v=1751271146","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5078df94544cb115fe2e6a167e06c4b37073aca5.webp?v=1751271147","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/024bdfad2aa23bfa14a68538c15a617e2639a2a9.webp?v=1751271147","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2826a296703c95200524078a4ea23bb40a249860.webp?v=1751271147","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8d6e997d6c857d1a79b636f0a99cc7990d3fc186.webp?v=1751271148","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6fe1cabe04ec681eaff3079c1acf81e29877053.webp?v=1751271149","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/966ad28a4382be03296107917632930a41422d70.webp?v=1751271149","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/948cef0bf5db914e35335a012ab9c86748552b2c.webp?v=1751271150","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d9dc36e7f5036ded904801013b365e26b8a8ccf.webp?v=1751271150","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e749c1ac075315a959c1054ba4cc6cc13056aaa8.webp?v=1751271151"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b22081697419551807ae03032aeb8e907307dbd3.webp?v=1751271146","options":["color"],"media":[{"alt":null,"id":25756349071459,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b22081697419551807ae03032aeb8e907307dbd3.webp?v=1751271146"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b22081697419551807ae03032aeb8e907307dbd3.webp?v=1751271146","width":2000},{"alt":null,"id":25756349333603,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5078df94544cb115fe2e6a167e06c4b37073aca5.webp?v=1751271147"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5078df94544cb115fe2e6a167e06c4b37073aca5.webp?v=1751271147","width":2000},{"alt":null,"id":25756349825123,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/024bdfad2aa23bfa14a68538c15a617e2639a2a9.webp?v=1751271147"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/024bdfad2aa23bfa14a68538c15a617e2639a2a9.webp?v=1751271147","width":2000},{"alt":null,"id":25756350185571,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2826a296703c95200524078a4ea23bb40a249860.webp?v=1751271147"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2826a296703c95200524078a4ea23bb40a249860.webp?v=1751271147","width":2000},{"alt":null,"id":25756350546019,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8d6e997d6c857d1a79b636f0a99cc7990d3fc186.webp?v=1751271148"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8d6e997d6c857d1a79b636f0a99cc7990d3fc186.webp?v=1751271148","width":2000},{"alt":null,"id":25756350775395,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6fe1cabe04ec681eaff3079c1acf81e29877053.webp?v=1751271149"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6fe1cabe04ec681eaff3079c1acf81e29877053.webp?v=1751271149","width":2000},{"alt":null,"id":25756351004771,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/966ad28a4382be03296107917632930a41422d70.webp?v=1751271149"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/966ad28a4382be03296107917632930a41422d70.webp?v=1751271149","width":2000},{"alt":null,"id":25756351201379,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/948cef0bf5db914e35335a012ab9c86748552b2c.webp?v=1751271150"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/948cef0bf5db914e35335a012ab9c86748552b2c.webp?v=1751271150","width":2000},{"alt":null,"id":25756351660131,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d9dc36e7f5036ded904801013b365e26b8a8ccf.webp?v=1751271150"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d9dc36e7f5036ded904801013b365e26b8a8ccf.webp?v=1751271150","width":2000},{"alt":null,"id":25756351856739,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e749c1ac075315a959c1054ba4cc6cc13056aaa8.webp?v=1751271151"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e749c1ac075315a959c1054ba4cc6cc13056aaa8.webp?v=1751271151","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43502891597923,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-JZ51","requires_shipping":true,"taxable":true,"featured_image":{"id":34099846381667,"product_id":7829083095139,"position":3,"created_at":"2025-06-30T16:12:25+08:00","updated_at":"2025-06-30T16:12:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/024bdfad2aa23bfa14a68538c15a617e2639a2a9.webp?v=1751271147","variant_ids":[43502891597923]},"available":true,"name":"iPhone 15 Pro Max SolidX 中信兄弟 BROTHERS 洲際高校心動粉-詹子賢 - 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-JZ51","featured_media":{"alt":null,"id":25756349825123,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/024bdfad2aa23bfa14a68538c15a617e2639a2a9.webp?v=1751271147"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502895857763,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-JZ51","requires_shipping":true,"taxable":true,"featured_image":{"id":34099849560163,"product_id":7829083095139,"position":10,"created_at":"2025-06-30T16:12:29+08:00","updated_at":"2025-06-30T16:12:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e749c1ac075315a959c1054ba4cc6cc13056aaa8.webp?v=1751271151","variant_ids":[43502895857763]},"available":true,"name":"iPhone 15 Pro Max SolidX 中信兄弟 BROTHERS 洲際高校心動粉-詹子賢 - 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-JZ51","featured_media":{"alt":null,"id":25756351856739,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e749c1ac075315a959c1054ba4cc6cc13056aaa8.webp?v=1751271151"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502896021603,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-JZ51","requires_shipping":true,"taxable":true,"featured_image":{"id":34099845267555,"product_id":7829083095139,"position":1,"created_at":"2025-06-30T16:12:24+08:00","updated_at":"2025-06-30T16:12:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b22081697419551807ae03032aeb8e907307dbd3.webp?v=1751271146","variant_ids":[43502896021603]},"available":true,"name":"iPhone 15 Pro Max SolidX 中信兄弟 BROTHERS 洲際高校心動粉-詹子賢 - 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-JZ51","featured_media":{"alt":null,"id":25756349071459,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b22081697419551807ae03032aeb8e907307dbd3.webp?v=1751271146"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502896054371,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-JZ51","requires_shipping":true,"taxable":true,"featured_image":{"id":34099848970339,"product_id":7829083095139,"position":8,"created_at":"2025-06-30T16:12:28+08:00","updated_at":"2025-06-30T16:12:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/948cef0bf5db914e35335a012ab9c86748552b2c.webp?v=1751271150","variant_ids":[43502896054371]},"available":true,"name":"iPhone 15 Pro Max SolidX 中信兄弟 BROTHERS 洲際高校心動粉-詹子賢 - 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-JZ51","featured_media":{"alt":null,"id":25756351201379,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/948cef0bf5db914e35335a012ab9c86748552b2c.webp?v=1751271150"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502896087139,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-JZ51","requires_shipping":true,"taxable":true,"featured_image":{"id":34099848577123,"product_id":7829083095139,"position":7,"created_at":"2025-06-30T16:12:27+08:00","updated_at":"2025-06-30T16:12:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/966ad28a4382be03296107917632930a41422d70.webp?v=1751271149","variant_ids":[43502896087139]},"available":true,"name":"iPhone 15 Pro Max SolidX 中信兄弟 BROTHERS 洲際高校心動粉-詹子賢 - 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-JZ51","featured_media":{"alt":null,"id":25756351004771,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/966ad28a4382be03296107917632930a41422d70.webp?v=1751271149"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43502891597923,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-JZ51","requires_shipping":true,"taxable":true,"featured_image":{"id":34099846381667,"product_id":7829083095139,"position":3,"created_at":"2025-06-30T16:12:25+08:00","updated_at":"2025-06-30T16:12:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/024bdfad2aa23bfa14a68538c15a617e2639a2a9.webp?v=1751271147","variant_ids":[43502891597923]},"available":true,"name":"iPhone 15 Pro Max SolidX 中信兄弟 BROTHERS 洲際高校心動粉-詹子賢 - 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-JZ51","featured_media":{"alt":null,"id":25756349825123,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/024bdfad2aa23bfa14a68538c15a617e2639a2a9.webp?v=1751271147"}},"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: "停產" }