$product = {"id":7687473889379,"title":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) Tom and Jerry 睡覺好夥伴","handle":"iphone-12-pro-max-solidsuit-classic-magsafe-po47","description":null,"published_at":"2025-12-19T15:29:39+08:00","created_at":"2024-11-20T15:00:15+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師SolidSuit MagSafe專區-湯姆貓與傑利鼠 Tom and Jerry","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-tom-and-jerry","device-iPhone 12 Pro Max","merge","reseller-tom-and-jerry"],"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":42977913897059,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118752-PO47","requires_shipping":true,"taxable":true,"featured_image":{"id":34969933709411,"product_id":7687473889379,"position":3,"created_at":"2025-12-19T14:51:23+08:00","updated_at":"2025-12-19T14:51:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cba7ff1982b4a81a411805b88064fc83a4a5651.webp?v=1766127085","variant_ids":[42977913897059]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) Tom and Jerry 睡覺好夥伴 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0118752-PO47","featured_media":{"alt":null,"id":26531249782883,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cba7ff1982b4a81a411805b88064fc83a4a5651.webp?v=1766127085"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977913995363,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01187O9-PO47","requires_shipping":true,"taxable":true,"featured_image":{"id":34969934626915,"product_id":7687473889379,"position":8,"created_at":"2025-12-19T14:51:26+08:00","updated_at":"2025-12-19T14:51:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0d06eaeb6fc06bad9a13483bf22dd181b6dc63c.webp?v=1766127088","variant_ids":[42977913995363]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) Tom and Jerry 睡覺好夥伴 - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01187O9-PO47","featured_media":{"alt":null,"id":26531250765923,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0d06eaeb6fc06bad9a13483bf22dd181b6dc63c.webp?v=1766127088"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977914257507,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST011870B-PO47","requires_shipping":true,"taxable":true,"featured_image":{"id":34969934299235,"product_id":7687473889379,"position":6,"created_at":"2025-12-19T14:51:25+08:00","updated_at":"2025-12-19T14:51:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f0115354390cd48c91b8f0675f5dbfb3968ca49.webp?v=1766127087","variant_ids":[42977914257507]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) Tom and Jerry 睡覺好夥伴 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870B-PO47","featured_media":{"alt":null,"id":26531250372707,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f0115354390cd48c91b8f0675f5dbfb3968ca49.webp?v=1766127087"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977914355811,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST011870C-PO47","requires_shipping":true,"taxable":true,"featured_image":{"id":34969934397539,"product_id":7687473889379,"position":7,"created_at":"2025-12-19T14:51:25+08:00","updated_at":"2025-12-19T14:51:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/784e67e09d1c4218c3cf07c9dcc84de677dbaf97.webp?v=1766127087","variant_ids":[42977914355811]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) Tom and Jerry 睡覺好夥伴 - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870C-PO47","featured_media":{"alt":null,"id":26531250503779,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/784e67e09d1c4218c3cf07c9dcc84de677dbaf97.webp?v=1766127087"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977914388579,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST011870E-PO47","requires_shipping":true,"taxable":true,"featured_image":{"id":34969933578339,"product_id":7687473889379,"position":2,"created_at":"2025-12-19T14:51:23+08:00","updated_at":"2025-12-19T14:51:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9a31719c766bc87c053a47d8bf3eef9e88484c1.webp?v=1766127085","variant_ids":[42977914388579]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) Tom and Jerry 睡覺好夥伴 - Parakeet Green","public_title":"Parakeet Green","options":["Parakeet Green"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870E-PO47","featured_media":{"alt":null,"id":26531249684579,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9a31719c766bc87c053a47d8bf3eef9e88484c1.webp?v=1766127085"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9605dabbda8a7b1f051e0b77911212a6b8843e6a.webp?v=1732086021","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9a31719c766bc87c053a47d8bf3eef9e88484c1.webp?v=1766127085","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cba7ff1982b4a81a411805b88064fc83a4a5651.webp?v=1766127085","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1818387bada65c721c655a2ef42bca0197bdf694.webp?v=1766127085","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0338639fee1d7dda6760c3373cc1df5d43a5cfe7.webp?v=1766127086","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f0115354390cd48c91b8f0675f5dbfb3968ca49.webp?v=1766127087","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/784e67e09d1c4218c3cf07c9dcc84de677dbaf97.webp?v=1766127087","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0d06eaeb6fc06bad9a13483bf22dd181b6dc63c.webp?v=1766127088","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/761a1bcd892480984fc87c6912a1a4fbe20ce51b.webp?v=1766127088"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9605dabbda8a7b1f051e0b77911212a6b8843e6a.webp?v=1732086021","options":["color"],"media":[{"alt":null,"id":24985858146403,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9605dabbda8a7b1f051e0b77911212a6b8843e6a.webp?v=1732086021"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9605dabbda8a7b1f051e0b77911212a6b8843e6a.webp?v=1732086021","width":2000},{"alt":null,"id":26531249684579,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9a31719c766bc87c053a47d8bf3eef9e88484c1.webp?v=1766127085"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9a31719c766bc87c053a47d8bf3eef9e88484c1.webp?v=1766127085","width":2000},{"alt":null,"id":26531249782883,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cba7ff1982b4a81a411805b88064fc83a4a5651.webp?v=1766127085"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cba7ff1982b4a81a411805b88064fc83a4a5651.webp?v=1766127085","width":2000},{"alt":null,"id":26531250012259,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1818387bada65c721c655a2ef42bca0197bdf694.webp?v=1766127085"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1818387bada65c721c655a2ef42bca0197bdf694.webp?v=1766127085","width":2000},{"alt":null,"id":26531250208867,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0338639fee1d7dda6760c3373cc1df5d43a5cfe7.webp?v=1766127086"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0338639fee1d7dda6760c3373cc1df5d43a5cfe7.webp?v=1766127086","width":2000},{"alt":null,"id":26531250372707,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f0115354390cd48c91b8f0675f5dbfb3968ca49.webp?v=1766127087"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f0115354390cd48c91b8f0675f5dbfb3968ca49.webp?v=1766127087","width":2000},{"alt":null,"id":26531250503779,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/784e67e09d1c4218c3cf07c9dcc84de677dbaf97.webp?v=1766127087"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/784e67e09d1c4218c3cf07c9dcc84de677dbaf97.webp?v=1766127087","width":2000},{"alt":null,"id":26531250765923,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0d06eaeb6fc06bad9a13483bf22dd181b6dc63c.webp?v=1766127088"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0d06eaeb6fc06bad9a13483bf22dd181b6dc63c.webp?v=1766127088","width":2000},{"alt":null,"id":26531250864227,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/761a1bcd892480984fc87c6912a1a4fbe20ce51b.webp?v=1766127088"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/761a1bcd892480984fc87c6912a1a4fbe20ce51b.webp?v=1766127088","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":42977913897059,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118752-PO47","requires_shipping":true,"taxable":true,"featured_image":{"id":34969933709411,"product_id":7687473889379,"position":3,"created_at":"2025-12-19T14:51:23+08:00","updated_at":"2025-12-19T14:51:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cba7ff1982b4a81a411805b88064fc83a4a5651.webp?v=1766127085","variant_ids":[42977913897059]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) Tom and Jerry 睡覺好夥伴 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0118752-PO47","featured_media":{"alt":null,"id":26531249782883,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cba7ff1982b4a81a411805b88064fc83a4a5651.webp?v=1766127085"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977913995363,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01187O9-PO47","requires_shipping":true,"taxable":true,"featured_image":{"id":34969934626915,"product_id":7687473889379,"position":8,"created_at":"2025-12-19T14:51:26+08:00","updated_at":"2025-12-19T14:51:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0d06eaeb6fc06bad9a13483bf22dd181b6dc63c.webp?v=1766127088","variant_ids":[42977913995363]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) Tom and Jerry 睡覺好夥伴 - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01187O9-PO47","featured_media":{"alt":null,"id":26531250765923,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0d06eaeb6fc06bad9a13483bf22dd181b6dc63c.webp?v=1766127088"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977914257507,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST011870B-PO47","requires_shipping":true,"taxable":true,"featured_image":{"id":34969934299235,"product_id":7687473889379,"position":6,"created_at":"2025-12-19T14:51:25+08:00","updated_at":"2025-12-19T14:51:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f0115354390cd48c91b8f0675f5dbfb3968ca49.webp?v=1766127087","variant_ids":[42977914257507]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) Tom and Jerry 睡覺好夥伴 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870B-PO47","featured_media":{"alt":null,"id":26531250372707,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f0115354390cd48c91b8f0675f5dbfb3968ca49.webp?v=1766127087"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977914355811,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST011870C-PO47","requires_shipping":true,"taxable":true,"featured_image":{"id":34969934397539,"product_id":7687473889379,"position":7,"created_at":"2025-12-19T14:51:25+08:00","updated_at":"2025-12-19T14:51:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/784e67e09d1c4218c3cf07c9dcc84de677dbaf97.webp?v=1766127087","variant_ids":[42977914355811]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) Tom and Jerry 睡覺好夥伴 - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870C-PO47","featured_media":{"alt":null,"id":26531250503779,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/784e67e09d1c4218c3cf07c9dcc84de677dbaf97.webp?v=1766127087"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977914388579,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST011870E-PO47","requires_shipping":true,"taxable":true,"featured_image":{"id":34969933578339,"product_id":7687473889379,"position":2,"created_at":"2025-12-19T14:51:23+08:00","updated_at":"2025-12-19T14:51:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9a31719c766bc87c053a47d8bf3eef9e88484c1.webp?v=1766127085","variant_ids":[42977914388579]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) Tom and Jerry 睡覺好夥伴 - Parakeet Green","public_title":"Parakeet Green","options":["Parakeet Green"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870E-PO47","featured_media":{"alt":null,"id":26531249684579,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9a31719c766bc87c053a47d8bf3eef9e88484c1.webp?v=1766127085"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":42977913897059,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118752-PO47","requires_shipping":true,"taxable":true,"featured_image":{"id":34969933709411,"product_id":7687473889379,"position":3,"created_at":"2025-12-19T14:51:23+08:00","updated_at":"2025-12-19T14:51:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cba7ff1982b4a81a411805b88064fc83a4a5651.webp?v=1766127085","variant_ids":[42977913897059]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) Tom and Jerry 睡覺好夥伴 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0118752-PO47","featured_media":{"alt":null,"id":26531249782883,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cba7ff1982b4a81a411805b88064fc83a4a5651.webp?v=1766127085"}},"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: "停產" }