$product = {"id":7729493737571,"title":"iPhone 16 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light","handle":"iphone-16-pro-jellytint-magsafe-with-capture-button-pm03","description":null,"published_at":"2025-02-06T00:25:21+08:00","created_at":"2025-02-05T19:00:25+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nba","device-iPhone 16 Pro","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":43159732912227,"title":"Moody Green","option1":"Moody Green","option2":null,"option3":null,"sku":"MJB013270H-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152463229027,"product_id":7729493737571,"position":13,"created_at":"2026-07-02T12:21:59+08:00","updated_at":"2026-07-02T12:22:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_a4ea819a-d179-4b93-9145-ae801ed75ff0.webp?v=1782966121","variant_ids":[43159732912227]},"available":true,"name":"iPhone 16 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - Moody Green","public_title":"Moody Green","options":["Moody Green"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013270H-PM03","featured_media":{"alt":null,"id":27657336717411,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_a4ea819a-d179-4b93-9145-ae801ed75ff0.webp?v=1782966121"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43159732944995,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"MJB013270J-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152462868579,"product_id":7729493737571,"position":11,"created_at":"2026-07-02T12:21:58+08:00","updated_at":"2026-07-02T12:22:00+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334_7232a65c-380e-4dfd-8cd8-53e55d78d66a.webp?v=1782966120","variant_ids":[43159732944995]},"available":true,"name":"iPhone 16 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013270J-PM03","featured_media":{"alt":null,"id":27657336324195,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334_7232a65c-380e-4dfd-8cd8-53e55d78d66a.webp?v=1782966120"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43159732977763,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013270G-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152463032419,"product_id":7729493737571,"position":12,"created_at":"2026-07-02T12:21:59+08:00","updated_at":"2026-07-02T12:22:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead_4f21c023-b913-4047-9250-128f1866af99.webp?v=1782966121","variant_ids":[43159732977763]},"available":true,"name":"iPhone 16 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - 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":"MJB013270G-PM03","featured_media":{"alt":null,"id":27657336520803,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead_4f21c023-b913-4047-9250-128f1866af99.webp?v=1782966121"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-327-PM03_ab17041a-9a3b-44a0-8893-22d38d510b69.png?v=1738753228","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334.webp?v=1782211178","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077.webp?v=1782211179","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead.webp?v=1782211179","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334_54777897-8710-453e-9a68-c08116cb3859.webp?v=1782958342","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead_be2e7f5a-5a93-4715-ad4a-4eebb6a55ddc.webp?v=1782958343","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_a70145fb-97c0-4197-b9ad-47852e40b95e.webp?v=1782958346","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334_77fb3c12-a2f0-4f5e-b643-fbc7f66acee3.webp?v=1782961667","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead_f11a5b2e-2fa4-4d6b-b279-2cb89d20d162.webp?v=1782961668","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_0d4bf884-261c-482e-8c3b-a353dbe9b155.webp?v=1782961669","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334_7232a65c-380e-4dfd-8cd8-53e55d78d66a.webp?v=1782966120","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead_4f21c023-b913-4047-9250-128f1866af99.webp?v=1782966121","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_a4ea819a-d179-4b93-9145-ae801ed75ff0.webp?v=1782966121"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-327-PM03_ab17041a-9a3b-44a0-8893-22d38d510b69.png?v=1738753228","options":["color"],"media":[{"alt":null,"id":25256457994339,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-327-PM03_ab17041a-9a3b-44a0-8893-22d38d510b69.png?v=1738753228"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-327-PM03_ab17041a-9a3b-44a0-8893-22d38d510b69.png?v=1738753228","width":2000},{"alt":null,"id":27577465602147,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334.webp?v=1782211178"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334.webp?v=1782211178","width":2000},{"alt":null,"id":27577466421347,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077.webp?v=1782211179"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077.webp?v=1782211179","width":2000},{"alt":null,"id":27577466781795,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead.webp?v=1782211179"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead.webp?v=1782211179","width":2000},{"alt":null,"id":27656139210851,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334_54777897-8710-453e-9a68-c08116cb3859.webp?v=1782958342"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334_54777897-8710-453e-9a68-c08116cb3859.webp?v=1782958342","width":2000},{"alt":null,"id":27656139407459,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead_be2e7f5a-5a93-4715-ad4a-4eebb6a55ddc.webp?v=1782958343"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead_be2e7f5a-5a93-4715-ad4a-4eebb6a55ddc.webp?v=1782958343","width":2000},{"alt":null,"id":27656139735139,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_a70145fb-97c0-4197-b9ad-47852e40b95e.webp?v=1782958346"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_a70145fb-97c0-4197-b9ad-47852e40b95e.webp?v=1782958346","width":2000},{"alt":null,"id":27656836546659,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334_77fb3c12-a2f0-4f5e-b643-fbc7f66acee3.webp?v=1782961667"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334_77fb3c12-a2f0-4f5e-b643-fbc7f66acee3.webp?v=1782961667","width":2000},{"alt":null,"id":27656836841571,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead_f11a5b2e-2fa4-4d6b-b279-2cb89d20d162.webp?v=1782961668"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead_f11a5b2e-2fa4-4d6b-b279-2cb89d20d162.webp?v=1782961668","width":2000},{"alt":null,"id":27656837791843,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_0d4bf884-261c-482e-8c3b-a353dbe9b155.webp?v=1782961669"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_0d4bf884-261c-482e-8c3b-a353dbe9b155.webp?v=1782961669","width":2000},{"alt":null,"id":27657336324195,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334_7232a65c-380e-4dfd-8cd8-53e55d78d66a.webp?v=1782966120"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334_7232a65c-380e-4dfd-8cd8-53e55d78d66a.webp?v=1782966120","width":2000},{"alt":null,"id":27657336520803,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead_4f21c023-b913-4047-9250-128f1866af99.webp?v=1782966121"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead_4f21c023-b913-4047-9250-128f1866af99.webp?v=1782966121","width":2000},{"alt":null,"id":27657336717411,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_a4ea819a-d179-4b93-9145-ae801ed75ff0.webp?v=1782966121"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_a4ea819a-d179-4b93-9145-ae801ed75ff0.webp?v=1782966121","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43159732912227,"title":"Moody Green","option1":"Moody Green","option2":null,"option3":null,"sku":"MJB013270H-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152463229027,"product_id":7729493737571,"position":13,"created_at":"2026-07-02T12:21:59+08:00","updated_at":"2026-07-02T12:22:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_a4ea819a-d179-4b93-9145-ae801ed75ff0.webp?v=1782966121","variant_ids":[43159732912227]},"available":true,"name":"iPhone 16 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - Moody Green","public_title":"Moody Green","options":["Moody Green"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013270H-PM03","featured_media":{"alt":null,"id":27657336717411,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_a4ea819a-d179-4b93-9145-ae801ed75ff0.webp?v=1782966121"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43159732944995,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"MJB013270J-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152462868579,"product_id":7729493737571,"position":11,"created_at":"2026-07-02T12:21:58+08:00","updated_at":"2026-07-02T12:22:00+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334_7232a65c-380e-4dfd-8cd8-53e55d78d66a.webp?v=1782966120","variant_ids":[43159732944995]},"available":true,"name":"iPhone 16 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013270J-PM03","featured_media":{"alt":null,"id":27657336324195,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d34b3e55b1762b4917a5ffbbebf62ce48015b334_7232a65c-380e-4dfd-8cd8-53e55d78d66a.webp?v=1782966120"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43159732977763,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013270G-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152463032419,"product_id":7729493737571,"position":12,"created_at":"2026-07-02T12:21:59+08:00","updated_at":"2026-07-02T12:22:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead_4f21c023-b913-4047-9250-128f1866af99.webp?v=1782966121","variant_ids":[43159732977763]},"available":true,"name":"iPhone 16 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - 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":"MJB013270G-PM03","featured_media":{"alt":null,"id":27657336520803,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c6bc7422dc90f8cfa3589d1f0ba7a3bdb5376ead_4f21c023-b913-4047-9250-128f1866af99.webp?v=1782966121"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43159732912227,"title":"Moody Green","option1":"Moody Green","option2":null,"option3":null,"sku":"MJB013270H-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152463229027,"product_id":7729493737571,"position":13,"created_at":"2026-07-02T12:21:59+08:00","updated_at":"2026-07-02T12:22:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_a4ea819a-d179-4b93-9145-ae801ed75ff0.webp?v=1782966121","variant_ids":[43159732912227]},"available":true,"name":"iPhone 16 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - Moody Green","public_title":"Moody Green","options":["Moody Green"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013270H-PM03","featured_media":{"alt":null,"id":27657336717411,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9037d80f638d0ffd98290fce2fd4a2ff248d077_a4ea819a-d179-4b93-9145-ae801ed75ff0.webp?v=1782966121"}},"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: "停產" }