$product = {"id":7838054875235,"title":"iPhone 12 \/ 12 Pro Mod NX BOUNCE Hello 棒小兔","handle":"iphone-12-pro-mod-nx-hk67","description":null,"published_at":"2025-07-16T11:51:00+08:00","created_at":"2025-07-16T09:47:08+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":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":43528633352291,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-HK67","requires_shipping":true,"taxable":true,"featured_image":{"id":34193287118947,"product_id":7838054875235,"position":7,"created_at":"2025-07-16T09:47:16+08:00","updated_at":"2025-07-16T09:47:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cf2092b933eaac54dde36efe532de59c1924f95.webp?v=1752630438","variant_ids":[43528633352291]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX BOUNCE Hello 棒小兔 - 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-HK67","featured_media":{"alt":null,"id":25827375513699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cf2092b933eaac54dde36efe532de59c1924f95.webp?v=1752630438"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528636727395,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-HK67","requires_shipping":true,"taxable":true,"featured_image":{"id":34193284923491,"product_id":7838054875235,"position":1,"created_at":"2025-07-16T09:47:13+08:00","updated_at":"2025-07-16T09:47:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/99e1f313a827b802327d3176e78b660941ca411a.webp?v=1752630435","variant_ids":[43528636727395]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX BOUNCE Hello 棒小兔 - 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-HK67","featured_media":{"alt":null,"id":25827374399587,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/99e1f313a827b802327d3176e78b660941ca411a.webp?v=1752630435"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528636760163,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-HK67","requires_shipping":true,"taxable":true,"featured_image":{"id":34193286987875,"product_id":7838054875235,"position":6,"created_at":"2025-07-16T09:47:16+08:00","updated_at":"2025-07-16T09:47:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e85e566a05c5945d0084c4b50965f8e1c3647f2e.webp?v=1752630438","variant_ids":[43528636760163]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX BOUNCE Hello 棒小兔 - 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-HK67","featured_media":{"alt":null,"id":25827375382627,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e85e566a05c5945d0084c4b50965f8e1c3647f2e.webp?v=1752630438"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528636858467,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-HK67","requires_shipping":true,"taxable":true,"featured_image":{"id":34193285906531,"product_id":7838054875235,"position":4,"created_at":"2025-07-16T09:47:15+08:00","updated_at":"2025-07-16T09:47:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70a4ccffec4679a76fa8402ca86cc6fec354d91b.webp?v=1752630436","variant_ids":[43528636858467]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX BOUNCE Hello 棒小兔 - 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-HK67","featured_media":{"alt":null,"id":25827375054947,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70a4ccffec4679a76fa8402ca86cc6fec354d91b.webp?v=1752630436"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528637022307,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-HK67","requires_shipping":true,"taxable":true,"featured_image":{"id":34193288691811,"product_id":7838054875235,"position":11,"created_at":"2025-07-16T09:47:19+08:00","updated_at":"2025-07-16T09:47:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/84188b9f1c55b8ff1fedb489a7bb85d9768e5ed4.webp?v=1752630440","variant_ids":[43528637022307]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX BOUNCE Hello 棒小兔 - 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-HK67","featured_media":{"alt":null,"id":25827376201827,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/84188b9f1c55b8ff1fedb489a7bb85d9768e5ed4.webp?v=1752630440"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/99e1f313a827b802327d3176e78b660941ca411a.webp?v=1752630435","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/025cf7f625c19783dd26c34d49b4bfa2c4de8a45.webp?v=1752630436","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/480903ca859a81831d6d5bba8888601549f99f88.webp?v=1752630436","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70a4ccffec4679a76fa8402ca86cc6fec354d91b.webp?v=1752630436","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bc57bd4c31f0aece59b424c8e6c19be7cf2e4659.webp?v=1752630437","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e85e566a05c5945d0084c4b50965f8e1c3647f2e.webp?v=1752630438","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cf2092b933eaac54dde36efe532de59c1924f95.webp?v=1752630438","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8ba8699b0186db28385555a080c6ab56154ebe38.webp?v=1752630439","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76cf5f561a8d170e4befd627822f60b84bad9478.webp?v=1752630440","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1bd218d223829cb614dd80fb2b906c37bdc2bdd8.webp?v=1752630440","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/84188b9f1c55b8ff1fedb489a7bb85d9768e5ed4.webp?v=1752630440"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/99e1f313a827b802327d3176e78b660941ca411a.webp?v=1752630435","options":["color"],"media":[{"alt":null,"id":25827374399587,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/99e1f313a827b802327d3176e78b660941ca411a.webp?v=1752630435"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/99e1f313a827b802327d3176e78b660941ca411a.webp?v=1752630435","width":2000},{"alt":null,"id":25827374596195,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/025cf7f625c19783dd26c34d49b4bfa2c4de8a45.webp?v=1752630436"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/025cf7f625c19783dd26c34d49b4bfa2c4de8a45.webp?v=1752630436","width":2000},{"alt":null,"id":25827374858339,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/480903ca859a81831d6d5bba8888601549f99f88.webp?v=1752630436"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/480903ca859a81831d6d5bba8888601549f99f88.webp?v=1752630436","width":2000},{"alt":null,"id":25827375054947,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70a4ccffec4679a76fa8402ca86cc6fec354d91b.webp?v=1752630436"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70a4ccffec4679a76fa8402ca86cc6fec354d91b.webp?v=1752630436","width":2000},{"alt":null,"id":25827375218787,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bc57bd4c31f0aece59b424c8e6c19be7cf2e4659.webp?v=1752630437"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bc57bd4c31f0aece59b424c8e6c19be7cf2e4659.webp?v=1752630437","width":2000},{"alt":null,"id":25827375382627,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e85e566a05c5945d0084c4b50965f8e1c3647f2e.webp?v=1752630438"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e85e566a05c5945d0084c4b50965f8e1c3647f2e.webp?v=1752630438","width":2000},{"alt":null,"id":25827375513699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cf2092b933eaac54dde36efe532de59c1924f95.webp?v=1752630438"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cf2092b933eaac54dde36efe532de59c1924f95.webp?v=1752630438","width":2000},{"alt":null,"id":25827375677539,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8ba8699b0186db28385555a080c6ab56154ebe38.webp?v=1752630439"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8ba8699b0186db28385555a080c6ab56154ebe38.webp?v=1752630439","width":2000},{"alt":null,"id":25827375906915,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76cf5f561a8d170e4befd627822f60b84bad9478.webp?v=1752630440"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76cf5f561a8d170e4befd627822f60b84bad9478.webp?v=1752630440","width":2000},{"alt":null,"id":25827376037987,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1bd218d223829cb614dd80fb2b906c37bdc2bdd8.webp?v=1752630440"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1bd218d223829cb614dd80fb2b906c37bdc2bdd8.webp?v=1752630440","width":2000},{"alt":null,"id":25827376201827,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/84188b9f1c55b8ff1fedb489a7bb85d9768e5ed4.webp?v=1752630440"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/84188b9f1c55b8ff1fedb489a7bb85d9768e5ed4.webp?v=1752630440","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":43528633352291,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-HK67","requires_shipping":true,"taxable":true,"featured_image":{"id":34193287118947,"product_id":7838054875235,"position":7,"created_at":"2025-07-16T09:47:16+08:00","updated_at":"2025-07-16T09:47:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cf2092b933eaac54dde36efe532de59c1924f95.webp?v=1752630438","variant_ids":[43528633352291]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX BOUNCE Hello 棒小兔 - 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-HK67","featured_media":{"alt":null,"id":25827375513699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cf2092b933eaac54dde36efe532de59c1924f95.webp?v=1752630438"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528636727395,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-HK67","requires_shipping":true,"taxable":true,"featured_image":{"id":34193284923491,"product_id":7838054875235,"position":1,"created_at":"2025-07-16T09:47:13+08:00","updated_at":"2025-07-16T09:47:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/99e1f313a827b802327d3176e78b660941ca411a.webp?v=1752630435","variant_ids":[43528636727395]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX BOUNCE Hello 棒小兔 - 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-HK67","featured_media":{"alt":null,"id":25827374399587,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/99e1f313a827b802327d3176e78b660941ca411a.webp?v=1752630435"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528636760163,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-HK67","requires_shipping":true,"taxable":true,"featured_image":{"id":34193286987875,"product_id":7838054875235,"position":6,"created_at":"2025-07-16T09:47:16+08:00","updated_at":"2025-07-16T09:47:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e85e566a05c5945d0084c4b50965f8e1c3647f2e.webp?v=1752630438","variant_ids":[43528636760163]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX BOUNCE Hello 棒小兔 - 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-HK67","featured_media":{"alt":null,"id":25827375382627,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e85e566a05c5945d0084c4b50965f8e1c3647f2e.webp?v=1752630438"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528636858467,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-HK67","requires_shipping":true,"taxable":true,"featured_image":{"id":34193285906531,"product_id":7838054875235,"position":4,"created_at":"2025-07-16T09:47:15+08:00","updated_at":"2025-07-16T09:47:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70a4ccffec4679a76fa8402ca86cc6fec354d91b.webp?v=1752630436","variant_ids":[43528636858467]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX BOUNCE Hello 棒小兔 - 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-HK67","featured_media":{"alt":null,"id":25827375054947,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70a4ccffec4679a76fa8402ca86cc6fec354d91b.webp?v=1752630436"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528637022307,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-HK67","requires_shipping":true,"taxable":true,"featured_image":{"id":34193288691811,"product_id":7838054875235,"position":11,"created_at":"2025-07-16T09:47:19+08:00","updated_at":"2025-07-16T09:47:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/84188b9f1c55b8ff1fedb489a7bb85d9768e5ed4.webp?v=1752630440","variant_ids":[43528637022307]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX BOUNCE Hello 棒小兔 - 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-HK67","featured_media":{"alt":null,"id":25827376201827,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/84188b9f1c55b8ff1fedb489a7bb85d9768e5ed4.webp?v=1752630440"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43528633352291,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-HK67","requires_shipping":true,"taxable":true,"featured_image":{"id":34193287118947,"product_id":7838054875235,"position":7,"created_at":"2025-07-16T09:47:16+08:00","updated_at":"2025-07-16T09:47:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cf2092b933eaac54dde36efe532de59c1924f95.webp?v=1752630438","variant_ids":[43528633352291]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX BOUNCE Hello 棒小兔 - 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-HK67","featured_media":{"alt":null,"id":25827375513699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cf2092b933eaac54dde36efe532de59c1924f95.webp?v=1752630438"}},"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: "停產" }