$product = {"id":7921278320739,"title":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Journey","handle":"iphone-14-pro-mod-nx-magsafe-ec77","description":null,"published_at":"2025-11-14T10:29:35+08:00","created_at":"2025-11-11T10:35:47+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-bylobster","device-iPhone 14 Pro","merge","reseller-bylobster"],"price":110000,"price_min":110000,"price_max":110000,"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":43831432183907,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-EC77","requires_shipping":true,"taxable":true,"featured_image":{"id":36054666444899,"product_id":7921278320739,"position":14,"created_at":"2026-06-23T09:57:41+08:00","updated_at":"2026-06-23T09:57:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cba8cd898bb0d4785706de704bdd58bd69b5114f_f8343c33-5573-4850-978c-eade6f1dd535.webp?v=1782179863","variant_ids":[43831432183907]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Journey - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01262J5-EC77","featured_media":{"alt":null,"id":27567516844131,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cba8cd898bb0d4785706de704bdd58bd69b5114f_f8343c33-5573-4850-978c-eade6f1dd535.webp?v=1782179863"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43831432347747,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-EC77","requires_shipping":true,"taxable":true,"featured_image":{"id":36054666117219,"product_id":7921278320739,"position":13,"created_at":"2026-06-23T09:57:40+08:00","updated_at":"2026-06-23T09:57:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3d330fb611b1278e9a1fad77eb5679e67fd8cc_fda06680-0eb2-4624-a70b-7225fa9da5ab.webp?v=1782179862","variant_ids":[43831432347747]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Journey - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126224-EC77","featured_media":{"alt":null,"id":27567516483683,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3d330fb611b1278e9a1fad77eb5679e67fd8cc_fda06680-0eb2-4624-a70b-7225fa9da5ab.webp?v=1782179862"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43831432446051,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-EC77","requires_shipping":true,"taxable":true,"featured_image":{"id":36054666608739,"product_id":7921278320739,"position":15,"created_at":"2026-06-23T09:57:41+08:00","updated_at":"2026-06-23T09:57:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfca9d6dd3c5ed3c4b1732c5f11ce81383ff1ee6_2acf1588-2236-42ed-b340-9645cdb0e4c3.webp?v=1782179864","variant_ids":[43831432446051]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Journey - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126204-EC77","featured_media":{"alt":null,"id":27567517007971,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfca9d6dd3c5ed3c4b1732c5f11ce81383ff1ee6_2acf1588-2236-42ed-b340-9645cdb0e4c3.webp?v=1782179864"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cba8cd898bb0d4785706de704bdd58bd69b5114f.webp?v=1762828550","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2bd68e66ebdfe91004b67dea83da2f643bd14ca9.webp?v=1762828551","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a6522fa4b5725c8dae1c6b515b4aab59397bc0b.webp?v=1762828552","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/84a69f529d76b81435c082781ed0b4b5e3f49704.webp?v=1762828553","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da892d9f2e5bb5678302f39f354fa518f3387ca7.webp?v=1762828553","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff33d5a4ada6e3880a3ba70d8198e17689b385bb.webp?v=1762828554","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d04a804e2f2882d60a89f45a88267e21a68b47.webp?v=1762828554","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c5359d3b731729c01c924ec3b7a3fc06c2dce78.webp?v=1762828555","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a8efa4425d54d1a8f72eb029362f54f1424709be.webp?v=1762828556","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3d330fb611b1278e9a1fad77eb5679e67fd8cc.webp?v=1762828557","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfca9d6dd3c5ed3c4b1732c5f11ce81383ff1ee6.webp?v=1762828557","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3118b41ce895f9cfc3fb6c0176e6161cf0475070.webp?v=1762828558","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3d330fb611b1278e9a1fad77eb5679e67fd8cc_fda06680-0eb2-4624-a70b-7225fa9da5ab.webp?v=1782179862","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cba8cd898bb0d4785706de704bdd58bd69b5114f_f8343c33-5573-4850-978c-eade6f1dd535.webp?v=1782179863","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfca9d6dd3c5ed3c4b1732c5f11ce81383ff1ee6_2acf1588-2236-42ed-b340-9645cdb0e4c3.webp?v=1782179864"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cba8cd898bb0d4785706de704bdd58bd69b5114f.webp?v=1762828550","options":["color"],"media":[{"alt":null,"id":26352335519843,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cba8cd898bb0d4785706de704bdd58bd69b5114f.webp?v=1762828550"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cba8cd898bb0d4785706de704bdd58bd69b5114f.webp?v=1762828550","width":2000},{"alt":null,"id":26352336011363,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2bd68e66ebdfe91004b67dea83da2f643bd14ca9.webp?v=1762828551"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2bd68e66ebdfe91004b67dea83da2f643bd14ca9.webp?v=1762828551","width":2000},{"alt":null,"id":26352336437347,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a6522fa4b5725c8dae1c6b515b4aab59397bc0b.webp?v=1762828552"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a6522fa4b5725c8dae1c6b515b4aab59397bc0b.webp?v=1762828552","width":2000},{"alt":null,"id":26352336732259,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/84a69f529d76b81435c082781ed0b4b5e3f49704.webp?v=1762828553"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/84a69f529d76b81435c082781ed0b4b5e3f49704.webp?v=1762828553","width":2000},{"alt":null,"id":26352337027171,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da892d9f2e5bb5678302f39f354fa518f3387ca7.webp?v=1762828553"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da892d9f2e5bb5678302f39f354fa518f3387ca7.webp?v=1762828553","width":2000},{"alt":null,"id":26352337256547,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff33d5a4ada6e3880a3ba70d8198e17689b385bb.webp?v=1762828554"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff33d5a4ada6e3880a3ba70d8198e17689b385bb.webp?v=1762828554","width":2000},{"alt":null,"id":26352337551459,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d04a804e2f2882d60a89f45a88267e21a68b47.webp?v=1762828554"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d04a804e2f2882d60a89f45a88267e21a68b47.webp?v=1762828554","width":2000},{"alt":null,"id":26352337813603,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c5359d3b731729c01c924ec3b7a3fc06c2dce78.webp?v=1762828555"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c5359d3b731729c01c924ec3b7a3fc06c2dce78.webp?v=1762828555","width":2000},{"alt":null,"id":26352338108515,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a8efa4425d54d1a8f72eb029362f54f1424709be.webp?v=1762828556"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a8efa4425d54d1a8f72eb029362f54f1424709be.webp?v=1762828556","width":2000},{"alt":null,"id":26352338337891,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3d330fb611b1278e9a1fad77eb5679e67fd8cc.webp?v=1762828557"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3d330fb611b1278e9a1fad77eb5679e67fd8cc.webp?v=1762828557","width":2000},{"alt":null,"id":26352338567267,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfca9d6dd3c5ed3c4b1732c5f11ce81383ff1ee6.webp?v=1762828557"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfca9d6dd3c5ed3c4b1732c5f11ce81383ff1ee6.webp?v=1762828557","width":2000},{"alt":null,"id":26352338665571,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3118b41ce895f9cfc3fb6c0176e6161cf0475070.webp?v=1762828558"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3118b41ce895f9cfc3fb6c0176e6161cf0475070.webp?v=1762828558","width":2000},{"alt":null,"id":27567516483683,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3d330fb611b1278e9a1fad77eb5679e67fd8cc_fda06680-0eb2-4624-a70b-7225fa9da5ab.webp?v=1782179862"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3d330fb611b1278e9a1fad77eb5679e67fd8cc_fda06680-0eb2-4624-a70b-7225fa9da5ab.webp?v=1782179862","width":2000},{"alt":null,"id":27567516844131,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cba8cd898bb0d4785706de704bdd58bd69b5114f_f8343c33-5573-4850-978c-eade6f1dd535.webp?v=1782179863"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cba8cd898bb0d4785706de704bdd58bd69b5114f_f8343c33-5573-4850-978c-eade6f1dd535.webp?v=1782179863","width":2000},{"alt":null,"id":27567517007971,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfca9d6dd3c5ed3c4b1732c5f11ce81383ff1ee6_2acf1588-2236-42ed-b340-9645cdb0e4c3.webp?v=1782179864"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfca9d6dd3c5ed3c4b1732c5f11ce81383ff1ee6_2acf1588-2236-42ed-b340-9645cdb0e4c3.webp?v=1782179864","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43831432183907,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-EC77","requires_shipping":true,"taxable":true,"featured_image":{"id":36054666444899,"product_id":7921278320739,"position":14,"created_at":"2026-06-23T09:57:41+08:00","updated_at":"2026-06-23T09:57:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cba8cd898bb0d4785706de704bdd58bd69b5114f_f8343c33-5573-4850-978c-eade6f1dd535.webp?v=1782179863","variant_ids":[43831432183907]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Journey - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01262J5-EC77","featured_media":{"alt":null,"id":27567516844131,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cba8cd898bb0d4785706de704bdd58bd69b5114f_f8343c33-5573-4850-978c-eade6f1dd535.webp?v=1782179863"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43831432347747,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-EC77","requires_shipping":true,"taxable":true,"featured_image":{"id":36054666117219,"product_id":7921278320739,"position":13,"created_at":"2026-06-23T09:57:40+08:00","updated_at":"2026-06-23T09:57:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3d330fb611b1278e9a1fad77eb5679e67fd8cc_fda06680-0eb2-4624-a70b-7225fa9da5ab.webp?v=1782179862","variant_ids":[43831432347747]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Journey - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126224-EC77","featured_media":{"alt":null,"id":27567516483683,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3d330fb611b1278e9a1fad77eb5679e67fd8cc_fda06680-0eb2-4624-a70b-7225fa9da5ab.webp?v=1782179862"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43831432446051,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-EC77","requires_shipping":true,"taxable":true,"featured_image":{"id":36054666608739,"product_id":7921278320739,"position":15,"created_at":"2026-06-23T09:57:41+08:00","updated_at":"2026-06-23T09:57:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfca9d6dd3c5ed3c4b1732c5f11ce81383ff1ee6_2acf1588-2236-42ed-b340-9645cdb0e4c3.webp?v=1782179864","variant_ids":[43831432446051]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Journey - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126204-EC77","featured_media":{"alt":null,"id":27567517007971,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfca9d6dd3c5ed3c4b1732c5f11ce81383ff1ee6_2acf1588-2236-42ed-b340-9645cdb0e4c3.webp?v=1782179864"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43831432183907,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-EC77","requires_shipping":true,"taxable":true,"featured_image":{"id":36054666444899,"product_id":7921278320739,"position":14,"created_at":"2026-06-23T09:57:41+08:00","updated_at":"2026-06-23T09:57:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cba8cd898bb0d4785706de704bdd58bd69b5114f_f8343c33-5573-4850-978c-eade6f1dd535.webp?v=1782179863","variant_ids":[43831432183907]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Journey - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01262J5-EC77","featured_media":{"alt":null,"id":27567516844131,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cba8cd898bb0d4785706de704bdd58bd69b5114f_f8343c33-5573-4850-978c-eade6f1dd535.webp?v=1782179863"}},"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: "停產" }