$product = {"id":7838036131939,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE Bounce 塗破","handle":"iphone-12-pro-mod-nx-magsafe-hk62","description":null,"published_at":"2025-07-16T11:57:49+08:00","created_at":"2025-07-16T09:39:49+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-bounce","device-iPhone 12 Pro","merge","reseller-bounce"],"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":43528561066083,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-HK62","requires_shipping":true,"taxable":true,"featured_image":{"id":34193131995235,"product_id":7838036131939,"position":2,"created_at":"2025-07-16T09:39:54+08:00","updated_at":"2025-07-16T09:39:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08ce11122a98c694371d03a4ae23c69c46b2b54c.webp?v=1752629995","variant_ids":[43528561066083]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE Bounce 塗破 - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-HK62","featured_media":{"alt":null,"id":25827289137251,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08ce11122a98c694371d03a4ae23c69c46b2b54c.webp?v=1752629995"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528568045667,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-HK62","requires_shipping":true,"taxable":true,"featured_image":{"id":34193132879971,"product_id":7838036131939,"position":4,"created_at":"2025-07-16T09:39:55+08:00","updated_at":"2025-07-16T09:39:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a46b090b989adb9a3130a3d2e06a3fe0ec7085cf.webp?v=1752629996","variant_ids":[43528568045667]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE Bounce 塗破 - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118569-HK62","featured_media":{"alt":null,"id":25827289563235,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a46b090b989adb9a3130a3d2e06a3fe0ec7085cf.webp?v=1752629996"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528568078435,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-HK62","requires_shipping":true,"taxable":true,"featured_image":{"id":34193133830243,"product_id":7838036131939,"position":5,"created_at":"2025-07-16T09:39:56+08:00","updated_at":"2025-07-16T09:39:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b55b6535def8107c1441a234fdfdad36127c0e04.webp?v=1752629998","variant_ids":[43528568078435]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE Bounce 塗破 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118504-HK62","featured_media":{"alt":null,"id":25827289890915,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b55b6535def8107c1441a234fdfdad36127c0e04.webp?v=1752629998"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528568176739,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-HK62","requires_shipping":true,"taxable":true,"featured_image":{"id":34193149558883,"product_id":7838036131939,"position":10,"created_at":"2025-07-16T09:43:39+08:00","updated_at":"2025-07-16T09:43:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38c929a6c71bea95cafc17b0671d1e27192ab909.webp?v=1752630221","variant_ids":[43528568176739]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE Bounce 塗破 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118524-HK62","featured_media":{"alt":null,"id":25827302473827,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38c929a6c71bea95cafc17b0671d1e27192ab909.webp?v=1752630221"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528568340579,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-HK62","requires_shipping":true,"taxable":true,"featured_image":{"id":34193134223459,"product_id":7838036131939,"position":6,"created_at":"2025-07-16T09:39:56+08:00","updated_at":"2025-07-16T09:39:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9dbf96221b15162efc46f25e481d440f56a009b.webp?v=1752629998","variant_ids":[43528568340579]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE Bounce 塗破 - 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":"MPB01185J5-HK62","featured_media":{"alt":null,"id":25827290185827,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9dbf96221b15162efc46f25e481d440f56a009b.webp?v=1752629998"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b6460914e6eebdc7696813a5d53e28b88e8ca47.webp?v=1752629995","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08ce11122a98c694371d03a4ae23c69c46b2b54c.webp?v=1752629995","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fdfe4139e0e946daf938bc784815bb9b500179b.webp?v=1752629996","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a46b090b989adb9a3130a3d2e06a3fe0ec7085cf.webp?v=1752629996","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b55b6535def8107c1441a234fdfdad36127c0e04.webp?v=1752629998","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9dbf96221b15162efc46f25e481d440f56a009b.webp?v=1752629998","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/272b92ce61361b0d2796a226040e6cba9648dc31.webp?v=1752629999","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40a89840826c39a01da177827ce8d071d01ce404.webp?v=1752629999","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/889f52956405da2c1b975bd3c8a9fe0e981c2991.webp?v=1752630000","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38c929a6c71bea95cafc17b0671d1e27192ab909.webp?v=1752630221","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef3df0b7cc92956dd9176d9532fd2d3089aa5c06.webp?v=1752630221"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b6460914e6eebdc7696813a5d53e28b88e8ca47.webp?v=1752629995","options":["color"],"media":[{"alt":null,"id":25827288940643,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b6460914e6eebdc7696813a5d53e28b88e8ca47.webp?v=1752629995"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b6460914e6eebdc7696813a5d53e28b88e8ca47.webp?v=1752629995","width":2000},{"alt":null,"id":25827289137251,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08ce11122a98c694371d03a4ae23c69c46b2b54c.webp?v=1752629995"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08ce11122a98c694371d03a4ae23c69c46b2b54c.webp?v=1752629995","width":2000},{"alt":null,"id":25827289333859,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fdfe4139e0e946daf938bc784815bb9b500179b.webp?v=1752629996"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fdfe4139e0e946daf938bc784815bb9b500179b.webp?v=1752629996","width":2000},{"alt":null,"id":25827289563235,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a46b090b989adb9a3130a3d2e06a3fe0ec7085cf.webp?v=1752629996"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a46b090b989adb9a3130a3d2e06a3fe0ec7085cf.webp?v=1752629996","width":2000},{"alt":null,"id":25827289890915,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b55b6535def8107c1441a234fdfdad36127c0e04.webp?v=1752629998"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b55b6535def8107c1441a234fdfdad36127c0e04.webp?v=1752629998","width":2000},{"alt":null,"id":25827290185827,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9dbf96221b15162efc46f25e481d440f56a009b.webp?v=1752629998"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9dbf96221b15162efc46f25e481d440f56a009b.webp?v=1752629998","width":2000},{"alt":null,"id":25827290480739,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/272b92ce61361b0d2796a226040e6cba9648dc31.webp?v=1752629999"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/272b92ce61361b0d2796a226040e6cba9648dc31.webp?v=1752629999","width":2000},{"alt":null,"id":25827290644579,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40a89840826c39a01da177827ce8d071d01ce404.webp?v=1752629999"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40a89840826c39a01da177827ce8d071d01ce404.webp?v=1752629999","width":2000},{"alt":null,"id":25827290808419,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/889f52956405da2c1b975bd3c8a9fe0e981c2991.webp?v=1752630000"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/889f52956405da2c1b975bd3c8a9fe0e981c2991.webp?v=1752630000","width":2000},{"alt":null,"id":25827302473827,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38c929a6c71bea95cafc17b0671d1e27192ab909.webp?v=1752630221"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38c929a6c71bea95cafc17b0671d1e27192ab909.webp?v=1752630221","width":2000},{"alt":null,"id":25827302801507,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef3df0b7cc92956dd9176d9532fd2d3089aa5c06.webp?v=1752630221"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef3df0b7cc92956dd9176d9532fd2d3089aa5c06.webp?v=1752630221","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":43528561066083,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-HK62","requires_shipping":true,"taxable":true,"featured_image":{"id":34193131995235,"product_id":7838036131939,"position":2,"created_at":"2025-07-16T09:39:54+08:00","updated_at":"2025-07-16T09:39:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08ce11122a98c694371d03a4ae23c69c46b2b54c.webp?v=1752629995","variant_ids":[43528561066083]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE Bounce 塗破 - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-HK62","featured_media":{"alt":null,"id":25827289137251,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08ce11122a98c694371d03a4ae23c69c46b2b54c.webp?v=1752629995"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528568045667,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-HK62","requires_shipping":true,"taxable":true,"featured_image":{"id":34193132879971,"product_id":7838036131939,"position":4,"created_at":"2025-07-16T09:39:55+08:00","updated_at":"2025-07-16T09:39:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a46b090b989adb9a3130a3d2e06a3fe0ec7085cf.webp?v=1752629996","variant_ids":[43528568045667]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE Bounce 塗破 - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118569-HK62","featured_media":{"alt":null,"id":25827289563235,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a46b090b989adb9a3130a3d2e06a3fe0ec7085cf.webp?v=1752629996"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528568078435,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-HK62","requires_shipping":true,"taxable":true,"featured_image":{"id":34193133830243,"product_id":7838036131939,"position":5,"created_at":"2025-07-16T09:39:56+08:00","updated_at":"2025-07-16T09:39:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b55b6535def8107c1441a234fdfdad36127c0e04.webp?v=1752629998","variant_ids":[43528568078435]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE Bounce 塗破 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118504-HK62","featured_media":{"alt":null,"id":25827289890915,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b55b6535def8107c1441a234fdfdad36127c0e04.webp?v=1752629998"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528568176739,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-HK62","requires_shipping":true,"taxable":true,"featured_image":{"id":34193149558883,"product_id":7838036131939,"position":10,"created_at":"2025-07-16T09:43:39+08:00","updated_at":"2025-07-16T09:43:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38c929a6c71bea95cafc17b0671d1e27192ab909.webp?v=1752630221","variant_ids":[43528568176739]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE Bounce 塗破 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118524-HK62","featured_media":{"alt":null,"id":25827302473827,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38c929a6c71bea95cafc17b0671d1e27192ab909.webp?v=1752630221"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528568340579,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-HK62","requires_shipping":true,"taxable":true,"featured_image":{"id":34193134223459,"product_id":7838036131939,"position":6,"created_at":"2025-07-16T09:39:56+08:00","updated_at":"2025-07-16T09:39:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9dbf96221b15162efc46f25e481d440f56a009b.webp?v=1752629998","variant_ids":[43528568340579]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE Bounce 塗破 - 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":"MPB01185J5-HK62","featured_media":{"alt":null,"id":25827290185827,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9dbf96221b15162efc46f25e481d440f56a009b.webp?v=1752629998"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43528561066083,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-HK62","requires_shipping":true,"taxable":true,"featured_image":{"id":34193131995235,"product_id":7838036131939,"position":2,"created_at":"2025-07-16T09:39:54+08:00","updated_at":"2025-07-16T09:39:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08ce11122a98c694371d03a4ae23c69c46b2b54c.webp?v=1752629995","variant_ids":[43528561066083]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE Bounce 塗破 - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-HK62","featured_media":{"alt":null,"id":25827289137251,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08ce11122a98c694371d03a4ae23c69c46b2b54c.webp?v=1752629995"}},"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: "停產" }