$product = {"id":7911182794851,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) PosterLad 色彩之雨","handle":"iphone-12-pro-mod-nx-magsafe-printable-pos02","description":null,"published_at":"2025-11-05T10:50:22+08:00","created_at":"2025-11-04T10:30:56+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":43811898556515,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":34729029533795,"product_id":7911182794851,"position":9,"created_at":"2025-11-04T10:31:09+08:00","updated_at":"2025-11-04T10:31:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f57ebd6d4a5ae105133340fe7bc533e17fe60c.webp?v=1762223471","variant_ids":[43811898556515]},"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-POS02","featured_media":{"alt":null,"id":26296897994851,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f57ebd6d4a5ae105133340fe7bc533e17fe60c.webp?v=1762223471"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811902586979,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":34729027731555,"product_id":7911182794851,"position":3,"created_at":"2025-11-04T10:31:02+08:00","updated_at":"2025-11-04T10:31:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff8feff0b3e816850ada6fb4d580bfc3a581afc7.webp?v=1762223464","variant_ids":[43811902586979]},"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-POS02","featured_media":{"alt":null,"id":26296896192611,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff8feff0b3e816850ada6fb4d580bfc3a581afc7.webp?v=1762223464"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811902619747,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":34729028157539,"product_id":7911182794851,"position":5,"created_at":"2025-11-04T10:31:04+08:00","updated_at":"2025-11-04T10:31:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8a90a0eb1770e317b0eba31897b5285513cdcf7.webp?v=1762223466","variant_ids":[43811902619747]},"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-POS02","featured_media":{"alt":null,"id":26296896618595,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8a90a0eb1770e317b0eba31897b5285513cdcf7.webp?v=1762223466"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811902652515,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":34729029795939,"product_id":7911182794851,"position":10,"created_at":"2025-11-04T10:31:10+08:00","updated_at":"2025-11-04T10:31:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13930b38c7c272b7b800087576fbfdf239f0a08a.webp?v=1762223472","variant_ids":[43811902652515]},"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-POS02","featured_media":{"alt":null,"id":26296898224227,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13930b38c7c272b7b800087576fbfdf239f0a08a.webp?v=1762223472"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811902849123,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":34729027993699,"product_id":7911182794851,"position":4,"created_at":"2025-11-04T10:31:03+08:00","updated_at":"2025-11-04T10:31:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a41530faa7463cf487513bca704f88261ba40d5b.webp?v=1762223465","variant_ids":[43811902849123]},"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-POS02","featured_media":{"alt":null,"id":26296896487523,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a41530faa7463cf487513bca704f88261ba40d5b.webp?v=1762223465"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59275e2d03a41a180db0fa2bc8a45866d86d6854.webp?v=1762223463","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dac3225cf28c6dd4a774e8ff40612237698bbfc.webp?v=1762223463","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff8feff0b3e816850ada6fb4d580bfc3a581afc7.webp?v=1762223464","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a41530faa7463cf487513bca704f88261ba40d5b.webp?v=1762223465","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8a90a0eb1770e317b0eba31897b5285513cdcf7.webp?v=1762223466","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97879fac7da5fc5a04ecf16f9649c07ed7dc8b01.webp?v=1762223467","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a91eeea27cac8eaf4bdb8ba7822520bcbdca958.webp?v=1762223468","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/20b9e8a97463fcbb2328719eafbb0524ebc4171d.webp?v=1762223470","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f57ebd6d4a5ae105133340fe7bc533e17fe60c.webp?v=1762223471","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13930b38c7c272b7b800087576fbfdf239f0a08a.webp?v=1762223472","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98f93bde07debc4f469b3bf31addf21fee2d2554.webp?v=1762223473"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59275e2d03a41a180db0fa2bc8a45866d86d6854.webp?v=1762223463","options":["color"],"media":[{"alt":null,"id":26296895963235,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59275e2d03a41a180db0fa2bc8a45866d86d6854.webp?v=1762223463"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59275e2d03a41a180db0fa2bc8a45866d86d6854.webp?v=1762223463","width":2000},{"alt":null,"id":26296896061539,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dac3225cf28c6dd4a774e8ff40612237698bbfc.webp?v=1762223463"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dac3225cf28c6dd4a774e8ff40612237698bbfc.webp?v=1762223463","width":2000},{"alt":null,"id":26296896192611,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff8feff0b3e816850ada6fb4d580bfc3a581afc7.webp?v=1762223464"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff8feff0b3e816850ada6fb4d580bfc3a581afc7.webp?v=1762223464","width":2000},{"alt":null,"id":26296896487523,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a41530faa7463cf487513bca704f88261ba40d5b.webp?v=1762223465"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a41530faa7463cf487513bca704f88261ba40d5b.webp?v=1762223465","width":2000},{"alt":null,"id":26296896618595,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8a90a0eb1770e317b0eba31897b5285513cdcf7.webp?v=1762223466"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8a90a0eb1770e317b0eba31897b5285513cdcf7.webp?v=1762223466","width":2000},{"alt":null,"id":26296896815203,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97879fac7da5fc5a04ecf16f9649c07ed7dc8b01.webp?v=1762223467"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97879fac7da5fc5a04ecf16f9649c07ed7dc8b01.webp?v=1762223467","width":2000},{"alt":null,"id":26296897142883,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a91eeea27cac8eaf4bdb8ba7822520bcbdca958.webp?v=1762223468"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a91eeea27cac8eaf4bdb8ba7822520bcbdca958.webp?v=1762223468","width":2000},{"alt":null,"id":26296897699939,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/20b9e8a97463fcbb2328719eafbb0524ebc4171d.webp?v=1762223470"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/20b9e8a97463fcbb2328719eafbb0524ebc4171d.webp?v=1762223470","width":2000},{"alt":null,"id":26296897994851,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f57ebd6d4a5ae105133340fe7bc533e17fe60c.webp?v=1762223471"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f57ebd6d4a5ae105133340fe7bc533e17fe60c.webp?v=1762223471","width":2000},{"alt":null,"id":26296898224227,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13930b38c7c272b7b800087576fbfdf239f0a08a.webp?v=1762223472"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13930b38c7c272b7b800087576fbfdf239f0a08a.webp?v=1762223472","width":2000},{"alt":null,"id":26296898551907,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98f93bde07debc4f469b3bf31addf21fee2d2554.webp?v=1762223473"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98f93bde07debc4f469b3bf31addf21fee2d2554.webp?v=1762223473","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43811898556515,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":34729029533795,"product_id":7911182794851,"position":9,"created_at":"2025-11-04T10:31:09+08:00","updated_at":"2025-11-04T10:31:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f57ebd6d4a5ae105133340fe7bc533e17fe60c.webp?v=1762223471","variant_ids":[43811898556515]},"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-POS02","featured_media":{"alt":null,"id":26296897994851,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f57ebd6d4a5ae105133340fe7bc533e17fe60c.webp?v=1762223471"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811902586979,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":34729027731555,"product_id":7911182794851,"position":3,"created_at":"2025-11-04T10:31:02+08:00","updated_at":"2025-11-04T10:31:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff8feff0b3e816850ada6fb4d580bfc3a581afc7.webp?v=1762223464","variant_ids":[43811902586979]},"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-POS02","featured_media":{"alt":null,"id":26296896192611,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff8feff0b3e816850ada6fb4d580bfc3a581afc7.webp?v=1762223464"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811902619747,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":34729028157539,"product_id":7911182794851,"position":5,"created_at":"2025-11-04T10:31:04+08:00","updated_at":"2025-11-04T10:31:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8a90a0eb1770e317b0eba31897b5285513cdcf7.webp?v=1762223466","variant_ids":[43811902619747]},"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-POS02","featured_media":{"alt":null,"id":26296896618595,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8a90a0eb1770e317b0eba31897b5285513cdcf7.webp?v=1762223466"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811902652515,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":34729029795939,"product_id":7911182794851,"position":10,"created_at":"2025-11-04T10:31:10+08:00","updated_at":"2025-11-04T10:31:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13930b38c7c272b7b800087576fbfdf239f0a08a.webp?v=1762223472","variant_ids":[43811902652515]},"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-POS02","featured_media":{"alt":null,"id":26296898224227,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13930b38c7c272b7b800087576fbfdf239f0a08a.webp?v=1762223472"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811902849123,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":34729027993699,"product_id":7911182794851,"position":4,"created_at":"2025-11-04T10:31:03+08:00","updated_at":"2025-11-04T10:31:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a41530faa7463cf487513bca704f88261ba40d5b.webp?v=1762223465","variant_ids":[43811902849123]},"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-POS02","featured_media":{"alt":null,"id":26296896487523,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a41530faa7463cf487513bca704f88261ba40d5b.webp?v=1762223465"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43811898556515,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":34729029533795,"product_id":7911182794851,"position":9,"created_at":"2025-11-04T10:31:09+08:00","updated_at":"2025-11-04T10:31:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f57ebd6d4a5ae105133340fe7bc533e17fe60c.webp?v=1762223471","variant_ids":[43811898556515]},"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-POS02","featured_media":{"alt":null,"id":26296897994851,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f57ebd6d4a5ae105133340fe7bc533e17fe60c.webp?v=1762223471"}},"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: "停產" }