$product = {"id":7921128603747,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 台式夜遊者","handle":"iphone-12-pro-mod-nx-magsafe-hd73","description":null,"published_at":"2025-11-13T09:49:54+08:00","created_at":"2025-11-11T09:41:52+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-incrediville","device-iPhone 12 Pro","merge","reseller-incrediville"],"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":43830872473699,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786087665763,"product_id":7921128603747,"position":10,"created_at":"2025-11-11T09:42:04+08:00","updated_at":"2025-11-11T09:42:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17e9452d02210fbe48490344884b96b9d7889243.webp?v=1762825326","variant_ids":[43830872473699]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351544860771,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17e9452d02210fbe48490344884b96b9d7889243.webp?v=1762825326"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830875160675,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786086813795,"product_id":7921128603747,"position":7,"created_at":"2025-11-11T09:42:02+08:00","updated_at":"2025-11-11T09:42:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ef7969dfed598cd864924a04310f6e54967f289.webp?v=1762825324","variant_ids":[43830875160675]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351543812195,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ef7969dfed598cd864924a04310f6e54967f289.webp?v=1762825324"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830875193443,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786085896291,"product_id":7921128603747,"position":4,"created_at":"2025-11-11T09:41:59+08:00","updated_at":"2025-11-11T09:42:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48ec49e7f2074a1b6e1f038004877354c690cde5.webp?v=1762825321","variant_ids":[43830875193443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351542894691,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48ec49e7f2074a1b6e1f038004877354c690cde5.webp?v=1762825321"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830875291747,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786084913251,"product_id":7921128603747,"position":1,"created_at":"2025-11-11T09:41:56+08:00","updated_at":"2025-11-11T09:41:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef1496c19759d6e8764be52394273c197fba2afd.webp?v=1762825318","variant_ids":[43830875291747]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351541911651,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef1496c19759d6e8764be52394273c197fba2afd.webp?v=1762825318"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830875455587,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786086223971,"product_id":7921128603747,"position":5,"created_at":"2025-11-11T09:42:00+08:00","updated_at":"2025-11-11T09:42:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405a953128d231d28c4c1764732512808042e67d.webp?v=1762825322","variant_ids":[43830875455587]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351543222371,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405a953128d231d28c4c1764732512808042e67d.webp?v=1762825322"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef1496c19759d6e8764be52394273c197fba2afd.webp?v=1762825318","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/497b5dd564a0dbd403176f945e912206c29f0e28.webp?v=1762825319","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e971d35217971b36b5981f2dc4eaf3177b1ed5f.webp?v=1762825321","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48ec49e7f2074a1b6e1f038004877354c690cde5.webp?v=1762825321","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405a953128d231d28c4c1764732512808042e67d.webp?v=1762825322","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/766c54e6d56737db4a715db1f86305d65b468542.webp?v=1762825323","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ef7969dfed598cd864924a04310f6e54967f289.webp?v=1762825324","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fdd5f03d1d0ff9b3d44a66f2f4294d070d61e7ed.webp?v=1762825325","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b79b836d118ad9689c49b4c03e7ad63e97b0a0e1.webp?v=1762825325","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17e9452d02210fbe48490344884b96b9d7889243.webp?v=1762825326","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/121e4ea3479c754489c34710a44ff254475e616c.webp?v=1762825327"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef1496c19759d6e8764be52394273c197fba2afd.webp?v=1762825318","options":["color"],"media":[{"alt":null,"id":26351541911651,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef1496c19759d6e8764be52394273c197fba2afd.webp?v=1762825318"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef1496c19759d6e8764be52394273c197fba2afd.webp?v=1762825318","width":2000},{"alt":null,"id":26351542206563,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/497b5dd564a0dbd403176f945e912206c29f0e28.webp?v=1762825319"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/497b5dd564a0dbd403176f945e912206c29f0e28.webp?v=1762825319","width":2000},{"alt":null,"id":26351542665315,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e971d35217971b36b5981f2dc4eaf3177b1ed5f.webp?v=1762825321"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e971d35217971b36b5981f2dc4eaf3177b1ed5f.webp?v=1762825321","width":2000},{"alt":null,"id":26351542894691,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48ec49e7f2074a1b6e1f038004877354c690cde5.webp?v=1762825321"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48ec49e7f2074a1b6e1f038004877354c690cde5.webp?v=1762825321","width":2000},{"alt":null,"id":26351543222371,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405a953128d231d28c4c1764732512808042e67d.webp?v=1762825322"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405a953128d231d28c4c1764732512808042e67d.webp?v=1762825322","width":2000},{"alt":null,"id":26351543517283,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/766c54e6d56737db4a715db1f86305d65b468542.webp?v=1762825323"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/766c54e6d56737db4a715db1f86305d65b468542.webp?v=1762825323","width":2000},{"alt":null,"id":26351543812195,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ef7969dfed598cd864924a04310f6e54967f289.webp?v=1762825324"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ef7969dfed598cd864924a04310f6e54967f289.webp?v=1762825324","width":2000},{"alt":null,"id":26351544270947,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fdd5f03d1d0ff9b3d44a66f2f4294d070d61e7ed.webp?v=1762825325"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fdd5f03d1d0ff9b3d44a66f2f4294d070d61e7ed.webp?v=1762825325","width":2000},{"alt":null,"id":26351544598627,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b79b836d118ad9689c49b4c03e7ad63e97b0a0e1.webp?v=1762825325"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b79b836d118ad9689c49b4c03e7ad63e97b0a0e1.webp?v=1762825325","width":2000},{"alt":null,"id":26351544860771,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17e9452d02210fbe48490344884b96b9d7889243.webp?v=1762825326"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17e9452d02210fbe48490344884b96b9d7889243.webp?v=1762825326","width":2000},{"alt":null,"id":26351545090147,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/121e4ea3479c754489c34710a44ff254475e616c.webp?v=1762825327"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/121e4ea3479c754489c34710a44ff254475e616c.webp?v=1762825327","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43830872473699,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786087665763,"product_id":7921128603747,"position":10,"created_at":"2025-11-11T09:42:04+08:00","updated_at":"2025-11-11T09:42:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17e9452d02210fbe48490344884b96b9d7889243.webp?v=1762825326","variant_ids":[43830872473699]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351544860771,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17e9452d02210fbe48490344884b96b9d7889243.webp?v=1762825326"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830875160675,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786086813795,"product_id":7921128603747,"position":7,"created_at":"2025-11-11T09:42:02+08:00","updated_at":"2025-11-11T09:42:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ef7969dfed598cd864924a04310f6e54967f289.webp?v=1762825324","variant_ids":[43830875160675]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351543812195,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ef7969dfed598cd864924a04310f6e54967f289.webp?v=1762825324"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830875193443,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786085896291,"product_id":7921128603747,"position":4,"created_at":"2025-11-11T09:41:59+08:00","updated_at":"2025-11-11T09:42:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48ec49e7f2074a1b6e1f038004877354c690cde5.webp?v=1762825321","variant_ids":[43830875193443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351542894691,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48ec49e7f2074a1b6e1f038004877354c690cde5.webp?v=1762825321"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830875291747,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786084913251,"product_id":7921128603747,"position":1,"created_at":"2025-11-11T09:41:56+08:00","updated_at":"2025-11-11T09:41:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef1496c19759d6e8764be52394273c197fba2afd.webp?v=1762825318","variant_ids":[43830875291747]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351541911651,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef1496c19759d6e8764be52394273c197fba2afd.webp?v=1762825318"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830875455587,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786086223971,"product_id":7921128603747,"position":5,"created_at":"2025-11-11T09:42:00+08:00","updated_at":"2025-11-11T09:42:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405a953128d231d28c4c1764732512808042e67d.webp?v=1762825322","variant_ids":[43830875455587]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351543222371,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405a953128d231d28c4c1764732512808042e67d.webp?v=1762825322"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43830872473699,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786087665763,"product_id":7921128603747,"position":10,"created_at":"2025-11-11T09:42:04+08:00","updated_at":"2025-11-11T09:42:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17e9452d02210fbe48490344884b96b9d7889243.webp?v=1762825326","variant_ids":[43830872473699]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351544860771,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17e9452d02210fbe48490344884b96b9d7889243.webp?v=1762825326"}},"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: "停產" }