$product = {"id":7863145234531,"title":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers","handle":"iphone-air-jellytint-magsafe-with-capture-button-pm10","description":null,"published_at":"2025-09-10T19:22:12+08:00","created_at":"2025-08-22T18:30:37+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nba","device-iPhone Air","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":43608130158691,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013510G-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152575164515,"product_id":7863145234531,"position":11,"created_at":"2026-07-02T12:27:29+08:00","updated_at":"2026-07-02T12:27:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_1fba322e-aedd-4592-8086-8edc08442ff6.webp?v=1782966450","variant_ids":[43608130158691]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013510G-PM10","featured_media":{"alt":null,"id":27657448652899,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_1fba322e-aedd-4592-8086-8edc08442ff6.webp?v=1782966450"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43608131207267,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"MJB013514M-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152575459427,"product_id":7863145234531,"position":12,"created_at":"2026-07-02T12:27:29+08:00","updated_at":"2026-07-02T12:27:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f_d61478cf-a906-4053-9154-b2e415965ef6.webp?v=1782966451","variant_ids":[43608131207267]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Nocturne Blue","public_title":"Nocturne Blue","options":["Nocturne Blue"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013514M-PM10","featured_media":{"alt":null,"id":27657448947811,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f_d61478cf-a906-4053-9154-b2e415965ef6.webp?v=1782966451"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43608131240035,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"MJB013514L-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152575688803,"product_id":7863145234531,"position":13,"created_at":"2026-07-02T12:27:30+08:00","updated_at":"2026-07-02T12:27:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f_14c8b872-f3af-4988-9d83-724b415198b7.webp?v=1782966452","variant_ids":[43608131240035]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Gleam Rosé","public_title":"Gleam Rosé","options":["Gleam Rosé"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013514L-PM10","featured_media":{"alt":null,"id":27657449209955,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f_14c8b872-f3af-4988-9d83-724b415198b7.webp?v=1782966452"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-351-PM10_83094d0b-a250-4cd0-ab17-6d7c448e8512.png?v=1755858640","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f.webp?v=1782215301","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f.webp?v=1782215302","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783.webp?v=1782215303","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_768aa8ac-a328-4356-98e5-b7166579a1ac.webp?v=1782958868","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f_55d12e83-93b0-41b9-bf36-f8642415d5c2.webp?v=1782958868","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f_2e8fa4df-1937-4950-ae6b-277ce18adcc4.webp?v=1782958869","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_d1047b3c-7ba5-4e9b-8d62-6a5c5d2c92bd.webp?v=1782962206","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f_f07e3b2a-cd7a-4652-8b49-a11fd6d17f07.webp?v=1782962211","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f_e92a91ff-ee32-489d-a2c0-2f4119822b55.webp?v=1782962213","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_1fba322e-aedd-4592-8086-8edc08442ff6.webp?v=1782966450","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f_d61478cf-a906-4053-9154-b2e415965ef6.webp?v=1782966451","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f_14c8b872-f3af-4988-9d83-724b415198b7.webp?v=1782966452"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-351-PM10_83094d0b-a250-4cd0-ab17-6d7c448e8512.png?v=1755858640","options":["color"],"media":[{"alt":null,"id":25941079720035,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-351-PM10_83094d0b-a250-4cd0-ab17-6d7c448e8512.png?v=1755858640"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-351-PM10_83094d0b-a250-4cd0-ab17-6d7c448e8512.png?v=1755858640","width":2000},{"alt":null,"id":27580161622115,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f.webp?v=1782215301"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f.webp?v=1782215301","width":2000},{"alt":null,"id":27580162146403,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f.webp?v=1782215302"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f.webp?v=1782215302","width":2000},{"alt":null,"id":27580162768995,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783.webp?v=1782215303"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783.webp?v=1782215303","width":2000},{"alt":null,"id":27656330903651,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_768aa8ac-a328-4356-98e5-b7166579a1ac.webp?v=1782958868"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_768aa8ac-a328-4356-98e5-b7166579a1ac.webp?v=1782958868","width":2000},{"alt":null,"id":27656331296867,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f_55d12e83-93b0-41b9-bf36-f8642415d5c2.webp?v=1782958868"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f_55d12e83-93b0-41b9-bf36-f8642415d5c2.webp?v=1782958868","width":2000},{"alt":null,"id":27656332148835,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f_2e8fa4df-1937-4950-ae6b-277ce18adcc4.webp?v=1782958869"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f_2e8fa4df-1937-4950-ae6b-277ce18adcc4.webp?v=1782958869","width":2000},{"alt":null,"id":27656946253923,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_d1047b3c-7ba5-4e9b-8d62-6a5c5d2c92bd.webp?v=1782962206"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_d1047b3c-7ba5-4e9b-8d62-6a5c5d2c92bd.webp?v=1782962206","width":2000},{"alt":null,"id":27656946745443,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f_f07e3b2a-cd7a-4652-8b49-a11fd6d17f07.webp?v=1782962211"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f_f07e3b2a-cd7a-4652-8b49-a11fd6d17f07.webp?v=1782962211","width":2000},{"alt":null,"id":27656947302499,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f_e92a91ff-ee32-489d-a2c0-2f4119822b55.webp?v=1782962213"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f_e92a91ff-ee32-489d-a2c0-2f4119822b55.webp?v=1782962213","width":2000},{"alt":null,"id":27657448652899,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_1fba322e-aedd-4592-8086-8edc08442ff6.webp?v=1782966450"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_1fba322e-aedd-4592-8086-8edc08442ff6.webp?v=1782966450","width":2000},{"alt":null,"id":27657448947811,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f_d61478cf-a906-4053-9154-b2e415965ef6.webp?v=1782966451"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f_d61478cf-a906-4053-9154-b2e415965ef6.webp?v=1782966451","width":2000},{"alt":null,"id":27657449209955,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f_14c8b872-f3af-4988-9d83-724b415198b7.webp?v=1782966452"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f_14c8b872-f3af-4988-9d83-724b415198b7.webp?v=1782966452","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43608130158691,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013510G-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152575164515,"product_id":7863145234531,"position":11,"created_at":"2026-07-02T12:27:29+08:00","updated_at":"2026-07-02T12:27:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_1fba322e-aedd-4592-8086-8edc08442ff6.webp?v=1782966450","variant_ids":[43608130158691]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013510G-PM10","featured_media":{"alt":null,"id":27657448652899,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_1fba322e-aedd-4592-8086-8edc08442ff6.webp?v=1782966450"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43608131207267,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"MJB013514M-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152575459427,"product_id":7863145234531,"position":12,"created_at":"2026-07-02T12:27:29+08:00","updated_at":"2026-07-02T12:27:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f_d61478cf-a906-4053-9154-b2e415965ef6.webp?v=1782966451","variant_ids":[43608131207267]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Nocturne Blue","public_title":"Nocturne Blue","options":["Nocturne Blue"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013514M-PM10","featured_media":{"alt":null,"id":27657448947811,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7faf38c3370102d09c8a9d6739d811296d8f273f_d61478cf-a906-4053-9154-b2e415965ef6.webp?v=1782966451"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43608131240035,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"MJB013514L-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152575688803,"product_id":7863145234531,"position":13,"created_at":"2026-07-02T12:27:30+08:00","updated_at":"2026-07-02T12:27:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f_14c8b872-f3af-4988-9d83-724b415198b7.webp?v=1782966452","variant_ids":[43608131240035]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Gleam Rosé","public_title":"Gleam Rosé","options":["Gleam Rosé"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013514L-PM10","featured_media":{"alt":null,"id":27657449209955,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eae3d84ef4c1ffd8b48d2c968f21dfd07cde19f_14c8b872-f3af-4988-9d83-724b415198b7.webp?v=1782966452"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43608130158691,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013510G-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152575164515,"product_id":7863145234531,"position":11,"created_at":"2026-07-02T12:27:29+08:00","updated_at":"2026-07-02T12:27:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_1fba322e-aedd-4592-8086-8edc08442ff6.webp?v=1782966450","variant_ids":[43608130158691]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013510G-PM10","featured_media":{"alt":null,"id":27657448652899,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/898256b05ac4e1f66c3d1ec063299d6e9ab86783_1fba322e-aedd-4592-8086-8edc08442ff6.webp?v=1782966450"}},"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: "停產" }