$product = {"id":7931682062435,"title":"iPhone 17 Pro Mod NX - 邊框背蓋組合(MagSafe兼容&相機按鈕) 產房 • 廢料棲息地 褪色的我們","handle":"iphone-17-pro-mod-nx-magsafe-with-capture-button-bir06","description":null,"published_at":"2026-01-27T14:11:48+08:00","created_at":"2025-11-28T11:40:19+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-everydayishappybirthday","device-iPhone 17 Pro","merge","reseller-everydayishappybirthday"],"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":43861542404195,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MXB01352J5-BIR06","requires_shipping":true,"taxable":true,"featured_image":{"id":36351895666787,"product_id":7931682062435,"position":15,"created_at":"2026-07-22T21:28:48+08:00","updated_at":"2026-07-22T21:28:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_88a56c7b-b8fc-4ee5-8e93-d95fcb3a8811.webp?v=1784726930","variant_ids":[43861542404195]},"available":true,"name":"iPhone 17 Pro Mod NX - 邊框背蓋組合(MagSafe兼容&相機按鈕) 產房 • 廢料棲息地 褪色的我們 - 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":"MXB01352J5-BIR06","featured_media":{"alt":null,"id":27855700820067,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_88a56c7b-b8fc-4ee5-8e93-d95fcb3a8811.webp?v=1784726930"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43861544337507,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MXB0135269-BIR06","requires_shipping":true,"taxable":true,"featured_image":{"id":36351892422755,"product_id":7931682062435,"position":13,"created_at":"2026-07-22T21:28:46+08:00","updated_at":"2026-07-22T21:28:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b_eb791363-bc8f-4e5d-a526-7aa5711b8f4a.webp?v=1784726928","variant_ids":[43861544337507]},"available":true,"name":"iPhone 17 Pro Mod NX - 邊框背蓋組合(MagSafe兼容&相機按鈕) 產房 • 廢料棲息地 褪色的我們 - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MXB0135269-BIR06","featured_media":{"alt":null,"id":27855697543267,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b_eb791363-bc8f-4e5d-a526-7aa5711b8f4a.webp?v=1784726928"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b.webp?v=1764301226","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad84a9efbc2d05dc81649a8d98ed044c62659ace.webp?v=1764301226","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa.webp?v=1764301226","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b466c96bdd145681195c0bbfa5e6ac9cf8aeae4f.webp?v=1764301227","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b_65c58735-385a-4fc3-99a9-f600ee1bb6f2.webp?v=1784721758","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b466c96bdd145681195c0bbfa5e6ac9cf8aeae4f_75ce89bc-37c8-4c1c-bce0-b758a65f9197.webp?v=1784721759","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_37754712-9bdc-4a16-8ef5-10178ee08da5.webp?v=1784721760","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad84a9efbc2d05dc81649a8d98ed044c62659ace_68846f28-1cdd-4a5a-afbd-991667da7bed.webp?v=1784721760","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b_d911b604-88a3-45a7-9648-3bcc2b9468c9.webp?v=1784725885","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b466c96bdd145681195c0bbfa5e6ac9cf8aeae4f_67cb09df-4701-4fe9-bda1-12d0c58f6b28.webp?v=1784725886","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_ea11ffec-0de0-48cc-aaa5-cf437a31ed59.webp?v=1784725888","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad84a9efbc2d05dc81649a8d98ed044c62659ace_168e1e7b-e2a9-46aa-acee-bb04560b07d9.webp?v=1784725890","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b_eb791363-bc8f-4e5d-a526-7aa5711b8f4a.webp?v=1784726928","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b466c96bdd145681195c0bbfa5e6ac9cf8aeae4f_2bfcfa9f-a77b-4c65-a013-eff5fc721209.webp?v=1784726929","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_88a56c7b-b8fc-4ee5-8e93-d95fcb3a8811.webp?v=1784726930","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad84a9efbc2d05dc81649a8d98ed044c62659ace_0039d3fe-091b-4ca9-a705-ad7e0ce25c24.webp?v=1784726932"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b.webp?v=1764301226","options":["color"],"media":[{"alt":null,"id":26428320481379,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b.webp?v=1764301226"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b.webp?v=1764301226","width":2000},{"alt":null,"id":26428320645219,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad84a9efbc2d05dc81649a8d98ed044c62659ace.webp?v=1764301226"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad84a9efbc2d05dc81649a8d98ed044c62659ace.webp?v=1764301226","width":2000},{"alt":null,"id":26428320776291,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa.webp?v=1764301226"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa.webp?v=1764301226","width":2000},{"alt":null,"id":26428320841827,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b466c96bdd145681195c0bbfa5e6ac9cf8aeae4f.webp?v=1764301227"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b466c96bdd145681195c0bbfa5e6ac9cf8aeae4f.webp?v=1764301227","width":2000},{"alt":null,"id":27853882490979,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b_65c58735-385a-4fc3-99a9-f600ee1bb6f2.webp?v=1784721758"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b_65c58735-385a-4fc3-99a9-f600ee1bb6f2.webp?v=1784721758","width":2000},{"alt":null,"id":27853882687587,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b466c96bdd145681195c0bbfa5e6ac9cf8aeae4f_75ce89bc-37c8-4c1c-bce0-b758a65f9197.webp?v=1784721759"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b466c96bdd145681195c0bbfa5e6ac9cf8aeae4f_75ce89bc-37c8-4c1c-bce0-b758a65f9197.webp?v=1784721759","width":2000},{"alt":null,"id":27853883211875,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_37754712-9bdc-4a16-8ef5-10178ee08da5.webp?v=1784721760"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_37754712-9bdc-4a16-8ef5-10178ee08da5.webp?v=1784721760","width":2000},{"alt":null,"id":27853883539555,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad84a9efbc2d05dc81649a8d98ed044c62659ace_68846f28-1cdd-4a5a-afbd-991667da7bed.webp?v=1784721760"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad84a9efbc2d05dc81649a8d98ed044c62659ace_68846f28-1cdd-4a5a-afbd-991667da7bed.webp?v=1784721760","width":2000},{"alt":null,"id":27855147204707,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b_d911b604-88a3-45a7-9648-3bcc2b9468c9.webp?v=1784725885"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b_d911b604-88a3-45a7-9648-3bcc2b9468c9.webp?v=1784725885","width":2000},{"alt":null,"id":27855148154979,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b466c96bdd145681195c0bbfa5e6ac9cf8aeae4f_67cb09df-4701-4fe9-bda1-12d0c58f6b28.webp?v=1784725886"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b466c96bdd145681195c0bbfa5e6ac9cf8aeae4f_67cb09df-4701-4fe9-bda1-12d0c58f6b28.webp?v=1784725886","width":2000},{"alt":null,"id":27855150940259,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_ea11ffec-0de0-48cc-aaa5-cf437a31ed59.webp?v=1784725888"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_ea11ffec-0de0-48cc-aaa5-cf437a31ed59.webp?v=1784725888","width":2000},{"alt":null,"id":27855152676963,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad84a9efbc2d05dc81649a8d98ed044c62659ace_168e1e7b-e2a9-46aa-acee-bb04560b07d9.webp?v=1784725890"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad84a9efbc2d05dc81649a8d98ed044c62659ace_168e1e7b-e2a9-46aa-acee-bb04560b07d9.webp?v=1784725890","width":2000},{"alt":null,"id":27855697543267,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b_eb791363-bc8f-4e5d-a526-7aa5711b8f4a.webp?v=1784726928"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b_eb791363-bc8f-4e5d-a526-7aa5711b8f4a.webp?v=1784726928","width":2000},{"alt":null,"id":27855698591843,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b466c96bdd145681195c0bbfa5e6ac9cf8aeae4f_2bfcfa9f-a77b-4c65-a013-eff5fc721209.webp?v=1784726929"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b466c96bdd145681195c0bbfa5e6ac9cf8aeae4f_2bfcfa9f-a77b-4c65-a013-eff5fc721209.webp?v=1784726929","width":2000},{"alt":null,"id":27855700820067,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_88a56c7b-b8fc-4ee5-8e93-d95fcb3a8811.webp?v=1784726930"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_88a56c7b-b8fc-4ee5-8e93-d95fcb3a8811.webp?v=1784726930","width":2000},{"alt":null,"id":27855701999715,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad84a9efbc2d05dc81649a8d98ed044c62659ace_0039d3fe-091b-4ca9-a705-ad7e0ce25c24.webp?v=1784726932"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad84a9efbc2d05dc81649a8d98ed044c62659ace_0039d3fe-091b-4ca9-a705-ad7e0ce25c24.webp?v=1784726932","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43861542404195,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MXB01352J5-BIR06","requires_shipping":true,"taxable":true,"featured_image":{"id":36351895666787,"product_id":7931682062435,"position":15,"created_at":"2026-07-22T21:28:48+08:00","updated_at":"2026-07-22T21:28:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_88a56c7b-b8fc-4ee5-8e93-d95fcb3a8811.webp?v=1784726930","variant_ids":[43861542404195]},"available":true,"name":"iPhone 17 Pro Mod NX - 邊框背蓋組合(MagSafe兼容&相機按鈕) 產房 • 廢料棲息地 褪色的我們 - 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":"MXB01352J5-BIR06","featured_media":{"alt":null,"id":27855700820067,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_88a56c7b-b8fc-4ee5-8e93-d95fcb3a8811.webp?v=1784726930"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43861544337507,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MXB0135269-BIR06","requires_shipping":true,"taxable":true,"featured_image":{"id":36351892422755,"product_id":7931682062435,"position":13,"created_at":"2026-07-22T21:28:46+08:00","updated_at":"2026-07-22T21:28:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b_eb791363-bc8f-4e5d-a526-7aa5711b8f4a.webp?v=1784726928","variant_ids":[43861544337507]},"available":true,"name":"iPhone 17 Pro Mod NX - 邊框背蓋組合(MagSafe兼容&相機按鈕) 產房 • 廢料棲息地 褪色的我們 - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MXB0135269-BIR06","featured_media":{"alt":null,"id":27855697543267,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c6d33fd97f8c83d27ba137dba5ac8f5e4a4263b_eb791363-bc8f-4e5d-a526-7aa5711b8f4a.webp?v=1784726928"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43861542404195,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MXB01352J5-BIR06","requires_shipping":true,"taxable":true,"featured_image":{"id":36351895666787,"product_id":7931682062435,"position":15,"created_at":"2026-07-22T21:28:48+08:00","updated_at":"2026-07-22T21:28:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_88a56c7b-b8fc-4ee5-8e93-d95fcb3a8811.webp?v=1784726930","variant_ids":[43861542404195]},"available":true,"name":"iPhone 17 Pro Mod NX - 邊框背蓋組合(MagSafe兼容&相機按鈕) 產房 • 廢料棲息地 褪色的我們 - 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":"MXB01352J5-BIR06","featured_media":{"alt":null,"id":27855700820067,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5f87530b96543f519d3cc29fbaf9428e7dee2fa_88a56c7b-b8fc-4ee5-8e93-d95fcb3a8811.webp?v=1784726930"}},"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: "停產" }