$product = {"id":7687457341539,"title":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) Tom and Jerry 大臉貼窗","handle":"iphone-12-pro-max-solidsuit-classic-magsafe-po48","description":null,"published_at":"2025-03-24T10:54:11+08:00","created_at":"2024-11-20T14:54:50+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":42977812807779,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118752-PO48","requires_shipping":true,"taxable":true,"featured_image":{"id":34970053116003,"product_id":7687457341539,"position":7,"created_at":"2025-12-19T15:01:05+08:00","updated_at":"2025-12-19T15:01:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17be21084c7dcd003855f0505bfacc38eecec92b.webp?v=1766127667","variant_ids":[42977812807779]},"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-PO48","featured_media":{"alt":null,"id":26531368730723,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17be21084c7dcd003855f0505bfacc38eecec92b.webp?v=1766127667"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977812906083,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01187O9-PO48","requires_shipping":true,"taxable":true,"featured_image":{"id":34970052362339,"product_id":7687457341539,"position":3,"created_at":"2025-12-19T15:01:03+08:00","updated_at":"2025-12-19T15:01:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06c74984238a56954ba571ec0e2830df74d25ef9.webp?v=1766127665","variant_ids":[42977812906083]},"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-PO48","featured_media":{"alt":null,"id":26531367977059,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06c74984238a56954ba571ec0e2830df74d25ef9.webp?v=1766127665"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977813168227,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST011870B-PO48","requires_shipping":true,"taxable":true,"featured_image":{"id":34970052853859,"product_id":7687457341539,"position":6,"created_at":"2025-12-19T15:01:04+08:00","updated_at":"2025-12-19T15:01:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/729e62bf49b5eae50ff93f37091c1b1b3226d7be.webp?v=1766127667","variant_ids":[42977813168227]},"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-PO48","featured_media":{"alt":null,"id":26531368468579,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/729e62bf49b5eae50ff93f37091c1b1b3226d7be.webp?v=1766127667"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977813266531,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST011870C-PO48","requires_shipping":true,"taxable":true,"featured_image":{"id":34970053673059,"product_id":7687457341539,"position":9,"created_at":"2025-12-19T15:01:06+08:00","updated_at":"2025-12-19T15:01:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e7a7f658b0eb6bca82f54eadf56d93b2581aa19.webp?v=1766127668","variant_ids":[42977813266531]},"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-PO48","featured_media":{"alt":null,"id":26531369287779,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e7a7f658b0eb6bca82f54eadf56d93b2581aa19.webp?v=1766127668"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977813299299,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST011870E-PO48","requires_shipping":true,"taxable":true,"featured_image":{"id":34970052165731,"product_id":7687457341539,"position":2,"created_at":"2025-12-19T15:01:02+08:00","updated_at":"2025-12-19T15:01:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82154f12ad49da5ac6c327e39d38990d9819ef47.webp?v=1766127664","variant_ids":[42977813299299]},"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-PO48","featured_media":{"alt":null,"id":26531367878755,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82154f12ad49da5ac6c327e39d38990d9819ef47.webp?v=1766127664"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1f44f267378544d6f485a4d6c52450ec660fa78.webp?v=1732085698","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82154f12ad49da5ac6c327e39d38990d9819ef47.webp?v=1766127664","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06c74984238a56954ba571ec0e2830df74d25ef9.webp?v=1766127665","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee29875c95402a574253291fbc530cbbe0c2e932.webp?v=1766127665","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23dc6a6f8174ef3d707f031b03b447689401e7cd.webp?v=1766127666","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/729e62bf49b5eae50ff93f37091c1b1b3226d7be.webp?v=1766127667","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17be21084c7dcd003855f0505bfacc38eecec92b.webp?v=1766127667","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cedbb267538ab7098f990ddb68b376ea73ce8364.webp?v=1766127668","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e7a7f658b0eb6bca82f54eadf56d93b2581aa19.webp?v=1766127668"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1f44f267378544d6f485a4d6c52450ec660fa78.webp?v=1732085698","options":["color"],"media":[{"alt":null,"id":24985819316323,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1f44f267378544d6f485a4d6c52450ec660fa78.webp?v=1732085698"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1f44f267378544d6f485a4d6c52450ec660fa78.webp?v=1732085698","width":2000},{"alt":null,"id":26531367878755,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82154f12ad49da5ac6c327e39d38990d9819ef47.webp?v=1766127664"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82154f12ad49da5ac6c327e39d38990d9819ef47.webp?v=1766127664","width":2000},{"alt":null,"id":26531367977059,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06c74984238a56954ba571ec0e2830df74d25ef9.webp?v=1766127665"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06c74984238a56954ba571ec0e2830df74d25ef9.webp?v=1766127665","width":2000},{"alt":null,"id":26531368108131,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee29875c95402a574253291fbc530cbbe0c2e932.webp?v=1766127665"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee29875c95402a574253291fbc530cbbe0c2e932.webp?v=1766127665","width":2000},{"alt":null,"id":26531368271971,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23dc6a6f8174ef3d707f031b03b447689401e7cd.webp?v=1766127666"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23dc6a6f8174ef3d707f031b03b447689401e7cd.webp?v=1766127666","width":2000},{"alt":null,"id":26531368468579,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/729e62bf49b5eae50ff93f37091c1b1b3226d7be.webp?v=1766127667"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/729e62bf49b5eae50ff93f37091c1b1b3226d7be.webp?v=1766127667","width":2000},{"alt":null,"id":26531368730723,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17be21084c7dcd003855f0505bfacc38eecec92b.webp?v=1766127667"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17be21084c7dcd003855f0505bfacc38eecec92b.webp?v=1766127667","width":2000},{"alt":null,"id":26531369025635,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cedbb267538ab7098f990ddb68b376ea73ce8364.webp?v=1766127668"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cedbb267538ab7098f990ddb68b376ea73ce8364.webp?v=1766127668","width":2000},{"alt":null,"id":26531369287779,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e7a7f658b0eb6bca82f54eadf56d93b2581aa19.webp?v=1766127668"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e7a7f658b0eb6bca82f54eadf56d93b2581aa19.webp?v=1766127668","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":42977812807779,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118752-PO48","requires_shipping":true,"taxable":true,"featured_image":{"id":34970053116003,"product_id":7687457341539,"position":7,"created_at":"2025-12-19T15:01:05+08:00","updated_at":"2025-12-19T15:01:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17be21084c7dcd003855f0505bfacc38eecec92b.webp?v=1766127667","variant_ids":[42977812807779]},"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-PO48","featured_media":{"alt":null,"id":26531368730723,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17be21084c7dcd003855f0505bfacc38eecec92b.webp?v=1766127667"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977812906083,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01187O9-PO48","requires_shipping":true,"taxable":true,"featured_image":{"id":34970052362339,"product_id":7687457341539,"position":3,"created_at":"2025-12-19T15:01:03+08:00","updated_at":"2025-12-19T15:01:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06c74984238a56954ba571ec0e2830df74d25ef9.webp?v=1766127665","variant_ids":[42977812906083]},"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-PO48","featured_media":{"alt":null,"id":26531367977059,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06c74984238a56954ba571ec0e2830df74d25ef9.webp?v=1766127665"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977813168227,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST011870B-PO48","requires_shipping":true,"taxable":true,"featured_image":{"id":34970052853859,"product_id":7687457341539,"position":6,"created_at":"2025-12-19T15:01:04+08:00","updated_at":"2025-12-19T15:01:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/729e62bf49b5eae50ff93f37091c1b1b3226d7be.webp?v=1766127667","variant_ids":[42977813168227]},"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-PO48","featured_media":{"alt":null,"id":26531368468579,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/729e62bf49b5eae50ff93f37091c1b1b3226d7be.webp?v=1766127667"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977813266531,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST011870C-PO48","requires_shipping":true,"taxable":true,"featured_image":{"id":34970053673059,"product_id":7687457341539,"position":9,"created_at":"2025-12-19T15:01:06+08:00","updated_at":"2025-12-19T15:01:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e7a7f658b0eb6bca82f54eadf56d93b2581aa19.webp?v=1766127668","variant_ids":[42977813266531]},"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-PO48","featured_media":{"alt":null,"id":26531369287779,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e7a7f658b0eb6bca82f54eadf56d93b2581aa19.webp?v=1766127668"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42977813299299,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST011870E-PO48","requires_shipping":true,"taxable":true,"featured_image":{"id":34970052165731,"product_id":7687457341539,"position":2,"created_at":"2025-12-19T15:01:02+08:00","updated_at":"2025-12-19T15:01:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82154f12ad49da5ac6c327e39d38990d9819ef47.webp?v=1766127664","variant_ids":[42977813299299]},"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-PO48","featured_media":{"alt":null,"id":26531367878755,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82154f12ad49da5ac6c327e39d38990d9819ef47.webp?v=1766127664"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":42977812807779,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118752-PO48","requires_shipping":true,"taxable":true,"featured_image":{"id":34970053116003,"product_id":7687457341539,"position":7,"created_at":"2025-12-19T15:01:05+08:00","updated_at":"2025-12-19T15:01:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17be21084c7dcd003855f0505bfacc38eecec92b.webp?v=1766127667","variant_ids":[42977812807779]},"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-PO48","featured_media":{"alt":null,"id":26531368730723,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17be21084c7dcd003855f0505bfacc38eecec92b.webp?v=1766127667"}},"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: "停產" }