$product = {"id":7919983394915,"title":"iPhone 15 Plus Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 所長的營火晚會","handle":"iphone-15-plus-mod-nx-magsafe-hd67","description":null,"published_at":"2025-11-13T10:03:18+08:00","created_at":"2025-11-10T09:57:42+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-incrediville","device-iPhone 15 Plus","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":43827597213795,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"MPB0129657-HD67","requires_shipping":true,"taxable":true,"featured_image":{"id":34786132131939,"product_id":7919983394915,"position":10,"created_at":"2025-11-11T09:44:09+08:00","updated_at":"2025-11-11T09:44:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bdfb59ac7ddb0afcefdc05ca78d0eaeab362bd6_dde61ec3-1be8-429f-b15b-7b7a76401f22.webp?v=1762825451","variant_ids":[43827597213795]},"available":true,"name":"iPhone 15 Plus Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 所長的營火晚會 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0129657-HD67","featured_media":{"alt":null,"id":26351589163107,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bdfb59ac7ddb0afcefdc05ca78d0eaeab362bd6_dde61ec3-1be8-429f-b15b-7b7a76401f22.webp?v=1762825451"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43827597344867,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0129624-HD67","requires_shipping":true,"taxable":true,"featured_image":{"id":34786132656227,"product_id":7919983394915,"position":12,"created_at":"2025-11-11T09:44:11+08:00","updated_at":"2025-11-11T09:44:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b289852031b4c55ba55fcb5b2e825bc983b3e08_cd30fe97-9fcf-48f3-912f-d0d4ccd84198.webp?v=1762825452","variant_ids":[43827597344867]},"available":true,"name":"iPhone 15 Plus 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":"MPB0129624-HD67","featured_media":{"alt":null,"id":26351589654627,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b289852031b4c55ba55fcb5b2e825bc983b3e08_cd30fe97-9fcf-48f3-912f-d0d4ccd84198.webp?v=1762825452"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db298ef2f6ca613a24271d6ba90bea7ad19b78e7.webp?v=1762739868","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b289852031b4c55ba55fcb5b2e825bc983b3e08.webp?v=1762739869","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bdfb59ac7ddb0afcefdc05ca78d0eaeab362bd6.webp?v=1762739869","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/236ca86b07d1f1da617b6b6de53ef5d603e44391.webp?v=1762739870","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f32c9ca0296bef308ed5af75711828ab0c26f6.webp?v=1762739871","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51438f6fcd84e12a5287b83599eb25346b7ef3f8.webp?v=1762739871","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0896409ed281465a02620ba03e11851c71fafa60.webp?v=1762739872","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f56bd5600c1c42d96752f3b4854d6bd4d2e793c5.webp?v=1762739873","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e6d39f2dde97356d922cf35f2be0e016bc31159.webp?v=1762739873","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bdfb59ac7ddb0afcefdc05ca78d0eaeab362bd6_dde61ec3-1be8-429f-b15b-7b7a76401f22.webp?v=1762825451","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0896409ed281465a02620ba03e11851c71fafa60_5ca171b9-1d5b-4e6c-9770-753a26fe3917.webp?v=1762825452","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b289852031b4c55ba55fcb5b2e825bc983b3e08_cd30fe97-9fcf-48f3-912f-d0d4ccd84198.webp?v=1762825452","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/236ca86b07d1f1da617b6b6de53ef5d603e44391_556091ed-87e3-43b6-8af2-c3cd335eb34f.webp?v=1762825453","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e6d39f2dde97356d922cf35f2be0e016bc31159_fd0dc68c-d1c3-4ef4-875f-2e35d89e75e5.webp?v=1762825454","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f56bd5600c1c42d96752f3b4854d6bd4d2e793c5_47eb702d-0b83-42c3-88ed-f9b7c2bde331.webp?v=1762825455","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f32c9ca0296bef308ed5af75711828ab0c26f6_0c097bfd-778c-47a0-99f9-616be2fc1519.webp?v=1762825455","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db298ef2f6ca613a24271d6ba90bea7ad19b78e7_70fa740e-ec9f-4aa8-8b8c-ddbbc1b99c4a.webp?v=1762825456","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51438f6fcd84e12a5287b83599eb25346b7ef3f8_017c1c2a-1e92-4753-9a85-23b5ba22e887.webp?v=1762825457"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db298ef2f6ca613a24271d6ba90bea7ad19b78e7.webp?v=1762739868","options":["color"],"media":[{"alt":null,"id":26345502048355,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db298ef2f6ca613a24271d6ba90bea7ad19b78e7.webp?v=1762739868"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db298ef2f6ca613a24271d6ba90bea7ad19b78e7.webp?v=1762739868","width":2000},{"alt":null,"id":26345502179427,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b289852031b4c55ba55fcb5b2e825bc983b3e08.webp?v=1762739869"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b289852031b4c55ba55fcb5b2e825bc983b3e08.webp?v=1762739869","width":2000},{"alt":null,"id":26345502343267,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bdfb59ac7ddb0afcefdc05ca78d0eaeab362bd6.webp?v=1762739869"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bdfb59ac7ddb0afcefdc05ca78d0eaeab362bd6.webp?v=1762739869","width":2000},{"alt":null,"id":26345502507107,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/236ca86b07d1f1da617b6b6de53ef5d603e44391.webp?v=1762739870"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/236ca86b07d1f1da617b6b6de53ef5d603e44391.webp?v=1762739870","width":2000},{"alt":null,"id":26345502670947,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f32c9ca0296bef308ed5af75711828ab0c26f6.webp?v=1762739871"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f32c9ca0296bef308ed5af75711828ab0c26f6.webp?v=1762739871","width":2000},{"alt":null,"id":26345502802019,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51438f6fcd84e12a5287b83599eb25346b7ef3f8.webp?v=1762739871"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51438f6fcd84e12a5287b83599eb25346b7ef3f8.webp?v=1762739871","width":2000},{"alt":null,"id":26345502933091,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0896409ed281465a02620ba03e11851c71fafa60.webp?v=1762739872"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0896409ed281465a02620ba03e11851c71fafa60.webp?v=1762739872","width":2000},{"alt":null,"id":26345503129699,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f56bd5600c1c42d96752f3b4854d6bd4d2e793c5.webp?v=1762739873"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f56bd5600c1c42d96752f3b4854d6bd4d2e793c5.webp?v=1762739873","width":2000},{"alt":null,"id":26345503326307,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e6d39f2dde97356d922cf35f2be0e016bc31159.webp?v=1762739873"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e6d39f2dde97356d922cf35f2be0e016bc31159.webp?v=1762739873","width":2000},{"alt":null,"id":26351589163107,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bdfb59ac7ddb0afcefdc05ca78d0eaeab362bd6_dde61ec3-1be8-429f-b15b-7b7a76401f22.webp?v=1762825451"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bdfb59ac7ddb0afcefdc05ca78d0eaeab362bd6_dde61ec3-1be8-429f-b15b-7b7a76401f22.webp?v=1762825451","width":2000},{"alt":null,"id":26351589392483,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0896409ed281465a02620ba03e11851c71fafa60_5ca171b9-1d5b-4e6c-9770-753a26fe3917.webp?v=1762825452"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0896409ed281465a02620ba03e11851c71fafa60_5ca171b9-1d5b-4e6c-9770-753a26fe3917.webp?v=1762825452","width":2000},{"alt":null,"id":26351589654627,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b289852031b4c55ba55fcb5b2e825bc983b3e08_cd30fe97-9fcf-48f3-912f-d0d4ccd84198.webp?v=1762825452"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b289852031b4c55ba55fcb5b2e825bc983b3e08_cd30fe97-9fcf-48f3-912f-d0d4ccd84198.webp?v=1762825452","width":2000},{"alt":null,"id":26351590015075,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/236ca86b07d1f1da617b6b6de53ef5d603e44391_556091ed-87e3-43b6-8af2-c3cd335eb34f.webp?v=1762825453"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/236ca86b07d1f1da617b6b6de53ef5d603e44391_556091ed-87e3-43b6-8af2-c3cd335eb34f.webp?v=1762825453","width":2000},{"alt":null,"id":26351590342755,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e6d39f2dde97356d922cf35f2be0e016bc31159_fd0dc68c-d1c3-4ef4-875f-2e35d89e75e5.webp?v=1762825454"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e6d39f2dde97356d922cf35f2be0e016bc31159_fd0dc68c-d1c3-4ef4-875f-2e35d89e75e5.webp?v=1762825454","width":2000},{"alt":null,"id":26351590506595,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f56bd5600c1c42d96752f3b4854d6bd4d2e793c5_47eb702d-0b83-42c3-88ed-f9b7c2bde331.webp?v=1762825455"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f56bd5600c1c42d96752f3b4854d6bd4d2e793c5_47eb702d-0b83-42c3-88ed-f9b7c2bde331.webp?v=1762825455","width":2000},{"alt":null,"id":26351590703203,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f32c9ca0296bef308ed5af75711828ab0c26f6_0c097bfd-778c-47a0-99f9-616be2fc1519.webp?v=1762825455"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f32c9ca0296bef308ed5af75711828ab0c26f6_0c097bfd-778c-47a0-99f9-616be2fc1519.webp?v=1762825455","width":2000},{"alt":null,"id":26351591063651,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db298ef2f6ca613a24271d6ba90bea7ad19b78e7_70fa740e-ec9f-4aa8-8b8c-ddbbc1b99c4a.webp?v=1762825456"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db298ef2f6ca613a24271d6ba90bea7ad19b78e7_70fa740e-ec9f-4aa8-8b8c-ddbbc1b99c4a.webp?v=1762825456","width":2000},{"alt":null,"id":26351591325795,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51438f6fcd84e12a5287b83599eb25346b7ef3f8_017c1c2a-1e92-4753-9a85-23b5ba22e887.webp?v=1762825457"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51438f6fcd84e12a5287b83599eb25346b7ef3f8_017c1c2a-1e92-4753-9a85-23b5ba22e887.webp?v=1762825457","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43827597213795,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"MPB0129657-HD67","requires_shipping":true,"taxable":true,"featured_image":{"id":34786132131939,"product_id":7919983394915,"position":10,"created_at":"2025-11-11T09:44:09+08:00","updated_at":"2025-11-11T09:44:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bdfb59ac7ddb0afcefdc05ca78d0eaeab362bd6_dde61ec3-1be8-429f-b15b-7b7a76401f22.webp?v=1762825451","variant_ids":[43827597213795]},"available":true,"name":"iPhone 15 Plus Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 所長的營火晚會 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0129657-HD67","featured_media":{"alt":null,"id":26351589163107,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bdfb59ac7ddb0afcefdc05ca78d0eaeab362bd6_dde61ec3-1be8-429f-b15b-7b7a76401f22.webp?v=1762825451"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43827597344867,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0129624-HD67","requires_shipping":true,"taxable":true,"featured_image":{"id":34786132656227,"product_id":7919983394915,"position":12,"created_at":"2025-11-11T09:44:11+08:00","updated_at":"2025-11-11T09:44:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b289852031b4c55ba55fcb5b2e825bc983b3e08_cd30fe97-9fcf-48f3-912f-d0d4ccd84198.webp?v=1762825452","variant_ids":[43827597344867]},"available":true,"name":"iPhone 15 Plus 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":"MPB0129624-HD67","featured_media":{"alt":null,"id":26351589654627,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b289852031b4c55ba55fcb5b2e825bc983b3e08_cd30fe97-9fcf-48f3-912f-d0d4ccd84198.webp?v=1762825452"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43827597213795,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"MPB0129657-HD67","requires_shipping":true,"taxable":true,"featured_image":{"id":34786132131939,"product_id":7919983394915,"position":10,"created_at":"2025-11-11T09:44:09+08:00","updated_at":"2025-11-11T09:44:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bdfb59ac7ddb0afcefdc05ca78d0eaeab362bd6_dde61ec3-1be8-429f-b15b-7b7a76401f22.webp?v=1762825451","variant_ids":[43827597213795]},"available":true,"name":"iPhone 15 Plus Mod NX (MagSafe 兼容) Incrediville 怪奇事物所 所長的營火晚會 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0129657-HD67","featured_media":{"alt":null,"id":26351589163107,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8bdfb59ac7ddb0afcefdc05ca78d0eaeab362bd6_dde61ec3-1be8-429f-b15b-7b7a76401f22.webp?v=1762825451"}},"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: "停產" }