$product = {"id":7892610908259,"title":"iPhone 14 Pro Max Mod NX (MagSafe 兼容) Aaron Chang Take Ivy","handle":"iphone-14-pro-max-mod-nx-magsafe-printable-aar09","description":null,"published_at":"2025-10-03T09:52:30+08:00","created_at":"2025-10-02T09:47:24+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-aaronchang","device-iPhone 14 Pro Max","merge","reseller-aaronchang"],"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":43756479217763,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01263C1-AAR09","requires_shipping":true,"taxable":true,"featured_image":{"id":34543528542307,"product_id":7892610908259,"position":6,"created_at":"2025-10-02T09:47:34+08:00","updated_at":"2025-10-02T09:47:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2f1aa68d75564952ff8aec38111b43a756bf8601.webp?v=1759369656","variant_ids":[43756479217763]},"available":true,"name":"iPhone 14 Pro Max Mod NX (MagSafe 兼容) Aaron Chang Take Ivy - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01263C1-AAR09","featured_media":{"alt":null,"id":26113283424355,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2f1aa68d75564952ff8aec38111b43a756bf8601.webp?v=1759369656"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756482494563,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01263J5-AAR09","requires_shipping":true,"taxable":true,"featured_image":{"id":34543529984099,"product_id":7892610908259,"position":12,"created_at":"2025-10-02T09:47:51+08:00","updated_at":"2025-10-02T09:47:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfbb2fa32125c421b7bcc5fdddf9aa505ba2f914.webp?v=1759369673","variant_ids":[43756482494563]},"available":true,"name":"iPhone 14 Pro Max Mod NX (MagSafe 兼容) Aaron Chang Take Ivy - 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":"MPB01263J5-AAR09","featured_media":{"alt":null,"id":26113284866147,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfbb2fa32125c421b7bcc5fdddf9aa505ba2f914.webp?v=1759369673"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756482527331,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126304-AAR09","requires_shipping":true,"taxable":true,"featured_image":{"id":34543528312931,"product_id":7892610908259,"position":5,"created_at":"2025-10-02T09:47:34+08:00","updated_at":"2025-10-02T09:47:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29c8b97574f69389008970c7a1b55347e0085c97.webp?v=1759369656","variant_ids":[43756482527331]},"available":true,"name":"iPhone 14 Pro Max Mod NX (MagSafe 兼容) Aaron Chang Take Ivy - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126304-AAR09","featured_media":{"alt":null,"id":26113283260515,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29c8b97574f69389008970c7a1b55347e0085c97.webp?v=1759369656"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756482592867,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0126369-AAR09","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"iPhone 14 Pro Max Mod NX (MagSafe 兼容) Aaron Chang Take Ivy - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126369-AAR09","requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756482756707,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126324-AAR09","requires_shipping":true,"taxable":true,"featured_image":{"id":34543527952483,"product_id":7892610908259,"position":2,"created_at":"2025-10-02T09:47:30+08:00","updated_at":"2025-10-02T09:47:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32422542654b85804642df7aaa46a60d3bcd2bb6.webp?v=1759369652","variant_ids":[43756482756707]},"available":true,"name":"iPhone 14 Pro Max Mod NX (MagSafe 兼容) Aaron Chang Take Ivy - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126324-AAR09","featured_media":{"alt":null,"id":26113282834531,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32422542654b85804642df7aaa46a60d3bcd2bb6.webp?v=1759369652"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/827d399e270e15e36df6e34e48c1968ccae3a108.webp?v=1759369651","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32422542654b85804642df7aaa46a60d3bcd2bb6.webp?v=1759369652","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e39d94a2eb007fa30eb7790e4af1d73ce8b97f5.webp?v=1759369653","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8240516f921842cee52b16fd8eec459db6577b24.webp?v=1759369653","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29c8b97574f69389008970c7a1b55347e0085c97.webp?v=1759369656","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2f1aa68d75564952ff8aec38111b43a756bf8601.webp?v=1759369656","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f352123b514e2453c77311930a236b60090e594e.webp?v=1759369657","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/075893efe4f0d387ab4e42116520db9ecb759a52.webp?v=1759369658","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2671d0f04fc7f219809d75c2b0fd9bf75b37d1b0.webp?v=1759369659","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ec4fe40ba96f13e1b2dbb111d01cf008f764258.webp?v=1759369660","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dd6edf04acd104b9bbd6aa9646b4cf9192c3203.webp?v=1759369671","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfbb2fa32125c421b7bcc5fdddf9aa505ba2f914.webp?v=1759369673"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/827d399e270e15e36df6e34e48c1968ccae3a108.webp?v=1759369651","options":["color"],"media":[{"alt":null,"id":26113282670691,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/827d399e270e15e36df6e34e48c1968ccae3a108.webp?v=1759369651"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/827d399e270e15e36df6e34e48c1968ccae3a108.webp?v=1759369651","width":2000},{"alt":null,"id":26113282834531,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32422542654b85804642df7aaa46a60d3bcd2bb6.webp?v=1759369652"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32422542654b85804642df7aaa46a60d3bcd2bb6.webp?v=1759369652","width":2000},{"alt":null,"id":26113282965603,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e39d94a2eb007fa30eb7790e4af1d73ce8b97f5.webp?v=1759369653"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e39d94a2eb007fa30eb7790e4af1d73ce8b97f5.webp?v=1759369653","width":2000},{"alt":null,"id":26113283096675,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8240516f921842cee52b16fd8eec459db6577b24.webp?v=1759369653"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8240516f921842cee52b16fd8eec459db6577b24.webp?v=1759369653","width":2000},{"alt":null,"id":26113283260515,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29c8b97574f69389008970c7a1b55347e0085c97.webp?v=1759369656"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29c8b97574f69389008970c7a1b55347e0085c97.webp?v=1759369656","width":2000},{"alt":null,"id":26113283424355,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2f1aa68d75564952ff8aec38111b43a756bf8601.webp?v=1759369656"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2f1aa68d75564952ff8aec38111b43a756bf8601.webp?v=1759369656","width":2000},{"alt":null,"id":26113283555427,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f352123b514e2453c77311930a236b60090e594e.webp?v=1759369657"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f352123b514e2453c77311930a236b60090e594e.webp?v=1759369657","width":2000},{"alt":null,"id":26113283686499,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/075893efe4f0d387ab4e42116520db9ecb759a52.webp?v=1759369658"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/075893efe4f0d387ab4e42116520db9ecb759a52.webp?v=1759369658","width":2000},{"alt":null,"id":26113283915875,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2671d0f04fc7f219809d75c2b0fd9bf75b37d1b0.webp?v=1759369659"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2671d0f04fc7f219809d75c2b0fd9bf75b37d1b0.webp?v=1759369659","width":2000},{"alt":null,"id":26113284046947,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ec4fe40ba96f13e1b2dbb111d01cf008f764258.webp?v=1759369660"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ec4fe40ba96f13e1b2dbb111d01cf008f764258.webp?v=1759369660","width":2000},{"alt":null,"id":26113284407395,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dd6edf04acd104b9bbd6aa9646b4cf9192c3203.webp?v=1759369671"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dd6edf04acd104b9bbd6aa9646b4cf9192c3203.webp?v=1759369671","width":2000},{"alt":null,"id":26113284866147,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfbb2fa32125c421b7bcc5fdddf9aa505ba2f914.webp?v=1759369673"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfbb2fa32125c421b7bcc5fdddf9aa505ba2f914.webp?v=1759369673","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43756479217763,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01263C1-AAR09","requires_shipping":true,"taxable":true,"featured_image":{"id":34543528542307,"product_id":7892610908259,"position":6,"created_at":"2025-10-02T09:47:34+08:00","updated_at":"2025-10-02T09:47:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2f1aa68d75564952ff8aec38111b43a756bf8601.webp?v=1759369656","variant_ids":[43756479217763]},"available":true,"name":"iPhone 14 Pro Max Mod NX (MagSafe 兼容) Aaron Chang Take Ivy - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01263C1-AAR09","featured_media":{"alt":null,"id":26113283424355,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2f1aa68d75564952ff8aec38111b43a756bf8601.webp?v=1759369656"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756482494563,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01263J5-AAR09","requires_shipping":true,"taxable":true,"featured_image":{"id":34543529984099,"product_id":7892610908259,"position":12,"created_at":"2025-10-02T09:47:51+08:00","updated_at":"2025-10-02T09:47:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfbb2fa32125c421b7bcc5fdddf9aa505ba2f914.webp?v=1759369673","variant_ids":[43756482494563]},"available":true,"name":"iPhone 14 Pro Max Mod NX (MagSafe 兼容) Aaron Chang Take Ivy - 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":"MPB01263J5-AAR09","featured_media":{"alt":null,"id":26113284866147,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfbb2fa32125c421b7bcc5fdddf9aa505ba2f914.webp?v=1759369673"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756482527331,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126304-AAR09","requires_shipping":true,"taxable":true,"featured_image":{"id":34543528312931,"product_id":7892610908259,"position":5,"created_at":"2025-10-02T09:47:34+08:00","updated_at":"2025-10-02T09:47:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29c8b97574f69389008970c7a1b55347e0085c97.webp?v=1759369656","variant_ids":[43756482527331]},"available":true,"name":"iPhone 14 Pro Max Mod NX (MagSafe 兼容) Aaron Chang Take Ivy - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126304-AAR09","featured_media":{"alt":null,"id":26113283260515,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29c8b97574f69389008970c7a1b55347e0085c97.webp?v=1759369656"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756482592867,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0126369-AAR09","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"iPhone 14 Pro Max Mod NX (MagSafe 兼容) Aaron Chang Take Ivy - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126369-AAR09","requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756482756707,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126324-AAR09","requires_shipping":true,"taxable":true,"featured_image":{"id":34543527952483,"product_id":7892610908259,"position":2,"created_at":"2025-10-02T09:47:30+08:00","updated_at":"2025-10-02T09:47:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32422542654b85804642df7aaa46a60d3bcd2bb6.webp?v=1759369652","variant_ids":[43756482756707]},"available":true,"name":"iPhone 14 Pro Max Mod NX (MagSafe 兼容) Aaron Chang Take Ivy - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126324-AAR09","featured_media":{"alt":null,"id":26113282834531,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32422542654b85804642df7aaa46a60d3bcd2bb6.webp?v=1759369652"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43756479217763,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01263C1-AAR09","requires_shipping":true,"taxable":true,"featured_image":{"id":34543528542307,"product_id":7892610908259,"position":6,"created_at":"2025-10-02T09:47:34+08:00","updated_at":"2025-10-02T09:47:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2f1aa68d75564952ff8aec38111b43a756bf8601.webp?v=1759369656","variant_ids":[43756479217763]},"available":true,"name":"iPhone 14 Pro Max Mod NX (MagSafe 兼容) Aaron Chang Take Ivy - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01263C1-AAR09","featured_media":{"alt":null,"id":26113283424355,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2f1aa68d75564952ff8aec38111b43a756bf8601.webp?v=1759369656"}},"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: "停產" }