$product = {"id":7920572858467,"title":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-釘崎野薔薇","handle":"iphone-13-jellytint-ptt14","description":null,"published_at":"2025-11-10T16:29:10+08:00","created_at":"2025-11-10T15:13:49+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-jujutsu-kaisen","device-iPhone 13","merge","reseller-jujutsu-kaisen"],"price":128000,"price_min":128000,"price_max":128000,"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":43829030584419,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012600J-PTT14","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750577763,"product_id":7920572858467,"position":12,"created_at":"2026-06-29T15:21:32+08:00","updated_at":"2026-06-29T15:21:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_49429599-fdd0-4d21-8d44-6813716d2259.webp?v=1782717695","variant_ids":[43829030584419]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-釘崎野薔薇 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600J-PTT14","featured_media":{"alt":null,"id":27629993525347,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_49429599-fdd0-4d21-8d44-6813716d2259.webp?v=1782717695"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829031370851,"title":"Cyber Blue","option1":"Cyber Blue","option2":null,"option3":null,"sku":"CCN012600I-PTT14","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750807139,"product_id":7920572858467,"position":13,"created_at":"2026-06-29T15:21:33+08:00","updated_at":"2026-06-29T15:21:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_d3be9636-38b2-4efe-b594-c9780618ac49.webp?v=1782717695","variant_ids":[43829031370851]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-釘崎野薔薇 - Cyber Blue","public_title":"Cyber Blue","options":["Cyber Blue"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600I-PTT14","featured_media":{"alt":null,"id":27629993754723,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_d3be9636-38b2-4efe-b594-c9780618ac49.webp?v=1782717695"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829031403619,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012600G-PTT14","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750315619,"product_id":7920572858467,"position":11,"created_at":"2026-06-29T15:21:32+08:00","updated_at":"2026-06-29T15:21:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_fa8ee154-71e2-484f-8b66-1387d7925ab9.webp?v=1782717694","variant_ids":[43829031403619]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-釘崎野薔薇 - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600G-PTT14","featured_media":{"alt":null,"id":27629993263203,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_fa8ee154-71e2-484f-8b66-1387d7925ab9.webp?v=1782717694"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/963e735e29ad28fbc0ec8be6592cfd819eb8e97a_b46bf0ed-888f-4eac-b9d9-43a671d7d9a1.webp?v=1762758833","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_498de4d6-3f78-429a-8649-a193ecd7f3aa.webp?v=1762758834","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_fe67ba87-b7bc-4ee1-80e9-438d90551748.webp?v=1762758834","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_920edc69-ba33-4116-a92d-3860aab5b4ad.webp?v=1762758834","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_b39ec2fb-7b58-456e-882e-6e922eda8bd5.webp?v=1782265101","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_e393a5bd-eda4-47e6-b391-1871df05ba5c.webp?v=1782265101","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_aa7a9dd3-93f3-497c-8b0b-eb202e390d67.webp?v=1782265102","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_03986494-5917-49e0-a858-2f31accf9d36.webp?v=1782291268","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_5860f4a5-c36a-4a94-9499-eeeac90a1226.webp?v=1782291269","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_c00fda7f-80ca-4430-b3c5-bacdf8a28284.webp?v=1782291270","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_fa8ee154-71e2-484f-8b66-1387d7925ab9.webp?v=1782717694","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_49429599-fdd0-4d21-8d44-6813716d2259.webp?v=1782717695","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_d3be9636-38b2-4efe-b594-c9780618ac49.webp?v=1782717695"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/963e735e29ad28fbc0ec8be6592cfd819eb8e97a_b46bf0ed-888f-4eac-b9d9-43a671d7d9a1.webp?v=1762758833","options":["color"],"media":[{"alt":null,"id":26347937562723,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/963e735e29ad28fbc0ec8be6592cfd819eb8e97a_b46bf0ed-888f-4eac-b9d9-43a671d7d9a1.webp?v=1762758833"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/963e735e29ad28fbc0ec8be6592cfd819eb8e97a_b46bf0ed-888f-4eac-b9d9-43a671d7d9a1.webp?v=1762758833","width":2000},{"alt":null,"id":26347937726563,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_498de4d6-3f78-429a-8649-a193ecd7f3aa.webp?v=1762758834"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_498de4d6-3f78-429a-8649-a193ecd7f3aa.webp?v=1762758834","width":2000},{"alt":null,"id":26347937988707,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_fe67ba87-b7bc-4ee1-80e9-438d90551748.webp?v=1762758834"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_fe67ba87-b7bc-4ee1-80e9-438d90551748.webp?v=1762758834","width":2000},{"alt":null,"id":26347938185315,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_920edc69-ba33-4116-a92d-3860aab5b4ad.webp?v=1762758834"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_920edc69-ba33-4116-a92d-3860aab5b4ad.webp?v=1762758834","width":2000},{"alt":null,"id":27586961342563,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_b39ec2fb-7b58-456e-882e-6e922eda8bd5.webp?v=1782265101"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_b39ec2fb-7b58-456e-882e-6e922eda8bd5.webp?v=1782265101","width":2000},{"alt":null,"id":27586961965155,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_e393a5bd-eda4-47e6-b391-1871df05ba5c.webp?v=1782265101"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_e393a5bd-eda4-47e6-b391-1871df05ba5c.webp?v=1782265101","width":2000},{"alt":null,"id":27586962882659,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_aa7a9dd3-93f3-497c-8b0b-eb202e390d67.webp?v=1782265102"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_aa7a9dd3-93f3-497c-8b0b-eb202e390d67.webp?v=1782265102","width":2000},{"alt":null,"id":27594573152355,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_03986494-5917-49e0-a858-2f31accf9d36.webp?v=1782291268"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_03986494-5917-49e0-a858-2f31accf9d36.webp?v=1782291268","width":2000},{"alt":null,"id":27594573578339,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_5860f4a5-c36a-4a94-9499-eeeac90a1226.webp?v=1782291269"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_5860f4a5-c36a-4a94-9499-eeeac90a1226.webp?v=1782291269","width":2000},{"alt":null,"id":27594573971555,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_c00fda7f-80ca-4430-b3c5-bacdf8a28284.webp?v=1782291270"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_c00fda7f-80ca-4430-b3c5-bacdf8a28284.webp?v=1782291270","width":2000},{"alt":null,"id":27629993263203,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_fa8ee154-71e2-484f-8b66-1387d7925ab9.webp?v=1782717694"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_fa8ee154-71e2-484f-8b66-1387d7925ab9.webp?v=1782717694","width":2000},{"alt":null,"id":27629993525347,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_49429599-fdd0-4d21-8d44-6813716d2259.webp?v=1782717695"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_49429599-fdd0-4d21-8d44-6813716d2259.webp?v=1782717695","width":2000},{"alt":null,"id":27629993754723,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_d3be9636-38b2-4efe-b594-c9780618ac49.webp?v=1782717695"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_d3be9636-38b2-4efe-b594-c9780618ac49.webp?v=1782717695","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43829030584419,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012600J-PTT14","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750577763,"product_id":7920572858467,"position":12,"created_at":"2026-06-29T15:21:32+08:00","updated_at":"2026-06-29T15:21:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_49429599-fdd0-4d21-8d44-6813716d2259.webp?v=1782717695","variant_ids":[43829030584419]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-釘崎野薔薇 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600J-PTT14","featured_media":{"alt":null,"id":27629993525347,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_49429599-fdd0-4d21-8d44-6813716d2259.webp?v=1782717695"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829031370851,"title":"Cyber Blue","option1":"Cyber Blue","option2":null,"option3":null,"sku":"CCN012600I-PTT14","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750807139,"product_id":7920572858467,"position":13,"created_at":"2026-06-29T15:21:33+08:00","updated_at":"2026-06-29T15:21:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_d3be9636-38b2-4efe-b594-c9780618ac49.webp?v=1782717695","variant_ids":[43829031370851]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-釘崎野薔薇 - Cyber Blue","public_title":"Cyber Blue","options":["Cyber Blue"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600I-PTT14","featured_media":{"alt":null,"id":27629993754723,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d68930a0f952c9c5d64ae9c5c7cd781a33e6f839_d3be9636-38b2-4efe-b594-c9780618ac49.webp?v=1782717695"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829031403619,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012600G-PTT14","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750315619,"product_id":7920572858467,"position":11,"created_at":"2026-06-29T15:21:32+08:00","updated_at":"2026-06-29T15:21:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_fa8ee154-71e2-484f-8b66-1387d7925ab9.webp?v=1782717694","variant_ids":[43829031403619]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-釘崎野薔薇 - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600G-PTT14","featured_media":{"alt":null,"id":27629993263203,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cace494ad47242babfe03e9587ffc0e85bd28c7_fa8ee154-71e2-484f-8b66-1387d7925ab9.webp?v=1782717694"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43829030584419,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012600J-PTT14","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750577763,"product_id":7920572858467,"position":12,"created_at":"2026-06-29T15:21:32+08:00","updated_at":"2026-06-29T15:21:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_49429599-fdd0-4d21-8d44-6813716d2259.webp?v=1782717695","variant_ids":[43829030584419]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-釘崎野薔薇 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600J-PTT14","featured_media":{"alt":null,"id":27629993525347,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2111c85073943d7274a99476757611404930fbe0_49429599-fdd0-4d21-8d44-6813716d2259.webp?v=1782717695"}},"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: "停產" }