$product = {"id":7944288698467,"title":"iPhone 12 \/ 12 Pro Mod NX 右手超人 花園","handle":"iphone-12-pro-mod-nx-yoh06","description":null,"published_at":"2025-12-24T10:21:19+08:00","created_at":"2025-12-23T16:49:22+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-yohand","device-iPhone 12 Pro","merge","reseller-yohand"],"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":43907909845091,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-YOH06","requires_shipping":true,"taxable":true,"featured_image":{"id":35002886160483,"product_id":7944288698467,"position":8,"created_at":"2025-12-23T16:50:01+08:00","updated_at":"2025-12-23T16:50:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc9d6b11855f2ca8404419b90d6481c55eaaccee.webp?v=1766479803","variant_ids":[43907909845091]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 右手超人 花園 - 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-YOH06","featured_media":{"alt":null,"id":26563177578595,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc9d6b11855f2ca8404419b90d6481c55eaaccee.webp?v=1766479803"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907921674339,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-YOH06","requires_shipping":true,"taxable":true,"featured_image":{"id":35002884849763,"product_id":7944288698467,"position":4,"created_at":"2025-12-23T16:49:59+08:00","updated_at":"2025-12-23T16:50:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7633d899aa5cca4b57c6d1289636f5da32cffc3a.webp?v=1766479801","variant_ids":[43907921674339]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 右手超人 花園 - 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-YOH06","featured_media":{"alt":null,"id":26563176104035,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7633d899aa5cca4b57c6d1289636f5da32cffc3a.webp?v=1766479801"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907922329699,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-YOH06","requires_shipping":true,"taxable":true,"featured_image":{"id":35002883768419,"product_id":7944288698467,"position":1,"created_at":"2025-12-23T16:49:57+08:00","updated_at":"2025-12-23T16:49:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c0ca1afaeda2b69de210096f97e5552b5546daf.webp?v=1766479799","variant_ids":[43907922329699]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 右手超人 花園 - 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-YOH06","featured_media":{"alt":null,"id":26563175022691,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c0ca1afaeda2b69de210096f97e5552b5546daf.webp?v=1766479799"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907923345507,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-YOH06","requires_shipping":true,"taxable":true,"featured_image":{"id":35002884096099,"product_id":7944288698467,"position":2,"created_at":"2025-12-23T16:49:58+08:00","updated_at":"2025-12-23T16:49:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e10b8397a2077b35b969b918f0e3317fa85517b.webp?v=1766479799","variant_ids":[43907923345507]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 右手超人 花園 - 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-YOH06","featured_media":{"alt":null,"id":26563175317603,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e10b8397a2077b35b969b918f0e3317fa85517b.webp?v=1766479799"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907924721763,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-YOH06","requires_shipping":true,"taxable":true,"featured_image":{"id":35002884489315,"product_id":7944288698467,"position":3,"created_at":"2025-12-23T16:49:58+08:00","updated_at":"2025-12-23T16:50:00+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/390b4c218a0e6b63beade8deb8cb3e10bf638ed3.webp?v=1766479800","variant_ids":[43907924721763]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 右手超人 花園 - 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-YOH06","featured_media":{"alt":null,"id":26563175743587,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/390b4c218a0e6b63beade8deb8cb3e10bf638ed3.webp?v=1766479800"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c0ca1afaeda2b69de210096f97e5552b5546daf.webp?v=1766479799","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e10b8397a2077b35b969b918f0e3317fa85517b.webp?v=1766479799","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/390b4c218a0e6b63beade8deb8cb3e10bf638ed3.webp?v=1766479800","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7633d899aa5cca4b57c6d1289636f5da32cffc3a.webp?v=1766479801","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1924cecfd1632b0ae1eb34957f7073c823483c6f.webp?v=1766479801","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cbce7f4d2bea5706825afce65fe1c77db00c6016.webp?v=1766479802","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cbd718c4e68fc951163964e0d42c8b0b4c4928b4.webp?v=1766479802","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc9d6b11855f2ca8404419b90d6481c55eaaccee.webp?v=1766479803","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3788f636bb1e827e6e5edddfd6ac3571e8d65587.webp?v=1766479804","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/564771eefc268aaefaaded30f99e862e2d3ee75d.webp?v=1766479804","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4ef97e65f8b72a71c0651c830e93babb643674bc.webp?v=1766479804"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c0ca1afaeda2b69de210096f97e5552b5546daf.webp?v=1766479799","options":["color"],"media":[{"alt":null,"id":26563175022691,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c0ca1afaeda2b69de210096f97e5552b5546daf.webp?v=1766479799"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c0ca1afaeda2b69de210096f97e5552b5546daf.webp?v=1766479799","width":2000},{"alt":null,"id":26563175317603,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e10b8397a2077b35b969b918f0e3317fa85517b.webp?v=1766479799"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e10b8397a2077b35b969b918f0e3317fa85517b.webp?v=1766479799","width":2000},{"alt":null,"id":26563175743587,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/390b4c218a0e6b63beade8deb8cb3e10bf638ed3.webp?v=1766479800"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/390b4c218a0e6b63beade8deb8cb3e10bf638ed3.webp?v=1766479800","width":2000},{"alt":null,"id":26563176104035,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7633d899aa5cca4b57c6d1289636f5da32cffc3a.webp?v=1766479801"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7633d899aa5cca4b57c6d1289636f5da32cffc3a.webp?v=1766479801","width":2000},{"alt":null,"id":26563176464483,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1924cecfd1632b0ae1eb34957f7073c823483c6f.webp?v=1766479801"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1924cecfd1632b0ae1eb34957f7073c823483c6f.webp?v=1766479801","width":2000},{"alt":null,"id":26563176824931,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cbce7f4d2bea5706825afce65fe1c77db00c6016.webp?v=1766479802"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cbce7f4d2bea5706825afce65fe1c77db00c6016.webp?v=1766479802","width":2000},{"alt":null,"id":26563177250915,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cbd718c4e68fc951163964e0d42c8b0b4c4928b4.webp?v=1766479802"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cbd718c4e68fc951163964e0d42c8b0b4c4928b4.webp?v=1766479802","width":2000},{"alt":null,"id":26563177578595,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc9d6b11855f2ca8404419b90d6481c55eaaccee.webp?v=1766479803"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc9d6b11855f2ca8404419b90d6481c55eaaccee.webp?v=1766479803","width":2000},{"alt":null,"id":26563177840739,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3788f636bb1e827e6e5edddfd6ac3571e8d65587.webp?v=1766479804"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3788f636bb1e827e6e5edddfd6ac3571e8d65587.webp?v=1766479804","width":2000},{"alt":null,"id":26563178430563,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/564771eefc268aaefaaded30f99e862e2d3ee75d.webp?v=1766479804"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/564771eefc268aaefaaded30f99e862e2d3ee75d.webp?v=1766479804","width":2000},{"alt":null,"id":26563178659939,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4ef97e65f8b72a71c0651c830e93babb643674bc.webp?v=1766479804"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4ef97e65f8b72a71c0651c830e93babb643674bc.webp?v=1766479804","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":43907909845091,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-YOH06","requires_shipping":true,"taxable":true,"featured_image":{"id":35002886160483,"product_id":7944288698467,"position":8,"created_at":"2025-12-23T16:50:01+08:00","updated_at":"2025-12-23T16:50:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc9d6b11855f2ca8404419b90d6481c55eaaccee.webp?v=1766479803","variant_ids":[43907909845091]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 右手超人 花園 - 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-YOH06","featured_media":{"alt":null,"id":26563177578595,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc9d6b11855f2ca8404419b90d6481c55eaaccee.webp?v=1766479803"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907921674339,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-YOH06","requires_shipping":true,"taxable":true,"featured_image":{"id":35002884849763,"product_id":7944288698467,"position":4,"created_at":"2025-12-23T16:49:59+08:00","updated_at":"2025-12-23T16:50:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7633d899aa5cca4b57c6d1289636f5da32cffc3a.webp?v=1766479801","variant_ids":[43907921674339]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 右手超人 花園 - 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-YOH06","featured_media":{"alt":null,"id":26563176104035,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7633d899aa5cca4b57c6d1289636f5da32cffc3a.webp?v=1766479801"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907922329699,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-YOH06","requires_shipping":true,"taxable":true,"featured_image":{"id":35002883768419,"product_id":7944288698467,"position":1,"created_at":"2025-12-23T16:49:57+08:00","updated_at":"2025-12-23T16:49:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c0ca1afaeda2b69de210096f97e5552b5546daf.webp?v=1766479799","variant_ids":[43907922329699]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 右手超人 花園 - 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-YOH06","featured_media":{"alt":null,"id":26563175022691,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c0ca1afaeda2b69de210096f97e5552b5546daf.webp?v=1766479799"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907923345507,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-YOH06","requires_shipping":true,"taxable":true,"featured_image":{"id":35002884096099,"product_id":7944288698467,"position":2,"created_at":"2025-12-23T16:49:58+08:00","updated_at":"2025-12-23T16:49:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e10b8397a2077b35b969b918f0e3317fa85517b.webp?v=1766479799","variant_ids":[43907923345507]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 右手超人 花園 - 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-YOH06","featured_media":{"alt":null,"id":26563175317603,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e10b8397a2077b35b969b918f0e3317fa85517b.webp?v=1766479799"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907924721763,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-YOH06","requires_shipping":true,"taxable":true,"featured_image":{"id":35002884489315,"product_id":7944288698467,"position":3,"created_at":"2025-12-23T16:49:58+08:00","updated_at":"2025-12-23T16:50:00+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/390b4c218a0e6b63beade8deb8cb3e10bf638ed3.webp?v=1766479800","variant_ids":[43907924721763]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 右手超人 花園 - 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-YOH06","featured_media":{"alt":null,"id":26563175743587,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/390b4c218a0e6b63beade8deb8cb3e10bf638ed3.webp?v=1766479800"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43907909845091,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-YOH06","requires_shipping":true,"taxable":true,"featured_image":{"id":35002886160483,"product_id":7944288698467,"position":8,"created_at":"2025-12-23T16:50:01+08:00","updated_at":"2025-12-23T16:50:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc9d6b11855f2ca8404419b90d6481c55eaaccee.webp?v=1766479803","variant_ids":[43907909845091]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 右手超人 花園 - 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-YOH06","featured_media":{"alt":null,"id":26563177578595,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc9d6b11855f2ca8404419b90d6481c55eaaccee.webp?v=1766479803"}},"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: "停產" }