$product = {"id":7829129855075,"title":"iPhone 15 Plus SolidX (MagSafe 兼容) 【獨家設計】 We TAIWAN : a-We a-We初登陸","handle":"iphone-15-plus-solidx-magsafe-bumper-back-original-design-do01","description":null,"published_at":"2025-07-31T09:41:53+08:00","created_at":"2025-06-30T16:37:05+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer-we-taiwan-a-we-collection","device-iPhone 15 Plus","discountable-item","merge","original-design","reseller-we-taiwan-a-we-collection"],"price":145000,"price_min":145000,"price_max":145000,"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":43503169306723,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"MNS012960A-DO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34100477755491,"product_id":7829129855075,"position":4,"created_at":"2025-06-30T16:37:11+08:00","updated_at":"2025-06-30T16:37:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63a50b7b4536f9c66ebbe2db551ec56da39f0328_91db527b-28b2-43f1-95e1-bf18c414fd0c.webp?v=1751272633","variant_ids":[43503169306723]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 【獨家設計】 We TAIWAN : a-We a-We初登陸 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS012960A-DO01","featured_media":{"alt":null,"id":25756706701411,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63a50b7b4536f9c66ebbe2db551ec56da39f0328_91db527b-28b2-43f1-95e1-bf18c414fd0c.webp?v=1751272633"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43503169339491,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MNS0129652-DO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34100477067363,"product_id":7829129855075,"position":3,"created_at":"2025-06-30T16:37:10+08:00","updated_at":"2025-06-30T16:37:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82d1a57864ef7271e89a2c19c2b3af3ad14a4889_c98623a2-333a-4a6c-b08a-29a75184e936.webp?v=1751272632","variant_ids":[43503169339491]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 【獨家設計】 We TAIWAN : a-We a-We初登陸 - Black","public_title":"Black","options":["Black"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS0129652-DO01","featured_media":{"alt":null,"id":25756706209891,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82d1a57864ef7271e89a2c19c2b3af3ad14a4889_c98623a2-333a-4a6c-b08a-29a75184e936.webp?v=1751272632"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43503169372259,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"MNS01296O8-DO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34100479426659,"product_id":7829129855075,"position":8,"created_at":"2025-06-30T16:37:13+08:00","updated_at":"2025-06-30T16:37:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a54f12155b71aa85b34f166077146597dcca7b5_5fbc855c-a5b3-44eb-842c-e39e642e3daa.webp?v=1751272635","variant_ids":[43503169372259]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 【獨家設計】 We TAIWAN : a-We a-We初登陸 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS01296O8-DO01","featured_media":{"alt":null,"id":25756707979363,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a54f12155b71aa85b34f166077146597dcca7b5_5fbc855c-a5b3-44eb-842c-e39e642e3daa.webp?v=1751272635"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43503169437795,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"MNS01296Z7-DO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34100481065059,"product_id":7829129855075,"position":10,"created_at":"2025-06-30T16:37:14+08:00","updated_at":"2025-06-30T16:37:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bb4ff6afd247626e6d46ba436ecfa599337e87b_593a81cb-c0d2-45af-b804-3b566f82a646.webp?v=1751272636","variant_ids":[43503169437795]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 【獨家設計】 We TAIWAN : a-We a-We初登陸 - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS01296Z7-DO01","featured_media":{"alt":null,"id":25756708470883,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bb4ff6afd247626e6d46ba436ecfa599337e87b_593a81cb-c0d2-45af-b804-3b566f82a646.webp?v=1751272636"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dab4f35efc69ee948bfb540eafd3e5f4857eee4a_56546a31-5cc3-488a-a972-e32263cdd943.webp?v=1751272631","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6df8528ffd35aca60d02c66695486cc5bf690161_9325dab7-40d1-4bf0-8883-15531b3cf586.webp?v=1751272631","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82d1a57864ef7271e89a2c19c2b3af3ad14a4889_c98623a2-333a-4a6c-b08a-29a75184e936.webp?v=1751272632","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63a50b7b4536f9c66ebbe2db551ec56da39f0328_91db527b-28b2-43f1-95e1-bf18c414fd0c.webp?v=1751272633","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e40f31cc980f712625956de879280ed0ca11abb_35d820dc-07d0-4e8d-8d71-7ca4a53e96de.webp?v=1751272633","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b2766506167099d804dfa4fffa3a03170d7f76c4_48cf70a3-cb90-4f3c-8e87-abfeb8040794.webp?v=1751272634","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7fa1d6e169e5877a864da10010391eba0ae99470_fbbc90ed-422b-4001-b96d-215db4742ad9.webp?v=1751272634","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a54f12155b71aa85b34f166077146597dcca7b5_5fbc855c-a5b3-44eb-842c-e39e642e3daa.webp?v=1751272635","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2345c756a13765d6762d79d282ce467de9943c23_16e34abf-b925-420f-ab1b-c430355a628e.webp?v=1751272635","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bb4ff6afd247626e6d46ba436ecfa599337e87b_593a81cb-c0d2-45af-b804-3b566f82a646.webp?v=1751272636"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dab4f35efc69ee948bfb540eafd3e5f4857eee4a_56546a31-5cc3-488a-a972-e32263cdd943.webp?v=1751272631","options":["color"],"media":[{"alt":null,"id":25756705882211,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dab4f35efc69ee948bfb540eafd3e5f4857eee4a_56546a31-5cc3-488a-a972-e32263cdd943.webp?v=1751272631"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dab4f35efc69ee948bfb540eafd3e5f4857eee4a_56546a31-5cc3-488a-a972-e32263cdd943.webp?v=1751272631","width":2000},{"alt":null,"id":25756706046051,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6df8528ffd35aca60d02c66695486cc5bf690161_9325dab7-40d1-4bf0-8883-15531b3cf586.webp?v=1751272631"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6df8528ffd35aca60d02c66695486cc5bf690161_9325dab7-40d1-4bf0-8883-15531b3cf586.webp?v=1751272631","width":2000},{"alt":null,"id":25756706209891,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82d1a57864ef7271e89a2c19c2b3af3ad14a4889_c98623a2-333a-4a6c-b08a-29a75184e936.webp?v=1751272632"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82d1a57864ef7271e89a2c19c2b3af3ad14a4889_c98623a2-333a-4a6c-b08a-29a75184e936.webp?v=1751272632","width":2000},{"alt":null,"id":25756706701411,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63a50b7b4536f9c66ebbe2db551ec56da39f0328_91db527b-28b2-43f1-95e1-bf18c414fd0c.webp?v=1751272633"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63a50b7b4536f9c66ebbe2db551ec56da39f0328_91db527b-28b2-43f1-95e1-bf18c414fd0c.webp?v=1751272633","width":2000},{"alt":null,"id":25756706930787,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e40f31cc980f712625956de879280ed0ca11abb_35d820dc-07d0-4e8d-8d71-7ca4a53e96de.webp?v=1751272633"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e40f31cc980f712625956de879280ed0ca11abb_35d820dc-07d0-4e8d-8d71-7ca4a53e96de.webp?v=1751272633","width":2000},{"alt":null,"id":25756707160163,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b2766506167099d804dfa4fffa3a03170d7f76c4_48cf70a3-cb90-4f3c-8e87-abfeb8040794.webp?v=1751272634"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b2766506167099d804dfa4fffa3a03170d7f76c4_48cf70a3-cb90-4f3c-8e87-abfeb8040794.webp?v=1751272634","width":2000},{"alt":null,"id":25756707684451,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7fa1d6e169e5877a864da10010391eba0ae99470_fbbc90ed-422b-4001-b96d-215db4742ad9.webp?v=1751272634"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7fa1d6e169e5877a864da10010391eba0ae99470_fbbc90ed-422b-4001-b96d-215db4742ad9.webp?v=1751272634","width":2000},{"alt":null,"id":25756707979363,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a54f12155b71aa85b34f166077146597dcca7b5_5fbc855c-a5b3-44eb-842c-e39e642e3daa.webp?v=1751272635"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a54f12155b71aa85b34f166077146597dcca7b5_5fbc855c-a5b3-44eb-842c-e39e642e3daa.webp?v=1751272635","width":2000},{"alt":null,"id":25756708175971,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2345c756a13765d6762d79d282ce467de9943c23_16e34abf-b925-420f-ab1b-c430355a628e.webp?v=1751272635"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2345c756a13765d6762d79d282ce467de9943c23_16e34abf-b925-420f-ab1b-c430355a628e.webp?v=1751272635","width":2000},{"alt":null,"id":25756708470883,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bb4ff6afd247626e6d46ba436ecfa599337e87b_593a81cb-c0d2-45af-b804-3b566f82a646.webp?v=1751272636"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bb4ff6afd247626e6d46ba436ecfa599337e87b_593a81cb-c0d2-45af-b804-3b566f82a646.webp?v=1751272636","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43503169306723,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"MNS012960A-DO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34100477755491,"product_id":7829129855075,"position":4,"created_at":"2025-06-30T16:37:11+08:00","updated_at":"2025-06-30T16:37:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63a50b7b4536f9c66ebbe2db551ec56da39f0328_91db527b-28b2-43f1-95e1-bf18c414fd0c.webp?v=1751272633","variant_ids":[43503169306723]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 【獨家設計】 We TAIWAN : a-We a-We初登陸 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS012960A-DO01","featured_media":{"alt":null,"id":25756706701411,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63a50b7b4536f9c66ebbe2db551ec56da39f0328_91db527b-28b2-43f1-95e1-bf18c414fd0c.webp?v=1751272633"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43503169339491,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MNS0129652-DO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34100477067363,"product_id":7829129855075,"position":3,"created_at":"2025-06-30T16:37:10+08:00","updated_at":"2025-06-30T16:37:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82d1a57864ef7271e89a2c19c2b3af3ad14a4889_c98623a2-333a-4a6c-b08a-29a75184e936.webp?v=1751272632","variant_ids":[43503169339491]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 【獨家設計】 We TAIWAN : a-We a-We初登陸 - Black","public_title":"Black","options":["Black"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS0129652-DO01","featured_media":{"alt":null,"id":25756706209891,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82d1a57864ef7271e89a2c19c2b3af3ad14a4889_c98623a2-333a-4a6c-b08a-29a75184e936.webp?v=1751272632"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43503169372259,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"MNS01296O8-DO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34100479426659,"product_id":7829129855075,"position":8,"created_at":"2025-06-30T16:37:13+08:00","updated_at":"2025-06-30T16:37:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a54f12155b71aa85b34f166077146597dcca7b5_5fbc855c-a5b3-44eb-842c-e39e642e3daa.webp?v=1751272635","variant_ids":[43503169372259]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 【獨家設計】 We TAIWAN : a-We a-We初登陸 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS01296O8-DO01","featured_media":{"alt":null,"id":25756707979363,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a54f12155b71aa85b34f166077146597dcca7b5_5fbc855c-a5b3-44eb-842c-e39e642e3daa.webp?v=1751272635"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43503169437795,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"MNS01296Z7-DO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34100481065059,"product_id":7829129855075,"position":10,"created_at":"2025-06-30T16:37:14+08:00","updated_at":"2025-06-30T16:37:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bb4ff6afd247626e6d46ba436ecfa599337e87b_593a81cb-c0d2-45af-b804-3b566f82a646.webp?v=1751272636","variant_ids":[43503169437795]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 【獨家設計】 We TAIWAN : a-We a-We初登陸 - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS01296Z7-DO01","featured_media":{"alt":null,"id":25756708470883,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bb4ff6afd247626e6d46ba436ecfa599337e87b_593a81cb-c0d2-45af-b804-3b566f82a646.webp?v=1751272636"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43503169306723,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"MNS012960A-DO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34100477755491,"product_id":7829129855075,"position":4,"created_at":"2025-06-30T16:37:11+08:00","updated_at":"2025-06-30T16:37:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63a50b7b4536f9c66ebbe2db551ec56da39f0328_91db527b-28b2-43f1-95e1-bf18c414fd0c.webp?v=1751272633","variant_ids":[43503169306723]},"available":true,"name":"iPhone 15 Plus SolidX (MagSafe 兼容) 【獨家設計】 We TAIWAN : a-We a-We初登陸 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":145000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MNS012960A-DO01","featured_media":{"alt":null,"id":25756706701411,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63a50b7b4536f9c66ebbe2db551ec56da39f0328_91db527b-28b2-43f1-95e1-bf18c414fd0c.webp?v=1751272633"}},"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: "停產" }