$product = {"id":7893901705315,"title":"iPhone 12 \/ 12 Pro Mod NX Chubbynida 烈焰海之舞","handle":"iphone-12-pro-mod-nx-printable-chu06","description":null,"published_at":"2025-10-09T09:16:30+08:00","created_at":"2025-10-07T10:40:24+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-chubbynida","device-iPhone 12 Pro","merge","reseller-chubbynida"],"price":90000,"price_min":90000,"price_max":90000,"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":43763713310819,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-CHU06","requires_shipping":true,"taxable":true,"featured_image":{"id":34553448890467,"product_id":7893901705315,"position":10,"created_at":"2025-10-07T10:40:32+08:00","updated_at":"2025-10-07T10:40:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b1c168752b4380562e8a2152a547b2349bf04f9.webp?v=1759804834","variant_ids":[43763713310819]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Chubbynida 烈焰海之舞 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-CHU06","featured_media":{"alt":null,"id":26123096522851,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b1c168752b4380562e8a2152a547b2349bf04f9.webp?v=1759804834"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763716161635,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-CHU06","requires_shipping":true,"taxable":true,"featured_image":{"id":34553448562787,"product_id":7893901705315,"position":6,"created_at":"2025-10-07T10:40:30+08:00","updated_at":"2025-10-07T10:40:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/25f5fc0731ab2eab5960e0a516a19439e039104c.webp?v=1759804832","variant_ids":[43763716161635]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Chubbynida 烈焰海之舞 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118524-CHU06","featured_media":{"alt":null,"id":26123096195171,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/25f5fc0731ab2eab5960e0a516a19439e039104c.webp?v=1759804832"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763716227171,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-CHU06","requires_shipping":true,"taxable":true,"featured_image":{"id":34553447874659,"product_id":7893901705315,"position":3,"created_at":"2025-10-07T10:40:26+08:00","updated_at":"2025-10-07T10:40:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41b825dbb847ae85fcc38c564dbab539a0d5ef99.webp?v=1759804828","variant_ids":[43763716227171]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Chubbynida 烈焰海之舞 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118504-CHU06","featured_media":{"alt":null,"id":26123095507043,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41b825dbb847ae85fcc38c564dbab539a0d5ef99.webp?v=1759804828"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763716292707,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-CHU06","requires_shipping":true,"taxable":true,"featured_image":{"id":34553448104035,"product_id":7893901705315,"position":4,"created_at":"2025-10-07T10:40:27+08:00","updated_at":"2025-10-07T10:40:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2147586102c7bfa816cba18e6cbc3d8866763610.webp?v=1759804829","variant_ids":[43763716292707]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Chubbynida 烈焰海之舞 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185J5-CHU06","featured_media":{"alt":null,"id":26123095736419,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2147586102c7bfa816cba18e6cbc3d8866763610.webp?v=1759804829"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763716325475,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-CHU06","requires_shipping":true,"taxable":true,"featured_image":{"id":34553448824931,"product_id":7893901705315,"position":9,"created_at":"2025-10-07T10:40:32+08:00","updated_at":"2025-10-07T10:40:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88c8929dfee342ca7ce032b75faeb75161770848.webp?v=1759804834","variant_ids":[43763716325475]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Chubbynida 烈焰海之舞 - Graphite","public_title":"Graphite","options":["Graphite"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118569-CHU06","featured_media":{"alt":null,"id":26123096457315,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88c8929dfee342ca7ce032b75faeb75161770848.webp?v=1759804834"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e440f3a96a66a6bbf2990487bb04de33f1d5cbf8.webp?v=1759804827","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21f77d48e8eb83cd23f0b065e86ef83421b7b719.webp?v=1759804827","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41b825dbb847ae85fcc38c564dbab539a0d5ef99.webp?v=1759804828","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2147586102c7bfa816cba18e6cbc3d8866763610.webp?v=1759804829","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1b22788933ad26c2f3f23ab2f9e1addae846555.webp?v=1759804831","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/25f5fc0731ab2eab5960e0a516a19439e039104c.webp?v=1759804832","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed3c2ec17534779ff18fb7713d492cf714e6f29b.webp?v=1759804832","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd19d25a99674981c104425b32ea96325c9f7320.webp?v=1759804833","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88c8929dfee342ca7ce032b75faeb75161770848.webp?v=1759804834","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b1c168752b4380562e8a2152a547b2349bf04f9.webp?v=1759804834","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed515d8c6e6cd1fa1cd6dd13513dad27599cb4e9.webp?v=1759804835"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e440f3a96a66a6bbf2990487bb04de33f1d5cbf8.webp?v=1759804827","options":["color"],"media":[{"alt":null,"id":26123094982755,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e440f3a96a66a6bbf2990487bb04de33f1d5cbf8.webp?v=1759804827"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e440f3a96a66a6bbf2990487bb04de33f1d5cbf8.webp?v=1759804827","width":2000},{"alt":null,"id":26123095212131,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21f77d48e8eb83cd23f0b065e86ef83421b7b719.webp?v=1759804827"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21f77d48e8eb83cd23f0b065e86ef83421b7b719.webp?v=1759804827","width":2000},{"alt":null,"id":26123095507043,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41b825dbb847ae85fcc38c564dbab539a0d5ef99.webp?v=1759804828"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41b825dbb847ae85fcc38c564dbab539a0d5ef99.webp?v=1759804828","width":2000},{"alt":null,"id":26123095736419,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2147586102c7bfa816cba18e6cbc3d8866763610.webp?v=1759804829"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2147586102c7bfa816cba18e6cbc3d8866763610.webp?v=1759804829","width":2000},{"alt":null,"id":26123095998563,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1b22788933ad26c2f3f23ab2f9e1addae846555.webp?v=1759804831"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1b22788933ad26c2f3f23ab2f9e1addae846555.webp?v=1759804831","width":2000},{"alt":null,"id":26123096195171,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/25f5fc0731ab2eab5960e0a516a19439e039104c.webp?v=1759804832"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/25f5fc0731ab2eab5960e0a516a19439e039104c.webp?v=1759804832","width":2000},{"alt":null,"id":26123096293475,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed3c2ec17534779ff18fb7713d492cf714e6f29b.webp?v=1759804832"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed3c2ec17534779ff18fb7713d492cf714e6f29b.webp?v=1759804832","width":2000},{"alt":null,"id":26123096359011,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd19d25a99674981c104425b32ea96325c9f7320.webp?v=1759804833"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd19d25a99674981c104425b32ea96325c9f7320.webp?v=1759804833","width":2000},{"alt":null,"id":26123096457315,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88c8929dfee342ca7ce032b75faeb75161770848.webp?v=1759804834"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88c8929dfee342ca7ce032b75faeb75161770848.webp?v=1759804834","width":2000},{"alt":null,"id":26123096522851,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b1c168752b4380562e8a2152a547b2349bf04f9.webp?v=1759804834"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b1c168752b4380562e8a2152a547b2349bf04f9.webp?v=1759804834","width":2000},{"alt":null,"id":26123096621155,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed515d8c6e6cd1fa1cd6dd13513dad27599cb4e9.webp?v=1759804835"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed515d8c6e6cd1fa1cd6dd13513dad27599cb4e9.webp?v=1759804835","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":43763713310819,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-CHU06","requires_shipping":true,"taxable":true,"featured_image":{"id":34553448890467,"product_id":7893901705315,"position":10,"created_at":"2025-10-07T10:40:32+08:00","updated_at":"2025-10-07T10:40:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b1c168752b4380562e8a2152a547b2349bf04f9.webp?v=1759804834","variant_ids":[43763713310819]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Chubbynida 烈焰海之舞 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-CHU06","featured_media":{"alt":null,"id":26123096522851,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b1c168752b4380562e8a2152a547b2349bf04f9.webp?v=1759804834"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763716161635,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-CHU06","requires_shipping":true,"taxable":true,"featured_image":{"id":34553448562787,"product_id":7893901705315,"position":6,"created_at":"2025-10-07T10:40:30+08:00","updated_at":"2025-10-07T10:40:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/25f5fc0731ab2eab5960e0a516a19439e039104c.webp?v=1759804832","variant_ids":[43763716161635]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Chubbynida 烈焰海之舞 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118524-CHU06","featured_media":{"alt":null,"id":26123096195171,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/25f5fc0731ab2eab5960e0a516a19439e039104c.webp?v=1759804832"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763716227171,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-CHU06","requires_shipping":true,"taxable":true,"featured_image":{"id":34553447874659,"product_id":7893901705315,"position":3,"created_at":"2025-10-07T10:40:26+08:00","updated_at":"2025-10-07T10:40:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41b825dbb847ae85fcc38c564dbab539a0d5ef99.webp?v=1759804828","variant_ids":[43763716227171]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Chubbynida 烈焰海之舞 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118504-CHU06","featured_media":{"alt":null,"id":26123095507043,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41b825dbb847ae85fcc38c564dbab539a0d5ef99.webp?v=1759804828"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763716292707,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-CHU06","requires_shipping":true,"taxable":true,"featured_image":{"id":34553448104035,"product_id":7893901705315,"position":4,"created_at":"2025-10-07T10:40:27+08:00","updated_at":"2025-10-07T10:40:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2147586102c7bfa816cba18e6cbc3d8866763610.webp?v=1759804829","variant_ids":[43763716292707]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Chubbynida 烈焰海之舞 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185J5-CHU06","featured_media":{"alt":null,"id":26123095736419,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2147586102c7bfa816cba18e6cbc3d8866763610.webp?v=1759804829"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763716325475,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-CHU06","requires_shipping":true,"taxable":true,"featured_image":{"id":34553448824931,"product_id":7893901705315,"position":9,"created_at":"2025-10-07T10:40:32+08:00","updated_at":"2025-10-07T10:40:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88c8929dfee342ca7ce032b75faeb75161770848.webp?v=1759804834","variant_ids":[43763716325475]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Chubbynida 烈焰海之舞 - Graphite","public_title":"Graphite","options":["Graphite"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118569-CHU06","featured_media":{"alt":null,"id":26123096457315,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88c8929dfee342ca7ce032b75faeb75161770848.webp?v=1759804834"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43763713310819,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-CHU06","requires_shipping":true,"taxable":true,"featured_image":{"id":34553448890467,"product_id":7893901705315,"position":10,"created_at":"2025-10-07T10:40:32+08:00","updated_at":"2025-10-07T10:40:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b1c168752b4380562e8a2152a547b2349bf04f9.webp?v=1759804834","variant_ids":[43763713310819]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Chubbynida 烈焰海之舞 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-CHU06","featured_media":{"alt":null,"id":26123096522851,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b1c168752b4380562e8a2152a547b2349bf04f9.webp?v=1759804834"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}; $device_handle = null var sellingStatus if ($bumper) { $(document).ready(function() { var productImg = $product.images[0] var bumperVariants = $bumper.variants; var bumperColors = new Object(); var currentVariant = ''; var productType = ''; bumperVariants.forEach(variant => { bumperColors[`${variant.title.split(' (')[0].toLowerCase()}`] = variant.featured_image.src; }); if (productType === 'mod-nx-backplate' || productType === 'mod-backplate') { mergeImages( [productImg, bumperColors[currentVariant]], { crossOrigin: 'anonymous' } ).then(mergedImg => { $('.merged-img').attr('src', mergedImg); }); } else { mergeImages( [bumperColors[currentVariant], productImg], { crossOrigin: 'anonymous' } ).then(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: "停產" }