$product = {"id":7911253835875,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) PosterLad 水與沙","handle":"iphone-12-pro-mod-nx-magsafe-printable-pos03","description":null,"published_at":"2025-11-05T10:38:48+08:00","created_at":"2025-11-04T10:45:20+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":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":43812117217379,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-POS03","requires_shipping":true,"taxable":true,"featured_image":{"id":34729239674979,"product_id":7911253835875,"position":10,"created_at":"2025-11-04T10:45:29+08:00","updated_at":"2025-11-04T10:45:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea77c4ceb5ede1f2d4b62aa45c5b1ed0cd64507d.webp?v=1762224331","variant_ids":[43812117217379]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) PosterLad 水與沙 - 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-POS03","featured_media":{"alt":null,"id":26297107841123,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea77c4ceb5ede1f2d4b62aa45c5b1ed0cd64507d.webp?v=1762224331"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812120494179,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-POS03","requires_shipping":true,"taxable":true,"featured_image":{"id":34729238134883,"product_id":7911253835875,"position":2,"created_at":"2025-11-04T10:45:22+08:00","updated_at":"2025-11-04T10:45:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e523233fccad48c8de8a15f52574189ff979b8b.webp?v=1762224324","variant_ids":[43812120494179]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) PosterLad 水與沙 - 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-POS03","featured_media":{"alt":null,"id":26297106301027,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e523233fccad48c8de8a15f52574189ff979b8b.webp?v=1762224324"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812120526947,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-POS03","requires_shipping":true,"taxable":true,"featured_image":{"id":34729238364259,"product_id":7911253835875,"position":4,"created_at":"2025-11-04T10:45:24+08:00","updated_at":"2025-11-04T10:45:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/177ecdf6048fc46160ed5e30ec7bfc91c7ca1090.webp?v=1762224325","variant_ids":[43812120526947]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) PosterLad 水與沙 - 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-POS03","featured_media":{"alt":null,"id":26297106530403,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/177ecdf6048fc46160ed5e30ec7bfc91c7ca1090.webp?v=1762224325"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812120559715,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-POS03","requires_shipping":true,"taxable":true,"featured_image":{"id":34729239085155,"product_id":7911253835875,"position":8,"created_at":"2025-11-04T10:45:27+08:00","updated_at":"2025-11-04T10:45:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5148390264c39d9468b83e091d879da091a70418.webp?v=1762224329","variant_ids":[43812120559715]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) PosterLad 水與沙 - 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-POS03","featured_media":{"alt":null,"id":26297107251299,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5148390264c39d9468b83e091d879da091a70418.webp?v=1762224329"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812120756323,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-POS03","requires_shipping":true,"taxable":true,"featured_image":{"id":34729239412835,"product_id":7911253835875,"position":9,"created_at":"2025-11-04T10:45:28+08:00","updated_at":"2025-11-04T10:45:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/92bf5b06757b0185c20ba014fca536c82b128764.webp?v=1762224330","variant_ids":[43812120756323]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) PosterLad 水與沙 - 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-POS03","featured_media":{"alt":null,"id":26297107611747,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/92bf5b06757b0185c20ba014fca536c82b128764.webp?v=1762224330"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e16c812b211654ea55aae647f336fc387362e376.webp?v=1762224323","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e523233fccad48c8de8a15f52574189ff979b8b.webp?v=1762224324","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a7e234d08461dc83dad771e4b1ad499213f6825.webp?v=1762224325","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/177ecdf6048fc46160ed5e30ec7bfc91c7ca1090.webp?v=1762224325","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79fa7f21ec91a87e7fbdb7748c9a0aad08c82c29.webp?v=1762224326","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88f26ba54a348116cf5d06db5e84adb7691ca2af.webp?v=1762224327","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb3030f9f75ff0fb84d6118a2c73dba0d87d3329.webp?v=1762224329","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5148390264c39d9468b83e091d879da091a70418.webp?v=1762224329","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/92bf5b06757b0185c20ba014fca536c82b128764.webp?v=1762224330","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea77c4ceb5ede1f2d4b62aa45c5b1ed0cd64507d.webp?v=1762224331","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a5c80e9932c2d4ec680ee487e3672a7e3ce1ef7b.webp?v=1762224332"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e16c812b211654ea55aae647f336fc387362e376.webp?v=1762224323","options":["color"],"media":[{"alt":null,"id":26297106104419,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e16c812b211654ea55aae647f336fc387362e376.webp?v=1762224323"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e16c812b211654ea55aae647f336fc387362e376.webp?v=1762224323","width":2000},{"alt":null,"id":26297106301027,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e523233fccad48c8de8a15f52574189ff979b8b.webp?v=1762224324"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e523233fccad48c8de8a15f52574189ff979b8b.webp?v=1762224324","width":2000},{"alt":null,"id":26297106432099,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a7e234d08461dc83dad771e4b1ad499213f6825.webp?v=1762224325"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a7e234d08461dc83dad771e4b1ad499213f6825.webp?v=1762224325","width":2000},{"alt":null,"id":26297106530403,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/177ecdf6048fc46160ed5e30ec7bfc91c7ca1090.webp?v=1762224325"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/177ecdf6048fc46160ed5e30ec7bfc91c7ca1090.webp?v=1762224325","width":2000},{"alt":null,"id":26297106727011,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79fa7f21ec91a87e7fbdb7748c9a0aad08c82c29.webp?v=1762224326"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79fa7f21ec91a87e7fbdb7748c9a0aad08c82c29.webp?v=1762224326","width":2000},{"alt":null,"id":26297106890851,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88f26ba54a348116cf5d06db5e84adb7691ca2af.webp?v=1762224327"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88f26ba54a348116cf5d06db5e84adb7691ca2af.webp?v=1762224327","width":2000},{"alt":null,"id":26297106989155,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb3030f9f75ff0fb84d6118a2c73dba0d87d3329.webp?v=1762224329"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb3030f9f75ff0fb84d6118a2c73dba0d87d3329.webp?v=1762224329","width":2000},{"alt":null,"id":26297107251299,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5148390264c39d9468b83e091d879da091a70418.webp?v=1762224329"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5148390264c39d9468b83e091d879da091a70418.webp?v=1762224329","width":2000},{"alt":null,"id":26297107611747,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/92bf5b06757b0185c20ba014fca536c82b128764.webp?v=1762224330"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/92bf5b06757b0185c20ba014fca536c82b128764.webp?v=1762224330","width":2000},{"alt":null,"id":26297107841123,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea77c4ceb5ede1f2d4b62aa45c5b1ed0cd64507d.webp?v=1762224331"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea77c4ceb5ede1f2d4b62aa45c5b1ed0cd64507d.webp?v=1762224331","width":2000},{"alt":null,"id":26297108136035,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a5c80e9932c2d4ec680ee487e3672a7e3ce1ef7b.webp?v=1762224332"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a5c80e9932c2d4ec680ee487e3672a7e3ce1ef7b.webp?v=1762224332","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43812117217379,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-POS03","requires_shipping":true,"taxable":true,"featured_image":{"id":34729239674979,"product_id":7911253835875,"position":10,"created_at":"2025-11-04T10:45:29+08:00","updated_at":"2025-11-04T10:45:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea77c4ceb5ede1f2d4b62aa45c5b1ed0cd64507d.webp?v=1762224331","variant_ids":[43812117217379]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) PosterLad 水與沙 - 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-POS03","featured_media":{"alt":null,"id":26297107841123,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea77c4ceb5ede1f2d4b62aa45c5b1ed0cd64507d.webp?v=1762224331"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812120494179,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-POS03","requires_shipping":true,"taxable":true,"featured_image":{"id":34729238134883,"product_id":7911253835875,"position":2,"created_at":"2025-11-04T10:45:22+08:00","updated_at":"2025-11-04T10:45:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e523233fccad48c8de8a15f52574189ff979b8b.webp?v=1762224324","variant_ids":[43812120494179]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) PosterLad 水與沙 - 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-POS03","featured_media":{"alt":null,"id":26297106301027,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e523233fccad48c8de8a15f52574189ff979b8b.webp?v=1762224324"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812120526947,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-POS03","requires_shipping":true,"taxable":true,"featured_image":{"id":34729238364259,"product_id":7911253835875,"position":4,"created_at":"2025-11-04T10:45:24+08:00","updated_at":"2025-11-04T10:45:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/177ecdf6048fc46160ed5e30ec7bfc91c7ca1090.webp?v=1762224325","variant_ids":[43812120526947]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) PosterLad 水與沙 - 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-POS03","featured_media":{"alt":null,"id":26297106530403,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/177ecdf6048fc46160ed5e30ec7bfc91c7ca1090.webp?v=1762224325"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812120559715,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-POS03","requires_shipping":true,"taxable":true,"featured_image":{"id":34729239085155,"product_id":7911253835875,"position":8,"created_at":"2025-11-04T10:45:27+08:00","updated_at":"2025-11-04T10:45:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5148390264c39d9468b83e091d879da091a70418.webp?v=1762224329","variant_ids":[43812120559715]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) PosterLad 水與沙 - 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-POS03","featured_media":{"alt":null,"id":26297107251299,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5148390264c39d9468b83e091d879da091a70418.webp?v=1762224329"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812120756323,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-POS03","requires_shipping":true,"taxable":true,"featured_image":{"id":34729239412835,"product_id":7911253835875,"position":9,"created_at":"2025-11-04T10:45:28+08:00","updated_at":"2025-11-04T10:45:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/92bf5b06757b0185c20ba014fca536c82b128764.webp?v=1762224330","variant_ids":[43812120756323]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) PosterLad 水與沙 - 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-POS03","featured_media":{"alt":null,"id":26297107611747,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/92bf5b06757b0185c20ba014fca536c82b128764.webp?v=1762224330"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43812117217379,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-POS03","requires_shipping":true,"taxable":true,"featured_image":{"id":34729239674979,"product_id":7911253835875,"position":10,"created_at":"2025-11-04T10:45:29+08:00","updated_at":"2025-11-04T10:45:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea77c4ceb5ede1f2d4b62aa45c5b1ed0cd64507d.webp?v=1762224331","variant_ids":[43812117217379]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) PosterLad 水與沙 - 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-POS03","featured_media":{"alt":null,"id":26297107841123,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea77c4ceb5ede1f2d4b62aa45c5b1ed0cd64507d.webp?v=1762224331"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}; $device_handle = null; $brand_handle = null; $type = ""; var sellingStatus // 只有設計款(SKU 含 '-')才需要合圖 if ($isMerge && $defaultVariant.sku.includes('-')) { $(document).ready(function() { var productImg = $product.images[0]; var bumperImg = window.getProductImageUrl($defaultVariant.sku.split('-')[0]); var layers = ($type === 'mod-nx-backplate' || $type === 'mod-backplate') ? [productImg, bumperImg] : [bumperImg, productImg]; window.mergeProductImages(layers).then(function (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: "停產" }