$product = {"id":7937773830243,"title":"iPhone 13 mini SolidSuit 進擊的巨人 Attack on Titan 自由之翼小徽章","handle":"iphone-13-mini-solidsuit-classic-xu16","description":null,"published_at":"2025-12-12T11:03:40+08:00","created_at":"2025-12-11T15:23:23+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-attack-on-titan","device-iPhone 13 Mini","merge","reseller-attack-on-titan"],"price":83000,"price_min":83000,"price_max":83000,"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":43883841683555,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"SST01228Z9-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":36225839726691,"product_id":7937773830243,"position":10,"created_at":"2026-07-09T09:36:43+08:00","updated_at":"2026-07-09T09:36:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fe66f1a39a122c1d4f9fa782eb3820acc997acdc_8074651a-ed45-4c9e-ad65-7e949c6041f2.webp?v=1783561005","variant_ids":[43883841683555]},"available":true,"name":"iPhone 13 mini SolidSuit 進擊的巨人 Attack on Titan 自由之翼小徽章 - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z9-XU16","featured_media":{"alt":null,"id":27730625364067,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fe66f1a39a122c1d4f9fa782eb3820acc997acdc_8074651a-ed45-4c9e-ad65-7e949c6041f2.webp?v=1783561005"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883841716323,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"SST01228Z8-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":36225840250979,"product_id":7937773830243,"position":12,"created_at":"2026-07-09T09:36:44+08:00","updated_at":"2026-07-09T09:36:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9762ae7968842d3786118d5f920d69bb81eee4b6_2fcfce10-6563-41f5-8a8d-43b2e232382d.webp?v=1783561006","variant_ids":[43883841716323]},"available":true,"name":"iPhone 13 mini SolidSuit 進擊的巨人 Attack on Titan 自由之翼小徽章 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z8-XU16","featured_media":{"alt":null,"id":27730625888355,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9762ae7968842d3786118d5f920d69bb81eee4b6_2fcfce10-6563-41f5-8a8d-43b2e232382d.webp?v=1783561006"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883841749091,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"SST01228O8-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":36225839530083,"product_id":7937773830243,"position":9,"created_at":"2026-07-09T09:36:42+08:00","updated_at":"2026-07-09T09:36:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b966a98615c9d1436db86f5eda2e3435bbb6ee4_55ace00f-4729-420f-8572-8ac014b12266.webp?v=1783561004","variant_ids":[43883841749091]},"available":true,"name":"iPhone 13 mini SolidSuit 進擊的巨人 Attack on Titan 自由之翼小徽章 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228O8-XU16","featured_media":{"alt":null,"id":27730625167459,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b966a98615c9d1436db86f5eda2e3435bbb6ee4_55ace00f-4729-420f-8572-8ac014b12266.webp?v=1783561004"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883841781859,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0122852-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":36225839988835,"product_id":7937773830243,"position":11,"created_at":"2026-07-09T09:36:43+08:00","updated_at":"2026-07-09T09:36:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e876b1df307c00fe4a95cba8704b25d2d2ce1e2_1f0e3c5b-8cea-4924-92b4-150f1b0e3273.webp?v=1783561006","variant_ids":[43883841781859]},"available":true,"name":"iPhone 13 mini SolidSuit 進擊的巨人 Attack on Titan 自由之翼小徽章 - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0122852-XU16","featured_media":{"alt":null,"id":27730625626211,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e876b1df307c00fe4a95cba8704b25d2d2ce1e2_1f0e3c5b-8cea-4924-92b4-150f1b0e3273.webp?v=1783561006"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9762ae7968842d3786118d5f920d69bb81eee4b6.webp?v=1765437808","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fe66f1a39a122c1d4f9fa782eb3820acc997acdc.webp?v=1765437808","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e876b1df307c00fe4a95cba8704b25d2d2ce1e2.webp?v=1765437809","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95cf76ac2e436276312241f9cf2707464fbbb098.webp?v=1765437809","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b966a98615c9d1436db86f5eda2e3435bbb6ee4.webp?v=1765437811","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/328d51ea79cc68a5b8293af6cf1985231992f685.webp?v=1765437812","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b97d3977b46bb749f7984f21ab6a7f8bff8690ae.webp?v=1765437812","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd8604d33ec4a70bcd0c2c4496287518c82a3504.webp?v=1765437812","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b966a98615c9d1436db86f5eda2e3435bbb6ee4_55ace00f-4729-420f-8572-8ac014b12266.webp?v=1783561004","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fe66f1a39a122c1d4f9fa782eb3820acc997acdc_8074651a-ed45-4c9e-ad65-7e949c6041f2.webp?v=1783561005","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e876b1df307c00fe4a95cba8704b25d2d2ce1e2_1f0e3c5b-8cea-4924-92b4-150f1b0e3273.webp?v=1783561006","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9762ae7968842d3786118d5f920d69bb81eee4b6_2fcfce10-6563-41f5-8a8d-43b2e232382d.webp?v=1783561006"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9762ae7968842d3786118d5f920d69bb81eee4b6.webp?v=1765437808","options":["color"],"media":[{"alt":null,"id":26494841651299,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9762ae7968842d3786118d5f920d69bb81eee4b6.webp?v=1765437808"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9762ae7968842d3786118d5f920d69bb81eee4b6.webp?v=1765437808","width":2000},{"alt":null,"id":26494841913443,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fe66f1a39a122c1d4f9fa782eb3820acc997acdc.webp?v=1765437808"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fe66f1a39a122c1d4f9fa782eb3820acc997acdc.webp?v=1765437808","width":2000},{"alt":null,"id":26494842208355,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e876b1df307c00fe4a95cba8704b25d2d2ce1e2.webp?v=1765437809"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e876b1df307c00fe4a95cba8704b25d2d2ce1e2.webp?v=1765437809","width":2000},{"alt":null,"id":26494842372195,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95cf76ac2e436276312241f9cf2707464fbbb098.webp?v=1765437809"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95cf76ac2e436276312241f9cf2707464fbbb098.webp?v=1765437809","width":2000},{"alt":null,"id":26494842732643,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b966a98615c9d1436db86f5eda2e3435bbb6ee4.webp?v=1765437811"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b966a98615c9d1436db86f5eda2e3435bbb6ee4.webp?v=1765437811","width":2000},{"alt":null,"id":26494842962019,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/328d51ea79cc68a5b8293af6cf1985231992f685.webp?v=1765437812"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/328d51ea79cc68a5b8293af6cf1985231992f685.webp?v=1765437812","width":2000},{"alt":null,"id":26494843224163,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b97d3977b46bb749f7984f21ab6a7f8bff8690ae.webp?v=1765437812"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b97d3977b46bb749f7984f21ab6a7f8bff8690ae.webp?v=1765437812","width":2000},{"alt":null,"id":26494843420771,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd8604d33ec4a70bcd0c2c4496287518c82a3504.webp?v=1765437812"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd8604d33ec4a70bcd0c2c4496287518c82a3504.webp?v=1765437812","width":2000},{"alt":null,"id":27730625167459,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b966a98615c9d1436db86f5eda2e3435bbb6ee4_55ace00f-4729-420f-8572-8ac014b12266.webp?v=1783561004"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b966a98615c9d1436db86f5eda2e3435bbb6ee4_55ace00f-4729-420f-8572-8ac014b12266.webp?v=1783561004","width":2000},{"alt":null,"id":27730625364067,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fe66f1a39a122c1d4f9fa782eb3820acc997acdc_8074651a-ed45-4c9e-ad65-7e949c6041f2.webp?v=1783561005"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fe66f1a39a122c1d4f9fa782eb3820acc997acdc_8074651a-ed45-4c9e-ad65-7e949c6041f2.webp?v=1783561005","width":2000},{"alt":null,"id":27730625626211,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e876b1df307c00fe4a95cba8704b25d2d2ce1e2_1f0e3c5b-8cea-4924-92b4-150f1b0e3273.webp?v=1783561006"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e876b1df307c00fe4a95cba8704b25d2d2ce1e2_1f0e3c5b-8cea-4924-92b4-150f1b0e3273.webp?v=1783561006","width":2000},{"alt":null,"id":27730625888355,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9762ae7968842d3786118d5f920d69bb81eee4b6_2fcfce10-6563-41f5-8a8d-43b2e232382d.webp?v=1783561006"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9762ae7968842d3786118d5f920d69bb81eee4b6_2fcfce10-6563-41f5-8a8d-43b2e232382d.webp?v=1783561006","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43883841683555,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"SST01228Z9-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":36225839726691,"product_id":7937773830243,"position":10,"created_at":"2026-07-09T09:36:43+08:00","updated_at":"2026-07-09T09:36:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fe66f1a39a122c1d4f9fa782eb3820acc997acdc_8074651a-ed45-4c9e-ad65-7e949c6041f2.webp?v=1783561005","variant_ids":[43883841683555]},"available":true,"name":"iPhone 13 mini SolidSuit 進擊的巨人 Attack on Titan 自由之翼小徽章 - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z9-XU16","featured_media":{"alt":null,"id":27730625364067,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fe66f1a39a122c1d4f9fa782eb3820acc997acdc_8074651a-ed45-4c9e-ad65-7e949c6041f2.webp?v=1783561005"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883841716323,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"SST01228Z8-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":36225840250979,"product_id":7937773830243,"position":12,"created_at":"2026-07-09T09:36:44+08:00","updated_at":"2026-07-09T09:36:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9762ae7968842d3786118d5f920d69bb81eee4b6_2fcfce10-6563-41f5-8a8d-43b2e232382d.webp?v=1783561006","variant_ids":[43883841716323]},"available":true,"name":"iPhone 13 mini SolidSuit 進擊的巨人 Attack on Titan 自由之翼小徽章 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z8-XU16","featured_media":{"alt":null,"id":27730625888355,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9762ae7968842d3786118d5f920d69bb81eee4b6_2fcfce10-6563-41f5-8a8d-43b2e232382d.webp?v=1783561006"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883841749091,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"SST01228O8-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":36225839530083,"product_id":7937773830243,"position":9,"created_at":"2026-07-09T09:36:42+08:00","updated_at":"2026-07-09T09:36:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b966a98615c9d1436db86f5eda2e3435bbb6ee4_55ace00f-4729-420f-8572-8ac014b12266.webp?v=1783561004","variant_ids":[43883841749091]},"available":true,"name":"iPhone 13 mini SolidSuit 進擊的巨人 Attack on Titan 自由之翼小徽章 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228O8-XU16","featured_media":{"alt":null,"id":27730625167459,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b966a98615c9d1436db86f5eda2e3435bbb6ee4_55ace00f-4729-420f-8572-8ac014b12266.webp?v=1783561004"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883841781859,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0122852-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":36225839988835,"product_id":7937773830243,"position":11,"created_at":"2026-07-09T09:36:43+08:00","updated_at":"2026-07-09T09:36:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e876b1df307c00fe4a95cba8704b25d2d2ce1e2_1f0e3c5b-8cea-4924-92b4-150f1b0e3273.webp?v=1783561006","variant_ids":[43883841781859]},"available":true,"name":"iPhone 13 mini SolidSuit 進擊的巨人 Attack on Titan 自由之翼小徽章 - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0122852-XU16","featured_media":{"alt":null,"id":27730625626211,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e876b1df307c00fe4a95cba8704b25d2d2ce1e2_1f0e3c5b-8cea-4924-92b4-150f1b0e3273.webp?v=1783561006"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43883841683555,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"SST01228Z9-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":36225839726691,"product_id":7937773830243,"position":10,"created_at":"2026-07-09T09:36:43+08:00","updated_at":"2026-07-09T09:36:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fe66f1a39a122c1d4f9fa782eb3820acc997acdc_8074651a-ed45-4c9e-ad65-7e949c6041f2.webp?v=1783561005","variant_ids":[43883841683555]},"available":true,"name":"iPhone 13 mini SolidSuit 進擊的巨人 Attack on Titan 自由之翼小徽章 - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z9-XU16","featured_media":{"alt":null,"id":27730625364067,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fe66f1a39a122c1d4f9fa782eb3820acc997acdc_8074651a-ed45-4c9e-ad65-7e949c6041f2.webp?v=1783561005"}},"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: "停產" }