$product = {"id":7159070818403,"title":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-洛杉磯湖人 L.A. Lakers","handle":"iphone-15-jellytint-magsafe-pm10","description":null,"published_at":"2024-02-01T16:49:38+08:00","created_at":"2024-01-26T17:27:27+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師JellyTint MagSafe專區-殼老爹","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nba","device-iPhone 15","merge","reseller-nba"],"price":148000,"price_min":148000,"price_max":148000,"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":41213065920611,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MCN012950G-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378228835,"product_id":7159070818403,"position":12,"created_at":"2026-07-02T12:18:08+08:00","updated_at":"2026-07-02T12:18:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_3be4a73d-12bc-417c-a8b4-068e40d04d53.webp?v=1782965890","variant_ids":[41213065920611]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-洛杉磯湖人 L.A. Lakers - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950G-PM10","featured_media":{"alt":null,"id":27657251717219,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_3be4a73d-12bc-417c-a8b4-068e40d04d53.webp?v=1782965890"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41213065953379,"title":"Moody Green","option1":"Moody Green","option2":null,"option3":null,"sku":"MCN012950H-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378130531,"product_id":7159070818403,"position":11,"created_at":"2026-07-02T12:18:07+08:00","updated_at":"2026-07-02T12:18:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1_c69a69f3-9cbf-4628-a4d8-fffa530908f0.webp?v=1782965889","variant_ids":[41213065953379]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-洛杉磯湖人 L.A. Lakers - Moody Green","public_title":"Moody Green","options":["Moody Green"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950H-PM10","featured_media":{"alt":null,"id":27657251618915,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1_c69a69f3-9cbf-4628-a4d8-fffa530908f0.webp?v=1782965889"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41213066018915,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"MCN012950J-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378458211,"product_id":7159070818403,"position":13,"created_at":"2026-07-02T12:18:08+08:00","updated_at":"2026-07-02T12:18:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35_e3275a66-ca9a-439f-8e4c-898dd52ad1da.webp?v=1782965890","variant_ids":[41213066018915]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-洛杉磯湖人 L.A. Lakers - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950J-PM10","featured_media":{"alt":null,"id":27657251946595,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35_e3275a66-ca9a-439f-8e4c-898dd52ad1da.webp?v=1782965890"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-295-PM10_eedd4362-3b4a-4f26-b762-91dcc4c18557.png?v=1706261250","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1.webp?v=1782208367","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35.webp?v=1782208367","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a.webp?v=1782208368","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1_eec75d7c-aae9-4714-b8dd-4b5c409ca740.webp?v=1782957975","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_e91f4373-aac3-42bd-9e19-1f19448c8ca0.webp?v=1782957976","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35_c89274c9-611d-488c-b2a4-55d956a243b9.webp?v=1782957976","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1_636050d5-aa01-43f1-ba5d-49ec495052ae.webp?v=1782961451","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_f0b959dc-fb61-457b-8df0-6797f6d6e03f.webp?v=1782961453","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35_da97f21a-86e3-410f-bd46-4c7b6f8f8858.webp?v=1782961461","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1_c69a69f3-9cbf-4628-a4d8-fffa530908f0.webp?v=1782965889","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_3be4a73d-12bc-417c-a8b4-068e40d04d53.webp?v=1782965890","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35_e3275a66-ca9a-439f-8e4c-898dd52ad1da.webp?v=1782965890"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-295-PM10_eedd4362-3b4a-4f26-b762-91dcc4c18557.png?v=1706261250","options":["color"],"media":[{"alt":null,"id":23219244040291,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-295-PM10_eedd4362-3b4a-4f26-b762-91dcc4c18557.png?v=1706261250"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-295-PM10_eedd4362-3b4a-4f26-b762-91dcc4c18557.png?v=1706261250","width":2000},{"alt":null,"id":27576294047843,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1.webp?v=1782208367"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1.webp?v=1782208367","width":2000},{"alt":null,"id":27576294637667,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35.webp?v=1782208367"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35.webp?v=1782208367","width":2000},{"alt":null,"id":27576295096419,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a.webp?v=1782208368"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a.webp?v=1782208368","width":2000},{"alt":null,"id":27655994114147,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1_eec75d7c-aae9-4714-b8dd-4b5c409ca740.webp?v=1782957975"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1_eec75d7c-aae9-4714-b8dd-4b5c409ca740.webp?v=1782957975","width":2000},{"alt":null,"id":27655994572899,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_e91f4373-aac3-42bd-9e19-1f19448c8ca0.webp?v=1782957976"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_e91f4373-aac3-42bd-9e19-1f19448c8ca0.webp?v=1782957976","width":2000},{"alt":null,"id":27655995031651,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35_c89274c9-611d-488c-b2a4-55d956a243b9.webp?v=1782957976"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35_c89274c9-611d-488c-b2a4-55d956a243b9.webp?v=1782957976","width":2000},{"alt":null,"id":27656768258147,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1_636050d5-aa01-43f1-ba5d-49ec495052ae.webp?v=1782961451"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1_636050d5-aa01-43f1-ba5d-49ec495052ae.webp?v=1782961451","width":2000},{"alt":null,"id":27656768749667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_f0b959dc-fb61-457b-8df0-6797f6d6e03f.webp?v=1782961453"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_f0b959dc-fb61-457b-8df0-6797f6d6e03f.webp?v=1782961453","width":2000},{"alt":null,"id":27656770060387,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35_da97f21a-86e3-410f-bd46-4c7b6f8f8858.webp?v=1782961461"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35_da97f21a-86e3-410f-bd46-4c7b6f8f8858.webp?v=1782961461","width":2000},{"alt":null,"id":27657251618915,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1_c69a69f3-9cbf-4628-a4d8-fffa530908f0.webp?v=1782965889"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1_c69a69f3-9cbf-4628-a4d8-fffa530908f0.webp?v=1782965889","width":2000},{"alt":null,"id":27657251717219,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_3be4a73d-12bc-417c-a8b4-068e40d04d53.webp?v=1782965890"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_3be4a73d-12bc-417c-a8b4-068e40d04d53.webp?v=1782965890","width":2000},{"alt":null,"id":27657251946595,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35_e3275a66-ca9a-439f-8e4c-898dd52ad1da.webp?v=1782965890"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35_e3275a66-ca9a-439f-8e4c-898dd52ad1da.webp?v=1782965890","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":41213065920611,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MCN012950G-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378228835,"product_id":7159070818403,"position":12,"created_at":"2026-07-02T12:18:08+08:00","updated_at":"2026-07-02T12:18:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_3be4a73d-12bc-417c-a8b4-068e40d04d53.webp?v=1782965890","variant_ids":[41213065920611]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-洛杉磯湖人 L.A. Lakers - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950G-PM10","featured_media":{"alt":null,"id":27657251717219,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_3be4a73d-12bc-417c-a8b4-068e40d04d53.webp?v=1782965890"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41213065953379,"title":"Moody Green","option1":"Moody Green","option2":null,"option3":null,"sku":"MCN012950H-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378130531,"product_id":7159070818403,"position":11,"created_at":"2026-07-02T12:18:07+08:00","updated_at":"2026-07-02T12:18:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1_c69a69f3-9cbf-4628-a4d8-fffa530908f0.webp?v=1782965889","variant_ids":[41213065953379]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-洛杉磯湖人 L.A. Lakers - Moody Green","public_title":"Moody Green","options":["Moody Green"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950H-PM10","featured_media":{"alt":null,"id":27657251618915,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8a3f1c920f61c254642fef6e9da3b3f57a9cfc1_c69a69f3-9cbf-4628-a4d8-fffa530908f0.webp?v=1782965889"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41213066018915,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"MCN012950J-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378458211,"product_id":7159070818403,"position":13,"created_at":"2026-07-02T12:18:08+08:00","updated_at":"2026-07-02T12:18:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35_e3275a66-ca9a-439f-8e4c-898dd52ad1da.webp?v=1782965890","variant_ids":[41213066018915]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-洛杉磯湖人 L.A. Lakers - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950J-PM10","featured_media":{"alt":null,"id":27657251946595,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6276d9bd3c986bf55cc64fe4b2a491c21a33be35_e3275a66-ca9a-439f-8e4c-898dd52ad1da.webp?v=1782965890"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":41213065920611,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MCN012950G-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378228835,"product_id":7159070818403,"position":12,"created_at":"2026-07-02T12:18:08+08:00","updated_at":"2026-07-02T12:18:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_3be4a73d-12bc-417c-a8b4-068e40d04d53.webp?v=1782965890","variant_ids":[41213065920611]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-洛杉磯湖人 L.A. Lakers - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950G-PM10","featured_media":{"alt":null,"id":27657251717219,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7d1b93461cda9eedacad4a9f66f3c9c0d2ee75a_3be4a73d-12bc-417c-a8b4-068e40d04d53.webp?v=1782965890"}},"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: "停產" }