$product = {"id":7911226179683,"title":"iPhone 12 \/ 12 Pro Mod NX PosterLad 正常很無聊","handle":"iphone-12-pro-mod-nx-printable-pos04","description":null,"published_at":"2025-11-05T10:42:49+08:00","created_at":"2025-11-04T10:40:32+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-posterlad","device-iPhone 12 Pro","merge","reseller-posterlad"],"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":43812040343651,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-POS04","requires_shipping":true,"taxable":true,"featured_image":{"id":34729167028323,"product_id":7911226179683,"position":7,"created_at":"2025-11-04T10:40:41+08:00","updated_at":"2025-11-04T10:40:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e2fac2f004de4819a15621bced8d283c760be2b.webp?v=1762224043","variant_ids":[43812040343651]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX PosterLad 正常很無聊 - 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-POS04","featured_media":{"alt":null,"id":26297035456611,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e2fac2f004de4819a15621bced8d283c760be2b.webp?v=1762224043"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812043849827,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-POS04","requires_shipping":true,"taxable":true,"featured_image":{"id":34729166766179,"product_id":7911226179683,"position":6,"created_at":"2025-11-04T10:40:40+08:00","updated_at":"2025-11-04T10:40:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c00f04d3ea573293a12ecf0e9ae819cfe63824.webp?v=1762224042","variant_ids":[43812043849827]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX PosterLad 正常很無聊 - 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-POS04","featured_media":{"alt":null,"id":26297035194467,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c00f04d3ea573293a12ecf0e9ae819cfe63824.webp?v=1762224042"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812043882595,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-POS04","requires_shipping":true,"taxable":true,"featured_image":{"id":34729165783139,"product_id":7911226179683,"position":1,"created_at":"2025-11-04T10:40:37+08:00","updated_at":"2025-11-04T10:40:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7997b313e6d6e2dd96a1ddaca991cc42dd2e7fe2.webp?v=1762224039","variant_ids":[43812043882595]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX PosterLad 正常很無聊 - 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-POS04","featured_media":{"alt":null,"id":26297034178659,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7997b313e6d6e2dd96a1ddaca991cc42dd2e7fe2.webp?v=1762224039"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812043915363,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-POS04","requires_shipping":true,"taxable":true,"featured_image":{"id":34729167585379,"product_id":7911226179683,"position":9,"created_at":"2025-11-04T10:40:43+08:00","updated_at":"2025-11-04T10:40:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9ff690f0f10c7ab47ae35d518ba9f242680e801.webp?v=1762224045","variant_ids":[43812043915363]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX PosterLad 正常很無聊 - 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-POS04","featured_media":{"alt":null,"id":26297036013667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9ff690f0f10c7ab47ae35d518ba9f242680e801.webp?v=1762224045"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812044111971,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-POS04","requires_shipping":true,"taxable":true,"featured_image":{"id":34729166143587,"product_id":7911226179683,"position":3,"created_at":"2025-11-04T10:40:38+08:00","updated_at":"2025-11-04T10:40:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f2894e0af4b938f5a50c8a6f827312c78529e383.webp?v=1762224040","variant_ids":[43812044111971]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX PosterLad 正常很無聊 - 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-POS04","featured_media":{"alt":null,"id":26297034571875,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f2894e0af4b938f5a50c8a6f827312c78529e383.webp?v=1762224040"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7997b313e6d6e2dd96a1ddaca991cc42dd2e7fe2.webp?v=1762224039","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36d3d2d0c9b0a420d7ba287bd6cc300d9165b0a4.webp?v=1762224039","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f2894e0af4b938f5a50c8a6f827312c78529e383.webp?v=1762224040","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e98e32302488b4fdc654aa0bee2896dd978928b5.webp?v=1762224041","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eb382a4dda6ee81c769837ec574c102d99f01df.webp?v=1762224041","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c00f04d3ea573293a12ecf0e9ae819cfe63824.webp?v=1762224042","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e2fac2f004de4819a15621bced8d283c760be2b.webp?v=1762224043","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c40b897c07419be1890b42a0aa961ab7f7d75dca.webp?v=1762224044","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9ff690f0f10c7ab47ae35d518ba9f242680e801.webp?v=1762224045","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/515f84bc06a81a1e716b7d65c496bb9a4ac80e2b.webp?v=1762224045","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f647c6372920f727626c1c60efc1872ebab6b01c.webp?v=1762224046"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7997b313e6d6e2dd96a1ddaca991cc42dd2e7fe2.webp?v=1762224039","options":["color"],"media":[{"alt":null,"id":26297034178659,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7997b313e6d6e2dd96a1ddaca991cc42dd2e7fe2.webp?v=1762224039"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7997b313e6d6e2dd96a1ddaca991cc42dd2e7fe2.webp?v=1762224039","width":2000},{"alt":null,"id":26297034375267,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36d3d2d0c9b0a420d7ba287bd6cc300d9165b0a4.webp?v=1762224039"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36d3d2d0c9b0a420d7ba287bd6cc300d9165b0a4.webp?v=1762224039","width":2000},{"alt":null,"id":26297034571875,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f2894e0af4b938f5a50c8a6f827312c78529e383.webp?v=1762224040"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f2894e0af4b938f5a50c8a6f827312c78529e383.webp?v=1762224040","width":2000},{"alt":null,"id":26297034670179,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e98e32302488b4fdc654aa0bee2896dd978928b5.webp?v=1762224041"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e98e32302488b4fdc654aa0bee2896dd978928b5.webp?v=1762224041","width":2000},{"alt":null,"id":26297034932323,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eb382a4dda6ee81c769837ec574c102d99f01df.webp?v=1762224041"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eb382a4dda6ee81c769837ec574c102d99f01df.webp?v=1762224041","width":2000},{"alt":null,"id":26297035194467,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c00f04d3ea573293a12ecf0e9ae819cfe63824.webp?v=1762224042"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c00f04d3ea573293a12ecf0e9ae819cfe63824.webp?v=1762224042","width":2000},{"alt":null,"id":26297035456611,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e2fac2f004de4819a15621bced8d283c760be2b.webp?v=1762224043"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e2fac2f004de4819a15621bced8d283c760be2b.webp?v=1762224043","width":2000},{"alt":null,"id":26297035685987,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c40b897c07419be1890b42a0aa961ab7f7d75dca.webp?v=1762224044"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c40b897c07419be1890b42a0aa961ab7f7d75dca.webp?v=1762224044","width":2000},{"alt":null,"id":26297036013667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9ff690f0f10c7ab47ae35d518ba9f242680e801.webp?v=1762224045"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9ff690f0f10c7ab47ae35d518ba9f242680e801.webp?v=1762224045","width":2000},{"alt":null,"id":26297036341347,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/515f84bc06a81a1e716b7d65c496bb9a4ac80e2b.webp?v=1762224045"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/515f84bc06a81a1e716b7d65c496bb9a4ac80e2b.webp?v=1762224045","width":2000},{"alt":null,"id":26297036570723,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f647c6372920f727626c1c60efc1872ebab6b01c.webp?v=1762224046"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f647c6372920f727626c1c60efc1872ebab6b01c.webp?v=1762224046","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":43812040343651,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-POS04","requires_shipping":true,"taxable":true,"featured_image":{"id":34729167028323,"product_id":7911226179683,"position":7,"created_at":"2025-11-04T10:40:41+08:00","updated_at":"2025-11-04T10:40:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e2fac2f004de4819a15621bced8d283c760be2b.webp?v=1762224043","variant_ids":[43812040343651]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX PosterLad 正常很無聊 - 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-POS04","featured_media":{"alt":null,"id":26297035456611,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e2fac2f004de4819a15621bced8d283c760be2b.webp?v=1762224043"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812043849827,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-POS04","requires_shipping":true,"taxable":true,"featured_image":{"id":34729166766179,"product_id":7911226179683,"position":6,"created_at":"2025-11-04T10:40:40+08:00","updated_at":"2025-11-04T10:40:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c00f04d3ea573293a12ecf0e9ae819cfe63824.webp?v=1762224042","variant_ids":[43812043849827]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX PosterLad 正常很無聊 - 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-POS04","featured_media":{"alt":null,"id":26297035194467,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c00f04d3ea573293a12ecf0e9ae819cfe63824.webp?v=1762224042"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812043882595,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-POS04","requires_shipping":true,"taxable":true,"featured_image":{"id":34729165783139,"product_id":7911226179683,"position":1,"created_at":"2025-11-04T10:40:37+08:00","updated_at":"2025-11-04T10:40:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7997b313e6d6e2dd96a1ddaca991cc42dd2e7fe2.webp?v=1762224039","variant_ids":[43812043882595]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX PosterLad 正常很無聊 - 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-POS04","featured_media":{"alt":null,"id":26297034178659,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7997b313e6d6e2dd96a1ddaca991cc42dd2e7fe2.webp?v=1762224039"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812043915363,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-POS04","requires_shipping":true,"taxable":true,"featured_image":{"id":34729167585379,"product_id":7911226179683,"position":9,"created_at":"2025-11-04T10:40:43+08:00","updated_at":"2025-11-04T10:40:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9ff690f0f10c7ab47ae35d518ba9f242680e801.webp?v=1762224045","variant_ids":[43812043915363]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX PosterLad 正常很無聊 - 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-POS04","featured_media":{"alt":null,"id":26297036013667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9ff690f0f10c7ab47ae35d518ba9f242680e801.webp?v=1762224045"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812044111971,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-POS04","requires_shipping":true,"taxable":true,"featured_image":{"id":34729166143587,"product_id":7911226179683,"position":3,"created_at":"2025-11-04T10:40:38+08:00","updated_at":"2025-11-04T10:40:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f2894e0af4b938f5a50c8a6f827312c78529e383.webp?v=1762224040","variant_ids":[43812044111971]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX PosterLad 正常很無聊 - 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-POS04","featured_media":{"alt":null,"id":26297034571875,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f2894e0af4b938f5a50c8a6f827312c78529e383.webp?v=1762224040"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43812040343651,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-POS04","requires_shipping":true,"taxable":true,"featured_image":{"id":34729167028323,"product_id":7911226179683,"position":7,"created_at":"2025-11-04T10:40:41+08:00","updated_at":"2025-11-04T10:40:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e2fac2f004de4819a15621bced8d283c760be2b.webp?v=1762224043","variant_ids":[43812040343651]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX PosterLad 正常很無聊 - 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-POS04","featured_media":{"alt":null,"id":26297035456611,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e2fac2f004de4819a15621bced8d283c760be2b.webp?v=1762224043"}},"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: "停產" }