$product = {"id":7655767179363,"title":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear","handle":"iphone-14-plus-solidsuit-classic-magsafe-yb45","description":null,"published_at":"2024-10-04T14:29:41+08:00","created_at":"2024-10-04T10:11:34+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師SolidSuit MagSafe專區-Care Bears","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-carebears","device-iPhone 14 Plus","merge","reseller-carebears"],"price":125000,"price_min":125000,"price_max":125000,"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":42854994215011,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0126152-YB45","requires_shipping":true,"taxable":true,"featured_image":{"id":36040128561251,"product_id":7655767179363,"position":4,"created_at":"2026-06-22T15:51:55+08:00","updated_at":"2026-06-22T15:51:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/900b7aea24a61634b62529f7e5354723c21b52d3.webp?v=1782114717","variant_ids":[42854994215011]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear - Black","public_title":"Black","options":["Black"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126152-YB45","featured_media":{"alt":null,"id":27556665983075,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/900b7aea24a61634b62529f7e5354723c21b52d3.webp?v=1782114717"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42854994280547,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"MST0126157-YB45","requires_shipping":true,"taxable":true,"featured_image":{"id":36040129675363,"product_id":7655767179363,"position":6,"created_at":"2026-06-22T15:51:56+08:00","updated_at":"2026-06-22T15:51:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ca7425e9e910f8e61d8d1b53fc70be41afa5360.webp?v=1782114718","variant_ids":[42854994280547]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126157-YB45","featured_media":{"alt":null,"id":27556667097187,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ca7425e9e910f8e61d8d1b53fc70be41afa5360.webp?v=1782114718"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42854994346083,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01261O9-YB45","requires_shipping":true,"taxable":true,"featured_image":{"id":36040127447139,"product_id":7655767179363,"position":2,"created_at":"2026-06-22T15:51:54+08:00","updated_at":"2026-06-22T15:51:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2ea8dddb998e220191db61c52c2d4e240288403.webp?v=1782114716","variant_ids":[42854994346083]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01261O9-YB45","featured_media":{"alt":null,"id":27556664868963,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2ea8dddb998e220191db61c52c2d4e240288403.webp?v=1782114716"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42854994640995,"title":"Bordeaux Red","option1":"Bordeaux Red","option2":null,"option3":null,"sku":"MST012610D-YB45","requires_shipping":true,"taxable":true,"featured_image":{"id":36040129151075,"product_id":7655767179363,"position":5,"created_at":"2026-06-22T15:51:56+08:00","updated_at":"2026-06-22T15:51:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6b788b69776b5301a242cff06734920a06acbab.webp?v=1782114718","variant_ids":[42854994640995]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear - Bordeaux Red","public_title":"Bordeaux Red","options":["Bordeaux Red"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610D-YB45","featured_media":{"alt":null,"id":27556666572899,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6b788b69776b5301a242cff06734920a06acbab.webp?v=1782114718"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42854994673763,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012610F-YB45","requires_shipping":true,"taxable":true,"featured_image":{"id":36040128004195,"product_id":7655767179363,"position":3,"created_at":"2026-06-22T15:51:54+08:00","updated_at":"2026-06-22T15:51:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1634cef483918ea359e55e2904c0ac2878fb591e.webp?v=1782114716","variant_ids":[42854994673763]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610F-YB45","featured_media":{"alt":null,"id":27556665426019,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1634cef483918ea359e55e2904c0ac2878fb591e.webp?v=1782114716"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42854994706531,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012610C-YB45","requires_shipping":true,"taxable":true,"featured_image":{"id":36040130199651,"product_id":7655767179363,"position":7,"created_at":"2026-06-22T15:51:57+08:00","updated_at":"2026-06-22T15:51:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bcb2eb34939f94151210bbede009033487227ca9.webp?v=1782114719","variant_ids":[42854994706531]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610C-YB45","featured_media":{"alt":null,"id":27556667621475,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bcb2eb34939f94151210bbede009033487227ca9.webp?v=1782114719"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a6798f872928ea620f236b922241133dccd1c05.webp?v=1728007901","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2ea8dddb998e220191db61c52c2d4e240288403.webp?v=1782114716","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1634cef483918ea359e55e2904c0ac2878fb591e.webp?v=1782114716","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/900b7aea24a61634b62529f7e5354723c21b52d3.webp?v=1782114717","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6b788b69776b5301a242cff06734920a06acbab.webp?v=1782114718","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ca7425e9e910f8e61d8d1b53fc70be41afa5360.webp?v=1782114718","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bcb2eb34939f94151210bbede009033487227ca9.webp?v=1782114719"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a6798f872928ea620f236b922241133dccd1c05.webp?v=1728007901","options":["color"],"media":[{"alt":null,"id":24780286165091,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a6798f872928ea620f236b922241133dccd1c05.webp?v=1728007901"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a6798f872928ea620f236b922241133dccd1c05.webp?v=1728007901","width":2000},{"alt":null,"id":27556664868963,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2ea8dddb998e220191db61c52c2d4e240288403.webp?v=1782114716"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2ea8dddb998e220191db61c52c2d4e240288403.webp?v=1782114716","width":2000},{"alt":null,"id":27556665426019,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1634cef483918ea359e55e2904c0ac2878fb591e.webp?v=1782114716"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1634cef483918ea359e55e2904c0ac2878fb591e.webp?v=1782114716","width":2000},{"alt":null,"id":27556665983075,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/900b7aea24a61634b62529f7e5354723c21b52d3.webp?v=1782114717"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/900b7aea24a61634b62529f7e5354723c21b52d3.webp?v=1782114717","width":2000},{"alt":null,"id":27556666572899,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6b788b69776b5301a242cff06734920a06acbab.webp?v=1782114718"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6b788b69776b5301a242cff06734920a06acbab.webp?v=1782114718","width":2000},{"alt":null,"id":27556667097187,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ca7425e9e910f8e61d8d1b53fc70be41afa5360.webp?v=1782114718"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ca7425e9e910f8e61d8d1b53fc70be41afa5360.webp?v=1782114718","width":2000},{"alt":null,"id":27556667621475,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bcb2eb34939f94151210bbede009033487227ca9.webp?v=1782114719"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bcb2eb34939f94151210bbede009033487227ca9.webp?v=1782114719","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":42854994215011,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0126152-YB45","requires_shipping":true,"taxable":true,"featured_image":{"id":36040128561251,"product_id":7655767179363,"position":4,"created_at":"2026-06-22T15:51:55+08:00","updated_at":"2026-06-22T15:51:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/900b7aea24a61634b62529f7e5354723c21b52d3.webp?v=1782114717","variant_ids":[42854994215011]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear - Black","public_title":"Black","options":["Black"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126152-YB45","featured_media":{"alt":null,"id":27556665983075,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/900b7aea24a61634b62529f7e5354723c21b52d3.webp?v=1782114717"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42854994280547,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"MST0126157-YB45","requires_shipping":true,"taxable":true,"featured_image":{"id":36040129675363,"product_id":7655767179363,"position":6,"created_at":"2026-06-22T15:51:56+08:00","updated_at":"2026-06-22T15:51:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ca7425e9e910f8e61d8d1b53fc70be41afa5360.webp?v=1782114718","variant_ids":[42854994280547]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126157-YB45","featured_media":{"alt":null,"id":27556667097187,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ca7425e9e910f8e61d8d1b53fc70be41afa5360.webp?v=1782114718"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42854994346083,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01261O9-YB45","requires_shipping":true,"taxable":true,"featured_image":{"id":36040127447139,"product_id":7655767179363,"position":2,"created_at":"2026-06-22T15:51:54+08:00","updated_at":"2026-06-22T15:51:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2ea8dddb998e220191db61c52c2d4e240288403.webp?v=1782114716","variant_ids":[42854994346083]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01261O9-YB45","featured_media":{"alt":null,"id":27556664868963,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2ea8dddb998e220191db61c52c2d4e240288403.webp?v=1782114716"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42854994640995,"title":"Bordeaux Red","option1":"Bordeaux Red","option2":null,"option3":null,"sku":"MST012610D-YB45","requires_shipping":true,"taxable":true,"featured_image":{"id":36040129151075,"product_id":7655767179363,"position":5,"created_at":"2026-06-22T15:51:56+08:00","updated_at":"2026-06-22T15:51:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6b788b69776b5301a242cff06734920a06acbab.webp?v=1782114718","variant_ids":[42854994640995]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear - Bordeaux Red","public_title":"Bordeaux Red","options":["Bordeaux Red"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610D-YB45","featured_media":{"alt":null,"id":27556666572899,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6b788b69776b5301a242cff06734920a06acbab.webp?v=1782114718"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42854994673763,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012610F-YB45","requires_shipping":true,"taxable":true,"featured_image":{"id":36040128004195,"product_id":7655767179363,"position":3,"created_at":"2026-06-22T15:51:54+08:00","updated_at":"2026-06-22T15:51:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1634cef483918ea359e55e2904c0ac2878fb591e.webp?v=1782114716","variant_ids":[42854994673763]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610F-YB45","featured_media":{"alt":null,"id":27556665426019,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1634cef483918ea359e55e2904c0ac2878fb591e.webp?v=1782114716"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":42854994706531,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012610C-YB45","requires_shipping":true,"taxable":true,"featured_image":{"id":36040130199651,"product_id":7655767179363,"position":7,"created_at":"2026-06-22T15:51:57+08:00","updated_at":"2026-06-22T15:51:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bcb2eb34939f94151210bbede009033487227ca9.webp?v=1782114719","variant_ids":[42854994706531]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610C-YB45","featured_media":{"alt":null,"id":27556667621475,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bcb2eb34939f94151210bbede009033487227ca9.webp?v=1782114719"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":42854994215011,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0126152-YB45","requires_shipping":true,"taxable":true,"featured_image":{"id":36040128561251,"product_id":7655767179363,"position":4,"created_at":"2026-06-22T15:51:55+08:00","updated_at":"2026-06-22T15:51:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/900b7aea24a61634b62529f7e5354723c21b52d3.webp?v=1782114717","variant_ids":[42854994215011]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) Care Bears Love-a-Lot Bear - Black","public_title":"Black","options":["Black"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126152-YB45","featured_media":{"alt":null,"id":27556665983075,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/900b7aea24a61634b62529f7e5354723c21b52d3.webp?v=1782114717"}},"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: "停產" }