$product = {"id":7888624287843,"title":"iPhone 12 \/ 12 Pro Mod NX 餃貓FAMILY 餃貓電玩","handle":"iphone-12-pro-mod-nx-printable-dm01","description":null,"published_at":"2025-09-23T09:02:03+08:00","created_at":"2025-09-22T16:52:47+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-dumplingcat","device-iPhone 12 Pro","merge","reseller-dumplingcat"],"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":43743808192611,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-DM01","requires_shipping":true,"taxable":true,"featured_image":{"id":34515784892515,"product_id":7888624287843,"position":9,"created_at":"2025-09-22T16:52:56+08:00","updated_at":"2025-09-22T16:52:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1cfd8e44ae9026179486d46607e0f820a9eee09.webp?v=1758531177","variant_ids":[43743808192611]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 餃貓FAMILY 餃貓電玩 - 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-DM01","featured_media":{"alt":null,"id":26086222463075,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1cfd8e44ae9026179486d46607e0f820a9eee09.webp?v=1758531177"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743810027619,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-DM01","requires_shipping":true,"taxable":true,"featured_image":{"id":34515783483491,"product_id":7888624287843,"position":1,"created_at":"2025-09-22T16:52:52+08:00","updated_at":"2025-09-22T16:52:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd4cdcf38d7059f6b8d7a735c59e128126d95290.webp?v=1758531174","variant_ids":[43743810027619]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 餃貓FAMILY 餃貓電玩 - 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-DM01","featured_media":{"alt":null,"id":26086221054051,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd4cdcf38d7059f6b8d7a735c59e128126d95290.webp?v=1758531174"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743810060387,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-DM01","requires_shipping":true,"taxable":true,"featured_image":{"id":34515784302691,"product_id":7888624287843,"position":5,"created_at":"2025-09-22T16:52:54+08:00","updated_at":"2025-09-22T16:52:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c52168c4951a0394849b175f6aade4b307e7a3e.webp?v=1758531176","variant_ids":[43743810060387]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 餃貓FAMILY 餃貓電玩 - 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-DM01","featured_media":{"alt":null,"id":26086221873251,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c52168c4951a0394849b175f6aade4b307e7a3e.webp?v=1758531176"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743810125923,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-DM01","requires_shipping":true,"taxable":true,"featured_image":{"id":34515784433763,"product_id":7888624287843,"position":6,"created_at":"2025-09-22T16:52:54+08:00","updated_at":"2025-09-22T16:52:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c4364b4a651b9a2123b4b2ef3cb55e220c720e2.webp?v=1758531176","variant_ids":[43743810125923]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 餃貓FAMILY 餃貓電玩 - 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-DM01","featured_media":{"alt":null,"id":26086222004323,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c4364b4a651b9a2123b4b2ef3cb55e220c720e2.webp?v=1758531176"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743810158691,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-DM01","requires_shipping":true,"taxable":true,"featured_image":{"id":34515783975011,"product_id":7888624287843,"position":3,"created_at":"2025-09-22T16:52:53+08:00","updated_at":"2025-09-22T16:52:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0f34789928f35f95f927a2b8560589dbe1c367eb.webp?v=1758531175","variant_ids":[43743810158691]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 餃貓FAMILY 餃貓電玩 - 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-DM01","featured_media":{"alt":null,"id":26086221545571,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0f34789928f35f95f927a2b8560589dbe1c367eb.webp?v=1758531175"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd4cdcf38d7059f6b8d7a735c59e128126d95290.webp?v=1758531174","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a077a219322e22916d38eda87bae54fc64a3f63.webp?v=1758531174","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0f34789928f35f95f927a2b8560589dbe1c367eb.webp?v=1758531175","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70bbc1c685a3cd58ab51cfe4d70635f05dfc1819.webp?v=1758531175","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c52168c4951a0394849b175f6aade4b307e7a3e.webp?v=1758531176","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c4364b4a651b9a2123b4b2ef3cb55e220c720e2.webp?v=1758531176","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/af8d104072eea8cade374d1894463c852a7cd2f0.webp?v=1758531177","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2eb98fcf0c9c0fef1129bbd1a8b5e307c2378041.webp?v=1758531177","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1cfd8e44ae9026179486d46607e0f820a9eee09.webp?v=1758531177","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e16bfa8baa96e937460d764b2a06c45fe6ebf272.webp?v=1758531178","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea8136b83f3048f733ac156d0adfb0d306feada7.webp?v=1758531179"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd4cdcf38d7059f6b8d7a735c59e128126d95290.webp?v=1758531174","options":["color"],"media":[{"alt":null,"id":26086221054051,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd4cdcf38d7059f6b8d7a735c59e128126d95290.webp?v=1758531174"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd4cdcf38d7059f6b8d7a735c59e128126d95290.webp?v=1758531174","width":2000},{"alt":null,"id":26086221316195,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a077a219322e22916d38eda87bae54fc64a3f63.webp?v=1758531174"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a077a219322e22916d38eda87bae54fc64a3f63.webp?v=1758531174","width":2000},{"alt":null,"id":26086221545571,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0f34789928f35f95f927a2b8560589dbe1c367eb.webp?v=1758531175"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0f34789928f35f95f927a2b8560589dbe1c367eb.webp?v=1758531175","width":2000},{"alt":null,"id":26086221742179,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70bbc1c685a3cd58ab51cfe4d70635f05dfc1819.webp?v=1758531175"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70bbc1c685a3cd58ab51cfe4d70635f05dfc1819.webp?v=1758531175","width":2000},{"alt":null,"id":26086221873251,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c52168c4951a0394849b175f6aade4b307e7a3e.webp?v=1758531176"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c52168c4951a0394849b175f6aade4b307e7a3e.webp?v=1758531176","width":2000},{"alt":null,"id":26086222004323,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c4364b4a651b9a2123b4b2ef3cb55e220c720e2.webp?v=1758531176"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c4364b4a651b9a2123b4b2ef3cb55e220c720e2.webp?v=1758531176","width":2000},{"alt":null,"id":26086222168163,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/af8d104072eea8cade374d1894463c852a7cd2f0.webp?v=1758531177"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/af8d104072eea8cade374d1894463c852a7cd2f0.webp?v=1758531177","width":2000},{"alt":null,"id":26086222299235,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2eb98fcf0c9c0fef1129bbd1a8b5e307c2378041.webp?v=1758531177"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2eb98fcf0c9c0fef1129bbd1a8b5e307c2378041.webp?v=1758531177","width":2000},{"alt":null,"id":26086222463075,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1cfd8e44ae9026179486d46607e0f820a9eee09.webp?v=1758531177"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1cfd8e44ae9026179486d46607e0f820a9eee09.webp?v=1758531177","width":2000},{"alt":null,"id":26086222626915,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e16bfa8baa96e937460d764b2a06c45fe6ebf272.webp?v=1758531178"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e16bfa8baa96e937460d764b2a06c45fe6ebf272.webp?v=1758531178","width":2000},{"alt":null,"id":26086222790755,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea8136b83f3048f733ac156d0adfb0d306feada7.webp?v=1758531179"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea8136b83f3048f733ac156d0adfb0d306feada7.webp?v=1758531179","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":43743808192611,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-DM01","requires_shipping":true,"taxable":true,"featured_image":{"id":34515784892515,"product_id":7888624287843,"position":9,"created_at":"2025-09-22T16:52:56+08:00","updated_at":"2025-09-22T16:52:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1cfd8e44ae9026179486d46607e0f820a9eee09.webp?v=1758531177","variant_ids":[43743808192611]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 餃貓FAMILY 餃貓電玩 - 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-DM01","featured_media":{"alt":null,"id":26086222463075,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1cfd8e44ae9026179486d46607e0f820a9eee09.webp?v=1758531177"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743810027619,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-DM01","requires_shipping":true,"taxable":true,"featured_image":{"id":34515783483491,"product_id":7888624287843,"position":1,"created_at":"2025-09-22T16:52:52+08:00","updated_at":"2025-09-22T16:52:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd4cdcf38d7059f6b8d7a735c59e128126d95290.webp?v=1758531174","variant_ids":[43743810027619]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 餃貓FAMILY 餃貓電玩 - 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-DM01","featured_media":{"alt":null,"id":26086221054051,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd4cdcf38d7059f6b8d7a735c59e128126d95290.webp?v=1758531174"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743810060387,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-DM01","requires_shipping":true,"taxable":true,"featured_image":{"id":34515784302691,"product_id":7888624287843,"position":5,"created_at":"2025-09-22T16:52:54+08:00","updated_at":"2025-09-22T16:52:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c52168c4951a0394849b175f6aade4b307e7a3e.webp?v=1758531176","variant_ids":[43743810060387]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 餃貓FAMILY 餃貓電玩 - 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-DM01","featured_media":{"alt":null,"id":26086221873251,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c52168c4951a0394849b175f6aade4b307e7a3e.webp?v=1758531176"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743810125923,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-DM01","requires_shipping":true,"taxable":true,"featured_image":{"id":34515784433763,"product_id":7888624287843,"position":6,"created_at":"2025-09-22T16:52:54+08:00","updated_at":"2025-09-22T16:52:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c4364b4a651b9a2123b4b2ef3cb55e220c720e2.webp?v=1758531176","variant_ids":[43743810125923]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 餃貓FAMILY 餃貓電玩 - 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-DM01","featured_media":{"alt":null,"id":26086222004323,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c4364b4a651b9a2123b4b2ef3cb55e220c720e2.webp?v=1758531176"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743810158691,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-DM01","requires_shipping":true,"taxable":true,"featured_image":{"id":34515783975011,"product_id":7888624287843,"position":3,"created_at":"2025-09-22T16:52:53+08:00","updated_at":"2025-09-22T16:52:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0f34789928f35f95f927a2b8560589dbe1c367eb.webp?v=1758531175","variant_ids":[43743810158691]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 餃貓FAMILY 餃貓電玩 - 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-DM01","featured_media":{"alt":null,"id":26086221545571,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0f34789928f35f95f927a2b8560589dbe1c367eb.webp?v=1758531175"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43743808192611,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-DM01","requires_shipping":true,"taxable":true,"featured_image":{"id":34515784892515,"product_id":7888624287843,"position":9,"created_at":"2025-09-22T16:52:56+08:00","updated_at":"2025-09-22T16:52:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1cfd8e44ae9026179486d46607e0f820a9eee09.webp?v=1758531177","variant_ids":[43743808192611]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 餃貓FAMILY 餃貓電玩 - 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-DM01","featured_media":{"alt":null,"id":26086222463075,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1cfd8e44ae9026179486d46607e0f820a9eee09.webp?v=1758531177"}},"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: "停產" }