$product = {"id":7888539582563,"title":"iPhone 12 \/ 12 Pro Mod NX 布朗尼 annnbrownie 夏日冰淇淋","handle":"iphone-12-pro-mod-nx-printable-es07","description":null,"published_at":"2025-09-23T09:10:39+08:00","created_at":"2025-09-22T16:05:54+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-annnbrownie","device-iPhone 12 Pro","merge","reseller-annnbrownie"],"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":43743515181155,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-ES07","requires_shipping":true,"taxable":true,"featured_image":{"id":34514833997923,"product_id":7888539582563,"position":5,"created_at":"2025-09-22T16:06:00+08:00","updated_at":"2025-09-22T16:06:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87f487894c057efbb6b2b3f3b32572e2262c898f.webp?v=1758528362","variant_ids":[43743515181155]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 布朗尼 annnbrownie 夏日冰淇淋 - 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-ES07","featured_media":{"alt":null,"id":26085276450915,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87f487894c057efbb6b2b3f3b32572e2262c898f.webp?v=1758528362"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743517507683,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-ES07","requires_shipping":true,"taxable":true,"featured_image":{"id":34514834161763,"product_id":7888539582563,"position":7,"created_at":"2025-09-22T16:06:01+08:00","updated_at":"2025-09-22T16:06:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/029d23a0b3ce76a1ab70d88fb8ac07ab016556ef.webp?v=1758528363","variant_ids":[43743517507683]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 布朗尼 annnbrownie 夏日冰淇淋 - 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-ES07","featured_media":{"alt":null,"id":26085276614755,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/029d23a0b3ce76a1ab70d88fb8ac07ab016556ef.webp?v=1758528363"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743517540451,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-ES07","requires_shipping":true,"taxable":true,"featured_image":{"id":34514833703011,"product_id":7888539582563,"position":2,"created_at":"2025-09-22T16:05:58+08:00","updated_at":"2025-09-22T16:06:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d6bf03e2714e952e30463fbb8cea89c6ea104e48.webp?v=1758528361","variant_ids":[43743517540451]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 布朗尼 annnbrownie 夏日冰淇淋 - 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-ES07","featured_media":{"alt":null,"id":26085276156003,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d6bf03e2714e952e30463fbb8cea89c6ea104e48.webp?v=1758528361"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743517605987,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-ES07","requires_shipping":true,"taxable":true,"featured_image":{"id":34514834456675,"product_id":7888539582563,"position":9,"created_at":"2025-09-22T16:06:02+08:00","updated_at":"2025-09-22T16:06:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/167a443fb23aefb6bcf4e89dbed2df82f2fc2acc.webp?v=1758528364","variant_ids":[43743517605987]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 布朗尼 annnbrownie 夏日冰淇淋 - 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-ES07","featured_media":{"alt":null,"id":26085276909667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/167a443fb23aefb6bcf4e89dbed2df82f2fc2acc.webp?v=1758528364"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743517704291,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-ES07","requires_shipping":true,"taxable":true,"featured_image":{"id":34514834587747,"product_id":7888539582563,"position":10,"created_at":"2025-09-22T16:06:02+08:00","updated_at":"2025-09-22T16:06:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79e57043f02b0c04ce4a71b6aa529116f533a009.webp?v=1758528365","variant_ids":[43743517704291]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 布朗尼 annnbrownie 夏日冰淇淋 - 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-ES07","featured_media":{"alt":null,"id":26085277040739,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79e57043f02b0c04ce4a71b6aa529116f533a009.webp?v=1758528365"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c938b6c3f9dc205710f8dc48b1b0f9732cbcc33.webp?v=1758528360","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d6bf03e2714e952e30463fbb8cea89c6ea104e48.webp?v=1758528361","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/387ed9d2fb8c2e0415ac3b104c7703b4ab64faba.webp?v=1758528361","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa0f769be99742cddcc4ef821c54453dbf248d65.webp?v=1758528362","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87f487894c057efbb6b2b3f3b32572e2262c898f.webp?v=1758528362","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de26a61217bc8e72fca34c6f51f4c3d4d235760c.webp?v=1758528362","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/029d23a0b3ce76a1ab70d88fb8ac07ab016556ef.webp?v=1758528363","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efbe430521b57a0257466bc36b063f6d262ff3.webp?v=1758528363","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/167a443fb23aefb6bcf4e89dbed2df82f2fc2acc.webp?v=1758528364","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79e57043f02b0c04ce4a71b6aa529116f533a009.webp?v=1758528365","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/89d1263c87079c89702d68703012611a6c25f623.webp?v=1758528365"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c938b6c3f9dc205710f8dc48b1b0f9732cbcc33.webp?v=1758528360","options":["color"],"media":[{"alt":null,"id":26085276057699,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c938b6c3f9dc205710f8dc48b1b0f9732cbcc33.webp?v=1758528360"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c938b6c3f9dc205710f8dc48b1b0f9732cbcc33.webp?v=1758528360","width":2000},{"alt":null,"id":26085276156003,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d6bf03e2714e952e30463fbb8cea89c6ea104e48.webp?v=1758528361"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d6bf03e2714e952e30463fbb8cea89c6ea104e48.webp?v=1758528361","width":2000},{"alt":null,"id":26085276188771,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/387ed9d2fb8c2e0415ac3b104c7703b4ab64faba.webp?v=1758528361"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/387ed9d2fb8c2e0415ac3b104c7703b4ab64faba.webp?v=1758528361","width":2000},{"alt":null,"id":26085276352611,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa0f769be99742cddcc4ef821c54453dbf248d65.webp?v=1758528362"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa0f769be99742cddcc4ef821c54453dbf248d65.webp?v=1758528362","width":2000},{"alt":null,"id":26085276450915,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87f487894c057efbb6b2b3f3b32572e2262c898f.webp?v=1758528362"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87f487894c057efbb6b2b3f3b32572e2262c898f.webp?v=1758528362","width":2000},{"alt":null,"id":26085276549219,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de26a61217bc8e72fca34c6f51f4c3d4d235760c.webp?v=1758528362"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de26a61217bc8e72fca34c6f51f4c3d4d235760c.webp?v=1758528362","width":2000},{"alt":null,"id":26085276614755,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/029d23a0b3ce76a1ab70d88fb8ac07ab016556ef.webp?v=1758528363"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/029d23a0b3ce76a1ab70d88fb8ac07ab016556ef.webp?v=1758528363","width":2000},{"alt":null,"id":26085276713059,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efbe430521b57a0257466bc36b063f6d262ff3.webp?v=1758528363"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83efbe430521b57a0257466bc36b063f6d262ff3.webp?v=1758528363","width":2000},{"alt":null,"id":26085276909667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/167a443fb23aefb6bcf4e89dbed2df82f2fc2acc.webp?v=1758528364"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/167a443fb23aefb6bcf4e89dbed2df82f2fc2acc.webp?v=1758528364","width":2000},{"alt":null,"id":26085277040739,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79e57043f02b0c04ce4a71b6aa529116f533a009.webp?v=1758528365"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79e57043f02b0c04ce4a71b6aa529116f533a009.webp?v=1758528365","width":2000},{"alt":null,"id":26085277204579,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/89d1263c87079c89702d68703012611a6c25f623.webp?v=1758528365"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/89d1263c87079c89702d68703012611a6c25f623.webp?v=1758528365","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":43743515181155,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-ES07","requires_shipping":true,"taxable":true,"featured_image":{"id":34514833997923,"product_id":7888539582563,"position":5,"created_at":"2025-09-22T16:06:00+08:00","updated_at":"2025-09-22T16:06:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87f487894c057efbb6b2b3f3b32572e2262c898f.webp?v=1758528362","variant_ids":[43743515181155]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 布朗尼 annnbrownie 夏日冰淇淋 - 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-ES07","featured_media":{"alt":null,"id":26085276450915,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87f487894c057efbb6b2b3f3b32572e2262c898f.webp?v=1758528362"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743517507683,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-ES07","requires_shipping":true,"taxable":true,"featured_image":{"id":34514834161763,"product_id":7888539582563,"position":7,"created_at":"2025-09-22T16:06:01+08:00","updated_at":"2025-09-22T16:06:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/029d23a0b3ce76a1ab70d88fb8ac07ab016556ef.webp?v=1758528363","variant_ids":[43743517507683]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 布朗尼 annnbrownie 夏日冰淇淋 - 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-ES07","featured_media":{"alt":null,"id":26085276614755,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/029d23a0b3ce76a1ab70d88fb8ac07ab016556ef.webp?v=1758528363"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743517540451,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-ES07","requires_shipping":true,"taxable":true,"featured_image":{"id":34514833703011,"product_id":7888539582563,"position":2,"created_at":"2025-09-22T16:05:58+08:00","updated_at":"2025-09-22T16:06:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d6bf03e2714e952e30463fbb8cea89c6ea104e48.webp?v=1758528361","variant_ids":[43743517540451]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 布朗尼 annnbrownie 夏日冰淇淋 - 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-ES07","featured_media":{"alt":null,"id":26085276156003,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d6bf03e2714e952e30463fbb8cea89c6ea104e48.webp?v=1758528361"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743517605987,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-ES07","requires_shipping":true,"taxable":true,"featured_image":{"id":34514834456675,"product_id":7888539582563,"position":9,"created_at":"2025-09-22T16:06:02+08:00","updated_at":"2025-09-22T16:06:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/167a443fb23aefb6bcf4e89dbed2df82f2fc2acc.webp?v=1758528364","variant_ids":[43743517605987]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 布朗尼 annnbrownie 夏日冰淇淋 - 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-ES07","featured_media":{"alt":null,"id":26085276909667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/167a443fb23aefb6bcf4e89dbed2df82f2fc2acc.webp?v=1758528364"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743517704291,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-ES07","requires_shipping":true,"taxable":true,"featured_image":{"id":34514834587747,"product_id":7888539582563,"position":10,"created_at":"2025-09-22T16:06:02+08:00","updated_at":"2025-09-22T16:06:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79e57043f02b0c04ce4a71b6aa529116f533a009.webp?v=1758528365","variant_ids":[43743517704291]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 布朗尼 annnbrownie 夏日冰淇淋 - 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-ES07","featured_media":{"alt":null,"id":26085277040739,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79e57043f02b0c04ce4a71b6aa529116f533a009.webp?v=1758528365"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43743515181155,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-ES07","requires_shipping":true,"taxable":true,"featured_image":{"id":34514833997923,"product_id":7888539582563,"position":5,"created_at":"2025-09-22T16:06:00+08:00","updated_at":"2025-09-22T16:06:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87f487894c057efbb6b2b3f3b32572e2262c898f.webp?v=1758528362","variant_ids":[43743515181155]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 布朗尼 annnbrownie 夏日冰淇淋 - 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-ES07","featured_media":{"alt":null,"id":26085276450915,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87f487894c057efbb6b2b3f3b32572e2262c898f.webp?v=1758528362"}},"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: "停產" }