$product = {"id":7920561684579,"title":"iPhone 15 Pro Max Clear 咒術迴戰 澀谷事變戰鬥系列-伏黑惠","handle":"iphone-15-pro-max-jellytint-ptt13","description":null,"published_at":"2025-11-10T16:31:01+08:00","created_at":"2025-11-10T15:10:49+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-jujutsu-kaisen","device-iPhone 15 Pro Max","merge","reseller-jujutsu-kaisen"],"price":128000,"price_min":128000,"price_max":128000,"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":43828990279779,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012980J-PTT13","requires_shipping":true,"taxable":true,"featured_image":{"id":36125180690531,"product_id":7920561684579,"position":11,"created_at":"2026-06-29T15:44:24+08:00","updated_at":"2026-06-29T15:44:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_404ff1bf-b13e-4149-b1d6-eeb0a6f6ec14.webp?v=1782719066","variant_ids":[43828990279779]},"available":true,"name":"iPhone 15 Pro Max Clear 咒術迴戰 澀谷事變戰鬥系列-伏黑惠 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980J-PTT13","featured_media":{"alt":null,"id":27630423474275,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_404ff1bf-b13e-4149-b1d6-eeb0a6f6ec14.webp?v=1782719066"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43828992639075,"title":"Cyber Blue","option1":"Cyber Blue","option2":null,"option3":null,"sku":"CCN012980I-PTT13","requires_shipping":true,"taxable":true,"featured_image":{"id":36125181444195,"product_id":7920561684579,"position":13,"created_at":"2026-06-29T15:44:26+08:00","updated_at":"2026-06-29T15:44:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4_cf132b04-c1e7-489e-937b-15795f773873.webp?v=1782719068","variant_ids":[43828992639075]},"available":true,"name":"iPhone 15 Pro Max Clear 咒術迴戰 澀谷事變戰鬥系列-伏黑惠 - Cyber Blue","public_title":"Cyber Blue","options":["Cyber Blue"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980I-PTT13","featured_media":{"alt":null,"id":27630424227939,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4_cf132b04-c1e7-489e-937b-15795f773873.webp?v=1782719068"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43828992671843,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012980G-PTT13","requires_shipping":true,"taxable":true,"featured_image":{"id":36125181050979,"product_id":7920561684579,"position":12,"created_at":"2026-06-29T15:44:25+08:00","updated_at":"2026-06-29T15:44:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9_88d21507-54ea-4220-b574-d6b0c2852ad1.webp?v=1782719067","variant_ids":[43828992671843]},"available":true,"name":"iPhone 15 Pro Max Clear 咒術迴戰 澀谷事變戰鬥系列-伏黑惠 - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980G-PTT13","featured_media":{"alt":null,"id":27630423867491,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9_88d21507-54ea-4220-b574-d6b0c2852ad1.webp?v=1782719067"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45e5522b49778c1c16cd1eba86d2a0bddbbfa343.webp?v=1762758656","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697.webp?v=1762758657","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4.webp?v=1762758657","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9.webp?v=1762758658","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_6be5bf00-bd39-4844-aaeb-fa4d9f309e9a.webp?v=1782266241","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9_d32dbb1a-4d99-438a-a87f-3b70106f95eb.webp?v=1782266241","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4_eeb900b6-87f3-4b2c-b3f9-f2a2d8086654.webp?v=1782266242","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_f1aa742c-f0f0-4f65-9ba4-ebe96ee08a36.webp?v=1782291783","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9_e48311e8-3bfd-4fe3-a95f-aecb27682dcd.webp?v=1782291784","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4_9b51b820-e452-421f-8c1d-283e966d1edc.webp?v=1782291785","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_404ff1bf-b13e-4149-b1d6-eeb0a6f6ec14.webp?v=1782719066","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9_88d21507-54ea-4220-b574-d6b0c2852ad1.webp?v=1782719067","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4_cf132b04-c1e7-489e-937b-15795f773873.webp?v=1782719068"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45e5522b49778c1c16cd1eba86d2a0bddbbfa343.webp?v=1762758656","options":["color"],"media":[{"alt":null,"id":26347893456995,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45e5522b49778c1c16cd1eba86d2a0bddbbfa343.webp?v=1762758656"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45e5522b49778c1c16cd1eba86d2a0bddbbfa343.webp?v=1762758656","width":2000},{"alt":null,"id":26347893620835,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697.webp?v=1762758657"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697.webp?v=1762758657","width":2000},{"alt":null,"id":26347893751907,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4.webp?v=1762758657"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4.webp?v=1762758657","width":2000},{"alt":null,"id":26347893948515,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9.webp?v=1762758658"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9.webp?v=1762758658","width":2000},{"alt":null,"id":27587452829795,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_6be5bf00-bd39-4844-aaeb-fa4d9f309e9a.webp?v=1782266241"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_6be5bf00-bd39-4844-aaeb-fa4d9f309e9a.webp?v=1782266241","width":2000},{"alt":null,"id":27587453026403,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9_d32dbb1a-4d99-438a-a87f-3b70106f95eb.webp?v=1782266241"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9_d32dbb1a-4d99-438a-a87f-3b70106f95eb.webp?v=1782266241","width":2000},{"alt":null,"id":27587453288547,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4_eeb900b6-87f3-4b2c-b3f9-f2a2d8086654.webp?v=1782266242"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4_eeb900b6-87f3-4b2c-b3f9-f2a2d8086654.webp?v=1782266242","width":2000},{"alt":null,"id":27594729226339,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_f1aa742c-f0f0-4f65-9ba4-ebe96ee08a36.webp?v=1782291783"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_f1aa742c-f0f0-4f65-9ba4-ebe96ee08a36.webp?v=1782291783","width":2000},{"alt":null,"id":27594729652323,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9_e48311e8-3bfd-4fe3-a95f-aecb27682dcd.webp?v=1782291784"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9_e48311e8-3bfd-4fe3-a95f-aecb27682dcd.webp?v=1782291784","width":2000},{"alt":null,"id":27594730111075,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4_9b51b820-e452-421f-8c1d-283e966d1edc.webp?v=1782291785"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4_9b51b820-e452-421f-8c1d-283e966d1edc.webp?v=1782291785","width":2000},{"alt":null,"id":27630423474275,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_404ff1bf-b13e-4149-b1d6-eeb0a6f6ec14.webp?v=1782719066"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_404ff1bf-b13e-4149-b1d6-eeb0a6f6ec14.webp?v=1782719066","width":2000},{"alt":null,"id":27630423867491,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9_88d21507-54ea-4220-b574-d6b0c2852ad1.webp?v=1782719067"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9_88d21507-54ea-4220-b574-d6b0c2852ad1.webp?v=1782719067","width":2000},{"alt":null,"id":27630424227939,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4_cf132b04-c1e7-489e-937b-15795f773873.webp?v=1782719068"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4_cf132b04-c1e7-489e-937b-15795f773873.webp?v=1782719068","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43828990279779,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012980J-PTT13","requires_shipping":true,"taxable":true,"featured_image":{"id":36125180690531,"product_id":7920561684579,"position":11,"created_at":"2026-06-29T15:44:24+08:00","updated_at":"2026-06-29T15:44:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_404ff1bf-b13e-4149-b1d6-eeb0a6f6ec14.webp?v=1782719066","variant_ids":[43828990279779]},"available":true,"name":"iPhone 15 Pro Max Clear 咒術迴戰 澀谷事變戰鬥系列-伏黑惠 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980J-PTT13","featured_media":{"alt":null,"id":27630423474275,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_404ff1bf-b13e-4149-b1d6-eeb0a6f6ec14.webp?v=1782719066"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43828992639075,"title":"Cyber Blue","option1":"Cyber Blue","option2":null,"option3":null,"sku":"CCN012980I-PTT13","requires_shipping":true,"taxable":true,"featured_image":{"id":36125181444195,"product_id":7920561684579,"position":13,"created_at":"2026-06-29T15:44:26+08:00","updated_at":"2026-06-29T15:44:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4_cf132b04-c1e7-489e-937b-15795f773873.webp?v=1782719068","variant_ids":[43828992639075]},"available":true,"name":"iPhone 15 Pro Max Clear 咒術迴戰 澀谷事變戰鬥系列-伏黑惠 - Cyber Blue","public_title":"Cyber Blue","options":["Cyber Blue"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980I-PTT13","featured_media":{"alt":null,"id":27630424227939,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13f7057948dd0a2fd059a5f10737889e1ccceeb4_cf132b04-c1e7-489e-937b-15795f773873.webp?v=1782719068"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43828992671843,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012980G-PTT13","requires_shipping":true,"taxable":true,"featured_image":{"id":36125181050979,"product_id":7920561684579,"position":12,"created_at":"2026-06-29T15:44:25+08:00","updated_at":"2026-06-29T15:44:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9_88d21507-54ea-4220-b574-d6b0c2852ad1.webp?v=1782719067","variant_ids":[43828992671843]},"available":true,"name":"iPhone 15 Pro Max Clear 咒術迴戰 澀谷事變戰鬥系列-伏黑惠 - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980G-PTT13","featured_media":{"alt":null,"id":27630423867491,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66eb3ee7b111df464b05f0ed05392bf17db9a3f9_88d21507-54ea-4220-b574-d6b0c2852ad1.webp?v=1782719067"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43828990279779,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012980J-PTT13","requires_shipping":true,"taxable":true,"featured_image":{"id":36125180690531,"product_id":7920561684579,"position":11,"created_at":"2026-06-29T15:44:24+08:00","updated_at":"2026-06-29T15:44:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_404ff1bf-b13e-4149-b1d6-eeb0a6f6ec14.webp?v=1782719066","variant_ids":[43828990279779]},"available":true,"name":"iPhone 15 Pro Max Clear 咒術迴戰 澀谷事變戰鬥系列-伏黑惠 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980J-PTT13","featured_media":{"alt":null,"id":27630423474275,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9cca3af2731991fcbaf1bd623696f0fcd088e697_404ff1bf-b13e-4149-b1d6-eeb0a6f6ec14.webp?v=1782719066"}},"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: "停產" }