$product = {"id":7863508533347,"title":"iPhone 17 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers","handle":"iphone-17-pro-jellytint-magsafe-with-capture-button-pm10","description":null,"published_at":"2025-09-10T18:12:10+08:00","created_at":"2025-08-22T19:11:14+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nba","device-iPhone 17 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":43609210519651,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013520G-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152516051043,"product_id":7863508533347,"position":11,"created_at":"2026-07-02T12:24:31+08:00","updated_at":"2026-07-02T12:24:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_7ba382ff-9cbb-47b0-a288-db7ee6053dea.webp?v=1782966273","variant_ids":[43609210519651]},"available":true,"name":"iPhone 17 Pro 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":"MJB013520G-PM10","featured_media":{"alt":null,"id":27657389539427,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_7ba382ff-9cbb-47b0-a288-db7ee6053dea.webp?v=1782966273"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43609211404387,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"MJB013524M-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152516509795,"product_id":7863508533347,"position":12,"created_at":"2026-07-02T12:24:32+08:00","updated_at":"2026-07-02T12:24:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0_4f5a1a3e-67a9-4f80-a8f6-954930ae41fc.webp?v=1782966274","variant_ids":[43609211404387]},"available":true,"name":"iPhone 17 Pro 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":"MJB013524M-PM10","featured_media":{"alt":null,"id":27657389998179,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0_4f5a1a3e-67a9-4f80-a8f6-954930ae41fc.webp?v=1782966274"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43609211437155,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"MJB013524L-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152516903011,"product_id":7863508533347,"position":13,"created_at":"2026-07-02T12:24:32+08:00","updated_at":"2026-07-02T12:24:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc_135fee6e-1de6-4893-b068-6e25a081fa46.webp?v=1782966274","variant_ids":[43609211437155]},"available":true,"name":"iPhone 17 Pro 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":"MJB013524L-PM10","featured_media":{"alt":null,"id":27657390424163,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc_135fee6e-1de6-4893-b068-6e25a081fa46.webp?v=1782966274"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM10_43bd5262-ffe4-47ef-aaa4-6cbbb99d16b8.png?v=1755861077","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9.webp?v=1782213308","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc.webp?v=1782213309","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0.webp?v=1782213309","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_1010f1da-d776-4f99-9026-b18e3c3f1efe.webp?v=1782958606","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0_56095402-c389-45a5-9a48-1370f0d5e605.webp?v=1782958607","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc_e8461679-566b-4e08-8596-c13981631b84.webp?v=1782958608","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_2f44b2fc-5ae6-4d2d-912c-fc367a464a83.webp?v=1782961967","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0_bc42a48d-a474-4880-9c4a-ae6ec43ed656.webp?v=1782961970","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc_74771b80-e863-4d22-8fe0-d6a96ea3c401.webp?v=1782961973","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_7ba382ff-9cbb-47b0-a288-db7ee6053dea.webp?v=1782966273","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0_4f5a1a3e-67a9-4f80-a8f6-954930ae41fc.webp?v=1782966274","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc_135fee6e-1de6-4893-b068-6e25a081fa46.webp?v=1782966274"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM10_43bd5262-ffe4-47ef-aaa4-6cbbb99d16b8.png?v=1755861077","options":["color"],"media":[{"alt":null,"id":25941618458723,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM10_43bd5262-ffe4-47ef-aaa4-6cbbb99d16b8.png?v=1755861077"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM10_43bd5262-ffe4-47ef-aaa4-6cbbb99d16b8.png?v=1755861077","width":2000},{"alt":null,"id":27578448805987,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9.webp?v=1782213308"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9.webp?v=1782213308","width":2000},{"alt":null,"id":27578449199203,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc.webp?v=1782213309"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc.webp?v=1782213309","width":2000},{"alt":null,"id":27578449428579,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0.webp?v=1782213309"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0.webp?v=1782213309","width":2000},{"alt":null,"id":27656225947747,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_1010f1da-d776-4f99-9026-b18e3c3f1efe.webp?v=1782958606"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_1010f1da-d776-4f99-9026-b18e3c3f1efe.webp?v=1782958606","width":2000},{"alt":null,"id":27656226504803,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0_56095402-c389-45a5-9a48-1370f0d5e605.webp?v=1782958607"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0_56095402-c389-45a5-9a48-1370f0d5e605.webp?v=1782958607","width":2000},{"alt":null,"id":27656227815523,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc_e8461679-566b-4e08-8596-c13981631b84.webp?v=1782958608"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc_e8461679-566b-4e08-8596-c13981631b84.webp?v=1782958608","width":2000},{"alt":null,"id":27656893988963,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_2f44b2fc-5ae6-4d2d-912c-fc367a464a83.webp?v=1782961967"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_2f44b2fc-5ae6-4d2d-912c-fc367a464a83.webp?v=1782961967","width":2000},{"alt":null,"id":27656895201379,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0_bc42a48d-a474-4880-9c4a-ae6ec43ed656.webp?v=1782961970"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0_bc42a48d-a474-4880-9c4a-ae6ec43ed656.webp?v=1782961970","width":2000},{"alt":null,"id":27656896184419,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc_74771b80-e863-4d22-8fe0-d6a96ea3c401.webp?v=1782961973"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc_74771b80-e863-4d22-8fe0-d6a96ea3c401.webp?v=1782961973","width":2000},{"alt":null,"id":27657389539427,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_7ba382ff-9cbb-47b0-a288-db7ee6053dea.webp?v=1782966273"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_7ba382ff-9cbb-47b0-a288-db7ee6053dea.webp?v=1782966273","width":2000},{"alt":null,"id":27657389998179,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0_4f5a1a3e-67a9-4f80-a8f6-954930ae41fc.webp?v=1782966274"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0_4f5a1a3e-67a9-4f80-a8f6-954930ae41fc.webp?v=1782966274","width":2000},{"alt":null,"id":27657390424163,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc_135fee6e-1de6-4893-b068-6e25a081fa46.webp?v=1782966274"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc_135fee6e-1de6-4893-b068-6e25a081fa46.webp?v=1782966274","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43609210519651,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013520G-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152516051043,"product_id":7863508533347,"position":11,"created_at":"2026-07-02T12:24:31+08:00","updated_at":"2026-07-02T12:24:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_7ba382ff-9cbb-47b0-a288-db7ee6053dea.webp?v=1782966273","variant_ids":[43609210519651]},"available":true,"name":"iPhone 17 Pro 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":"MJB013520G-PM10","featured_media":{"alt":null,"id":27657389539427,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_7ba382ff-9cbb-47b0-a288-db7ee6053dea.webp?v=1782966273"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43609211404387,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"MJB013524M-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152516509795,"product_id":7863508533347,"position":12,"created_at":"2026-07-02T12:24:32+08:00","updated_at":"2026-07-02T12:24:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0_4f5a1a3e-67a9-4f80-a8f6-954930ae41fc.webp?v=1782966274","variant_ids":[43609211404387]},"available":true,"name":"iPhone 17 Pro 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":"MJB013524M-PM10","featured_media":{"alt":null,"id":27657389998179,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ff59f1d01ff93578ff7ba359167959fb3be8ec0_4f5a1a3e-67a9-4f80-a8f6-954930ae41fc.webp?v=1782966274"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43609211437155,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"MJB013524L-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152516903011,"product_id":7863508533347,"position":13,"created_at":"2026-07-02T12:24:32+08:00","updated_at":"2026-07-02T12:24:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc_135fee6e-1de6-4893-b068-6e25a081fa46.webp?v=1782966274","variant_ids":[43609211437155]},"available":true,"name":"iPhone 17 Pro 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":"MJB013524L-PM10","featured_media":{"alt":null,"id":27657390424163,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/563ee1f7aa1c423fe4b0d0e4f2e3d1c415afd3cc_135fee6e-1de6-4893-b068-6e25a081fa46.webp?v=1782966274"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43609210519651,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013520G-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152516051043,"product_id":7863508533347,"position":11,"created_at":"2026-07-02T12:24:31+08:00","updated_at":"2026-07-02T12:24:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_7ba382ff-9cbb-47b0-a288-db7ee6053dea.webp?v=1782966273","variant_ids":[43609210519651]},"available":true,"name":"iPhone 17 Pro 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":"MJB013520G-PM10","featured_media":{"alt":null,"id":27657389539427,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdda60518d6424bb6d0af922a8c03ca4b9077db9_7ba382ff-9cbb-47b0-a288-db7ee6053dea.webp?v=1782966273"}},"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: "停產" }