$product = {"id":7937795653731,"title":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 里維兵長剪影","handle":"iphone-12-pro-mod-nx-xu13","description":null,"published_at":"2025-12-12T10:59:19+08:00","created_at":"2025-12-11T15:28:18+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-attack-on-titan","device-iPhone 12 Pro","merge","reseller-attack-on-titan"],"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":43883922489443,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-XU13","requires_shipping":true,"taxable":true,"featured_image":{"id":34932559806563,"product_id":7937795653731,"position":1,"created_at":"2025-12-11T15:28:22+08:00","updated_at":"2025-12-11T15:28:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ffc2de06db42c3fbf2c79f5e6d4c0259f60f0f4b.webp?v=1765438104","variant_ids":[43883922489443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 里維兵長剪影 - 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-XU13","featured_media":{"alt":null,"id":26494931664995,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ffc2de06db42c3fbf2c79f5e6d4c0259f60f0f4b.webp?v=1765438104"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883925209187,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-XU13","requires_shipping":true,"taxable":true,"featured_image":{"id":34932559970403,"product_id":7937795653731,"position":2,"created_at":"2025-12-11T15:28:23+08:00","updated_at":"2025-12-11T15:28:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8dc6317f183dbe275d15df8d318eafae670a3129.webp?v=1765438105","variant_ids":[43883925209187]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 里維兵長剪影 - 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-XU13","featured_media":{"alt":null,"id":26494931828835,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8dc6317f183dbe275d15df8d318eafae670a3129.webp?v=1765438105"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883925373027,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-XU13","requires_shipping":true,"taxable":true,"featured_image":{"id":34932560265315,"product_id":7937795653731,"position":4,"created_at":"2025-12-11T15:28:24+08:00","updated_at":"2025-12-11T15:28:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/603feac28ca52b72beb2776669e416dd89f44711.webp?v=1765438106","variant_ids":[43883925373027]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 里維兵長剪影 - 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-XU13","featured_media":{"alt":null,"id":26494932123747,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/603feac28ca52b72beb2776669e416dd89f44711.webp?v=1765438106"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883925438563,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-XU13","requires_shipping":true,"taxable":true,"featured_image":{"id":34932560429155,"product_id":7937795653731,"position":6,"created_at":"2025-12-11T15:28:25+08:00","updated_at":"2025-12-11T15:28:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/537820abc5dd9e570766fa96b7a53decacd122fd.webp?v=1765438107","variant_ids":[43883925438563]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 里維兵長剪影 - 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-XU13","featured_media":{"alt":null,"id":26494932385891,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/537820abc5dd9e570766fa96b7a53decacd122fd.webp?v=1765438107"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883925471331,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-XU13","requires_shipping":true,"taxable":true,"featured_image":{"id":34932560363619,"product_id":7937795653731,"position":5,"created_at":"2025-12-11T15:28:24+08:00","updated_at":"2025-12-11T15:28:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b16257116ffc9231e28085a812ac2a5a487efa6.webp?v=1765438106","variant_ids":[43883925471331]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 里維兵長剪影 - 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-XU13","featured_media":{"alt":null,"id":26494932320355,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b16257116ffc9231e28085a812ac2a5a487efa6.webp?v=1765438106"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ffc2de06db42c3fbf2c79f5e6d4c0259f60f0f4b.webp?v=1765438104","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8dc6317f183dbe275d15df8d318eafae670a3129.webp?v=1765438105","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a318a78d827e348ec0d9e6d513ec7358bc9b5de2.webp?v=1765438105","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/603feac28ca52b72beb2776669e416dd89f44711.webp?v=1765438106","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b16257116ffc9231e28085a812ac2a5a487efa6.webp?v=1765438106","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/537820abc5dd9e570766fa96b7a53decacd122fd.webp?v=1765438107","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2bcf53ef5289b98afec9039291b62908eb2f483c.webp?v=1765438109","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea8afd58c6a718993029235742e54c38abbf5e74.webp?v=1765438110","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/219be60641c56189aa9b7322af0465defc5c135b.webp?v=1765438110","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7635dc5c7768e13de4e8e40456a8c6f9ea0e4b07.webp?v=1765438110","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb1dff44856c074117282755c02768c05949e2fb.webp?v=1765438111"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ffc2de06db42c3fbf2c79f5e6d4c0259f60f0f4b.webp?v=1765438104","options":["color"],"media":[{"alt":null,"id":26494931664995,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ffc2de06db42c3fbf2c79f5e6d4c0259f60f0f4b.webp?v=1765438104"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ffc2de06db42c3fbf2c79f5e6d4c0259f60f0f4b.webp?v=1765438104","width":2000},{"alt":null,"id":26494931828835,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8dc6317f183dbe275d15df8d318eafae670a3129.webp?v=1765438105"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8dc6317f183dbe275d15df8d318eafae670a3129.webp?v=1765438105","width":2000},{"alt":null,"id":26494931992675,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a318a78d827e348ec0d9e6d513ec7358bc9b5de2.webp?v=1765438105"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a318a78d827e348ec0d9e6d513ec7358bc9b5de2.webp?v=1765438105","width":2000},{"alt":null,"id":26494932123747,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/603feac28ca52b72beb2776669e416dd89f44711.webp?v=1765438106"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/603feac28ca52b72beb2776669e416dd89f44711.webp?v=1765438106","width":2000},{"alt":null,"id":26494932320355,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b16257116ffc9231e28085a812ac2a5a487efa6.webp?v=1765438106"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b16257116ffc9231e28085a812ac2a5a487efa6.webp?v=1765438106","width":2000},{"alt":null,"id":26494932385891,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/537820abc5dd9e570766fa96b7a53decacd122fd.webp?v=1765438107"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/537820abc5dd9e570766fa96b7a53decacd122fd.webp?v=1765438107","width":2000},{"alt":null,"id":26494932549731,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2bcf53ef5289b98afec9039291b62908eb2f483c.webp?v=1765438109"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2bcf53ef5289b98afec9039291b62908eb2f483c.webp?v=1765438109","width":2000},{"alt":null,"id":26494932648035,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea8afd58c6a718993029235742e54c38abbf5e74.webp?v=1765438110"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea8afd58c6a718993029235742e54c38abbf5e74.webp?v=1765438110","width":2000},{"alt":null,"id":26494932811875,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/219be60641c56189aa9b7322af0465defc5c135b.webp?v=1765438110"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/219be60641c56189aa9b7322af0465defc5c135b.webp?v=1765438110","width":2000},{"alt":null,"id":26494932975715,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7635dc5c7768e13de4e8e40456a8c6f9ea0e4b07.webp?v=1765438110"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7635dc5c7768e13de4e8e40456a8c6f9ea0e4b07.webp?v=1765438110","width":2000},{"alt":null,"id":26494933139555,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb1dff44856c074117282755c02768c05949e2fb.webp?v=1765438111"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb1dff44856c074117282755c02768c05949e2fb.webp?v=1765438111","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43883922489443,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-XU13","requires_shipping":true,"taxable":true,"featured_image":{"id":34932559806563,"product_id":7937795653731,"position":1,"created_at":"2025-12-11T15:28:22+08:00","updated_at":"2025-12-11T15:28:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ffc2de06db42c3fbf2c79f5e6d4c0259f60f0f4b.webp?v=1765438104","variant_ids":[43883922489443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 里維兵長剪影 - 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-XU13","featured_media":{"alt":null,"id":26494931664995,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ffc2de06db42c3fbf2c79f5e6d4c0259f60f0f4b.webp?v=1765438104"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883925209187,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-XU13","requires_shipping":true,"taxable":true,"featured_image":{"id":34932559970403,"product_id":7937795653731,"position":2,"created_at":"2025-12-11T15:28:23+08:00","updated_at":"2025-12-11T15:28:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8dc6317f183dbe275d15df8d318eafae670a3129.webp?v=1765438105","variant_ids":[43883925209187]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 里維兵長剪影 - 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-XU13","featured_media":{"alt":null,"id":26494931828835,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8dc6317f183dbe275d15df8d318eafae670a3129.webp?v=1765438105"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883925373027,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-XU13","requires_shipping":true,"taxable":true,"featured_image":{"id":34932560265315,"product_id":7937795653731,"position":4,"created_at":"2025-12-11T15:28:24+08:00","updated_at":"2025-12-11T15:28:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/603feac28ca52b72beb2776669e416dd89f44711.webp?v=1765438106","variant_ids":[43883925373027]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 里維兵長剪影 - 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-XU13","featured_media":{"alt":null,"id":26494932123747,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/603feac28ca52b72beb2776669e416dd89f44711.webp?v=1765438106"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883925438563,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-XU13","requires_shipping":true,"taxable":true,"featured_image":{"id":34932560429155,"product_id":7937795653731,"position":6,"created_at":"2025-12-11T15:28:25+08:00","updated_at":"2025-12-11T15:28:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/537820abc5dd9e570766fa96b7a53decacd122fd.webp?v=1765438107","variant_ids":[43883925438563]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 里維兵長剪影 - 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-XU13","featured_media":{"alt":null,"id":26494932385891,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/537820abc5dd9e570766fa96b7a53decacd122fd.webp?v=1765438107"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883925471331,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-XU13","requires_shipping":true,"taxable":true,"featured_image":{"id":34932560363619,"product_id":7937795653731,"position":5,"created_at":"2025-12-11T15:28:24+08:00","updated_at":"2025-12-11T15:28:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b16257116ffc9231e28085a812ac2a5a487efa6.webp?v=1765438106","variant_ids":[43883925471331]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 里維兵長剪影 - 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-XU13","featured_media":{"alt":null,"id":26494932320355,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b16257116ffc9231e28085a812ac2a5a487efa6.webp?v=1765438106"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43883922489443,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-XU13","requires_shipping":true,"taxable":true,"featured_image":{"id":34932559806563,"product_id":7937795653731,"position":1,"created_at":"2025-12-11T15:28:22+08:00","updated_at":"2025-12-11T15:28:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ffc2de06db42c3fbf2c79f5e6d4c0259f60f0f4b.webp?v=1765438104","variant_ids":[43883922489443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 里維兵長剪影 - 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-XU13","featured_media":{"alt":null,"id":26494931664995,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ffc2de06db42c3fbf2c79f5e6d4c0259f60f0f4b.webp?v=1765438104"}},"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: "停產" }