$product = {"id":6984220278883,"title":"iPhone 13 mini SolidSuit (MagSafe 兼容) NBA B\u0026W-費城76人 Philadelphia 76ers B\u0026W","handle":"iphone-13-mini-solidsuit-classic-magsafe-pm43","description":null,"published_at":"2023-08-02T22:39:56+08:00","created_at":"2023-07-28T13:37:56+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師SolidSuit專區爽爽貓 Song Song Meow By SECOND","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nba","device-iPhone 13 Mini","merge","reseller-nba"],"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":43102887149667,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0122852-PM43","requires_shipping":true,"taxable":true,"featured_image":{"id":30278901661795,"product_id":6984220278883,"position":1,"created_at":"2023-07-28T13:37:58+08:00","updated_at":"2023-07-28T13:37:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678","variant_ids":[43102887149667,43102887477347]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) NBA B\u0026W-費城76人 Philadelphia 76ers B\u0026W - Black \/ Classic","public_title":"Black \/ Classic","options":["Black","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0122852-PM43","featured_media":{"alt":null,"id":22637535330403,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102887477347,"title":"Seaweed Green \/ Classic","option1":"Seaweed Green","option2":"Classic","option3":null,"sku":"MST01228Z8-PM43","requires_shipping":true,"taxable":true,"featured_image":{"id":30278901661795,"product_id":6984220278883,"position":1,"created_at":"2023-07-28T13:37:58+08:00","updated_at":"2023-07-28T13:37:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678","variant_ids":[43102887149667,43102887477347]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) NBA B\u0026W-費城76人 Philadelphia 76ers B\u0026W - Seaweed Green \/ Classic","public_title":"Seaweed Green \/ Classic","options":["Seaweed Green","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01228Z8-PM43","featured_media":{"alt":null,"id":22637535330403,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54814a39c23ecfc6e6fca70ab909a60ba82b874a.webp?v=1782205154","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd549ea1a9cb1c3da4e3622d5d49b8e29b4f4388.webp?v=1782205154","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b716bbb092d0e28a028eec0c0ab49ecd6110aca3.webp?v=1782205155","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c114626182a7f1a382b81da05a4daa78f82650f.webp?v=1782205156","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54814a39c23ecfc6e6fca70ab909a60ba82b874a_616065f7-8656-4f82-8e66-e4d22795899c.webp?v=1782218435","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd549ea1a9cb1c3da4e3622d5d49b8e29b4f4388_9b262bfc-f718-4d4a-b19f-71fcb61e98dd.webp?v=1782218436","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b716bbb092d0e28a028eec0c0ab49ecd6110aca3_02e5f64a-6a17-417c-8b55-39d6dd6ffeec.webp?v=1782218437","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c114626182a7f1a382b81da05a4daa78f82650f_a5bb55b9-2cfa-4649-a145-288d1a00fa5d.webp?v=1782218437","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54814a39c23ecfc6e6fca70ab909a60ba82b874a_b10e1a55-2442-4247-8555-93d9210070ee.webp?v=1782218757","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd549ea1a9cb1c3da4e3622d5d49b8e29b4f4388_4cf64fec-6b66-49ba-a474-7f3ef6324807.webp?v=1782218758","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b716bbb092d0e28a028eec0c0ab49ecd6110aca3_a9cad95d-8271-41b4-b670-7ed2651a3f5d.webp?v=1782218758","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c114626182a7f1a382b81da05a4daa78f82650f_aece29cc-f133-40a9-83b5-c10968b48d6c.webp?v=1782218759","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54814a39c23ecfc6e6fca70ab909a60ba82b874a_701f3260-fce6-4406-af41-694f6cef5025.webp?v=1782219046","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd549ea1a9cb1c3da4e3622d5d49b8e29b4f4388_f6d75d8d-642a-41a0-a93e-6ced6a41e200.webp?v=1782219047","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b716bbb092d0e28a028eec0c0ab49ecd6110aca3_9ee8b3e1-dc9e-4994-87f3-cb3f1693f8c0.webp?v=1782219047","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c114626182a7f1a382b81da05a4daa78f82650f_71dad990-e929-460f-9c59-e374a40fb8f8.webp?v=1782219048"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678","options":["color","Types"],"media":[{"alt":null,"id":22637535330403,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678","width":2000},{"alt":null,"id":27575146643555,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54814a39c23ecfc6e6fca70ab909a60ba82b874a.webp?v=1782205154"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54814a39c23ecfc6e6fca70ab909a60ba82b874a.webp?v=1782205154","width":2000},{"alt":null,"id":27575146872931,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd549ea1a9cb1c3da4e3622d5d49b8e29b4f4388.webp?v=1782205154"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd549ea1a9cb1c3da4e3622d5d49b8e29b4f4388.webp?v=1782205154","width":2000},{"alt":null,"id":27575146971235,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b716bbb092d0e28a028eec0c0ab49ecd6110aca3.webp?v=1782205155"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b716bbb092d0e28a028eec0c0ab49ecd6110aca3.webp?v=1782205155","width":2000},{"alt":null,"id":27575147036771,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c114626182a7f1a382b81da05a4daa78f82650f.webp?v=1782205156"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c114626182a7f1a382b81da05a4daa78f82650f.webp?v=1782205156","width":2000},{"alt":null,"id":27581460676707,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54814a39c23ecfc6e6fca70ab909a60ba82b874a_616065f7-8656-4f82-8e66-e4d22795899c.webp?v=1782218435"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54814a39c23ecfc6e6fca70ab909a60ba82b874a_616065f7-8656-4f82-8e66-e4d22795899c.webp?v=1782218435","width":2000},{"alt":null,"id":27581461332067,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd549ea1a9cb1c3da4e3622d5d49b8e29b4f4388_9b262bfc-f718-4d4a-b19f-71fcb61e98dd.webp?v=1782218436"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd549ea1a9cb1c3da4e3622d5d49b8e29b4f4388_9b262bfc-f718-4d4a-b19f-71fcb61e98dd.webp?v=1782218436","width":2000},{"alt":null,"id":27581461594211,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b716bbb092d0e28a028eec0c0ab49ecd6110aca3_02e5f64a-6a17-417c-8b55-39d6dd6ffeec.webp?v=1782218437"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b716bbb092d0e28a028eec0c0ab49ecd6110aca3_02e5f64a-6a17-417c-8b55-39d6dd6ffeec.webp?v=1782218437","width":2000},{"alt":null,"id":27581462020195,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c114626182a7f1a382b81da05a4daa78f82650f_a5bb55b9-2cfa-4649-a145-288d1a00fa5d.webp?v=1782218437"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c114626182a7f1a382b81da05a4daa78f82650f_a5bb55b9-2cfa-4649-a145-288d1a00fa5d.webp?v=1782218437","width":2000},{"alt":null,"id":27581640278115,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54814a39c23ecfc6e6fca70ab909a60ba82b874a_b10e1a55-2442-4247-8555-93d9210070ee.webp?v=1782218757"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54814a39c23ecfc6e6fca70ab909a60ba82b874a_b10e1a55-2442-4247-8555-93d9210070ee.webp?v=1782218757","width":2000},{"alt":null,"id":27581640736867,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd549ea1a9cb1c3da4e3622d5d49b8e29b4f4388_4cf64fec-6b66-49ba-a474-7f3ef6324807.webp?v=1782218758"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd549ea1a9cb1c3da4e3622d5d49b8e29b4f4388_4cf64fec-6b66-49ba-a474-7f3ef6324807.webp?v=1782218758","width":2000},{"alt":null,"id":27581640933475,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b716bbb092d0e28a028eec0c0ab49ecd6110aca3_a9cad95d-8271-41b4-b670-7ed2651a3f5d.webp?v=1782218758"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b716bbb092d0e28a028eec0c0ab49ecd6110aca3_a9cad95d-8271-41b4-b670-7ed2651a3f5d.webp?v=1782218758","width":2000},{"alt":null,"id":27581641162851,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c114626182a7f1a382b81da05a4daa78f82650f_aece29cc-f133-40a9-83b5-c10968b48d6c.webp?v=1782218759"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c114626182a7f1a382b81da05a4daa78f82650f_aece29cc-f133-40a9-83b5-c10968b48d6c.webp?v=1782218759","width":2000},{"alt":null,"id":27581783867491,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54814a39c23ecfc6e6fca70ab909a60ba82b874a_701f3260-fce6-4406-af41-694f6cef5025.webp?v=1782219046"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54814a39c23ecfc6e6fca70ab909a60ba82b874a_701f3260-fce6-4406-af41-694f6cef5025.webp?v=1782219046","width":2000},{"alt":null,"id":27581784096867,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd549ea1a9cb1c3da4e3622d5d49b8e29b4f4388_f6d75d8d-642a-41a0-a93e-6ced6a41e200.webp?v=1782219047"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd549ea1a9cb1c3da4e3622d5d49b8e29b4f4388_f6d75d8d-642a-41a0-a93e-6ced6a41e200.webp?v=1782219047","width":2000},{"alt":null,"id":27581784588387,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b716bbb092d0e28a028eec0c0ab49ecd6110aca3_9ee8b3e1-dc9e-4994-87f3-cb3f1693f8c0.webp?v=1782219047"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b716bbb092d0e28a028eec0c0ab49ecd6110aca3_9ee8b3e1-dc9e-4994-87f3-cb3f1693f8c0.webp?v=1782219047","width":2000},{"alt":null,"id":27581784850531,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c114626182a7f1a382b81da05a4daa78f82650f_71dad990-e929-460f-9c59-e374a40fb8f8.webp?v=1782219048"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c114626182a7f1a382b81da05a4daa78f82650f_71dad990-e929-460f-9c59-e374a40fb8f8.webp?v=1782219048","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43102887149667,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0122852-PM43","requires_shipping":true,"taxable":true,"featured_image":{"id":30278901661795,"product_id":6984220278883,"position":1,"created_at":"2023-07-28T13:37:58+08:00","updated_at":"2023-07-28T13:37:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678","variant_ids":[43102887149667,43102887477347]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) NBA B\u0026W-費城76人 Philadelphia 76ers B\u0026W - Black \/ Classic","public_title":"Black \/ Classic","options":["Black","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0122852-PM43","featured_media":{"alt":null,"id":22637535330403,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102887477347,"title":"Seaweed Green \/ Classic","option1":"Seaweed Green","option2":"Classic","option3":null,"sku":"MST01228Z8-PM43","requires_shipping":true,"taxable":true,"featured_image":{"id":30278901661795,"product_id":6984220278883,"position":1,"created_at":"2023-07-28T13:37:58+08:00","updated_at":"2023-07-28T13:37:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678","variant_ids":[43102887149667,43102887477347]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) NBA B\u0026W-費城76人 Philadelphia 76ers B\u0026W - Seaweed Green \/ Classic","public_title":"Seaweed Green \/ Classic","options":["Seaweed Green","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01228Z8-PM43","featured_media":{"alt":null,"id":22637535330403,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43102887149667,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0122852-PM43","requires_shipping":true,"taxable":true,"featured_image":{"id":30278901661795,"product_id":6984220278883,"position":1,"created_at":"2023-07-28T13:37:58+08:00","updated_at":"2023-07-28T13:37:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678","variant_ids":[43102887149667,43102887477347]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) NBA B\u0026W-費城76人 Philadelphia 76ers B\u0026W - Black \/ Classic","public_title":"Black \/ Classic","options":["Black","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0122852-PM43","featured_media":{"alt":null,"id":22637535330403,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-PM43_8eaeffe3-ce6c-42a2-938a-d09788084a44.png?v=1690522678"}},"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: "停產" }