$product = {"id":7919965405283,"title":"iPhone 13 Pro Max Mod NX Incrediville 怪奇事物所 所長的星際迷航","handle":"iphone-13-pro-max-mod-nx-hd71","description":null,"published_at":"2025-11-13T10:05:24+08:00","created_at":"2025-11-10T09:54:11+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-incrediville","device-iPhone 13 Pro Max","merge","reseller-incrediville"],"price":90000,"price_min":90000,"price_max":90000,"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":43827552714851,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01232J5-HD71","requires_shipping":true,"taxable":true,"featured_image":{"id":34786298527843,"product_id":7919965405283,"position":17,"created_at":"2025-11-11T09:52:05+08:00","updated_at":"2025-11-11T09:52:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8ce3d455e7a70c7bd0f6faf18682b8fbc2300a4_d2cd1ec2-8c4e-4b14-8599-25c535e2942b.webp?v=1762825927","variant_ids":[43827552714851]},"available":true,"name":"iPhone 13 Pro Max Mod NX Incrediville 怪奇事物所 所長的星際迷航 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01232J5-HD71","featured_media":{"alt":null,"id":26351755460707,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8ce3d455e7a70c7bd0f6faf18682b8fbc2300a4_d2cd1ec2-8c4e-4b14-8599-25c535e2942b.webp?v=1762825927"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43827552780387,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0123224-HD71","requires_shipping":true,"taxable":true,"featured_image":{"id":34786297643107,"product_id":7919965405283,"position":14,"created_at":"2025-11-11T09:52:02+08:00","updated_at":"2025-11-11T09:52:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d4ba4433351e88512928f6b3fb69c7ca635df62d_76795583-cac8-4aef-b9b7-efe60c3b76f8.webp?v=1762825925","variant_ids":[43827552780387]},"available":true,"name":"iPhone 13 Pro Max Mod NX Incrediville 怪奇事物所 所長的星際迷航 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0123224-HD71","featured_media":{"alt":null,"id":26351754575971,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d4ba4433351e88512928f6b3fb69c7ca635df62d_76795583-cac8-4aef-b9b7-efe60c3b76f8.webp?v=1762825925"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fba979df8e06c0b3c51e8859f841b82ac0889b5b.webp?v=1762739657","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34b5e6ac9366f701fc3cfd3816470a11f948e475.webp?v=1762739658","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d4ba4433351e88512928f6b3fb69c7ca635df62d.webp?v=1762739659","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e083f507ce837054f4aba49a0d77ceb7766f1ef9.webp?v=1762739659","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8ce3d455e7a70c7bd0f6faf18682b8fbc2300a4.webp?v=1762739660","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d3be2170f2173c7a7353b56e781c60dc584a58f.webp?v=1762739661","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/743455b02a8e82656d7325308bc512bbc923a1cc.webp?v=1762739662","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/073fc31818a16e094be171941935fd765cfff381.webp?v=1762739662","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/add06193beb0ab3cafd2e3e18bf1709250f078b3.webp?v=1762739663","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/743455b02a8e82656d7325308bc512bbc923a1cc_328f4308-4e00-44f9-8941-8420a834b1b5.webp?v=1762825922","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/073fc31818a16e094be171941935fd765cfff381_cc61a19b-8225-469f-a17f-45e75064fb16.webp?v=1762825922","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e083f507ce837054f4aba49a0d77ceb7766f1ef9_43d097a2-e65e-45dd-9f6b-9196f34fe5b2.webp?v=1762825923","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34b5e6ac9366f701fc3cfd3816470a11f948e475_5ae3202e-af28-4ecd-86a6-5df3c99109aa.webp?v=1762825924","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d4ba4433351e88512928f6b3fb69c7ca635df62d_76795583-cac8-4aef-b9b7-efe60c3b76f8.webp?v=1762825925","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/add06193beb0ab3cafd2e3e18bf1709250f078b3_225b3f78-e01b-41e7-b81b-4bef36739d73.webp?v=1762825925","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fba979df8e06c0b3c51e8859f841b82ac0889b5b_70d27d73-6fe9-4215-9e74-321bfb3bb7ad.webp?v=1762825927","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8ce3d455e7a70c7bd0f6faf18682b8fbc2300a4_d2cd1ec2-8c4e-4b14-8599-25c535e2942b.webp?v=1762825927","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d3be2170f2173c7a7353b56e781c60dc584a58f_aac6fb59-242d-4617-83ee-5267e59139c2.webp?v=1762825928"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fba979df8e06c0b3c51e8859f841b82ac0889b5b.webp?v=1762739657","options":["color"],"media":[{"alt":null,"id":26345460695139,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fba979df8e06c0b3c51e8859f841b82ac0889b5b.webp?v=1762739657"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fba979df8e06c0b3c51e8859f841b82ac0889b5b.webp?v=1762739657","width":2000},{"alt":null,"id":26345460793443,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34b5e6ac9366f701fc3cfd3816470a11f948e475.webp?v=1762739658"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34b5e6ac9366f701fc3cfd3816470a11f948e475.webp?v=1762739658","width":2000},{"alt":null,"id":26345461022819,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d4ba4433351e88512928f6b3fb69c7ca635df62d.webp?v=1762739659"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d4ba4433351e88512928f6b3fb69c7ca635df62d.webp?v=1762739659","width":2000},{"alt":null,"id":26345461153891,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e083f507ce837054f4aba49a0d77ceb7766f1ef9.webp?v=1762739659"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e083f507ce837054f4aba49a0d77ceb7766f1ef9.webp?v=1762739659","width":2000},{"alt":null,"id":26345461350499,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8ce3d455e7a70c7bd0f6faf18682b8fbc2300a4.webp?v=1762739660"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8ce3d455e7a70c7bd0f6faf18682b8fbc2300a4.webp?v=1762739660","width":2000},{"alt":null,"id":26345461547107,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d3be2170f2173c7a7353b56e781c60dc584a58f.webp?v=1762739661"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d3be2170f2173c7a7353b56e781c60dc584a58f.webp?v=1762739661","width":2000},{"alt":null,"id":26345461710947,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/743455b02a8e82656d7325308bc512bbc923a1cc.webp?v=1762739662"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/743455b02a8e82656d7325308bc512bbc923a1cc.webp?v=1762739662","width":2000},{"alt":null,"id":26345462071395,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/073fc31818a16e094be171941935fd765cfff381.webp?v=1762739662"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/073fc31818a16e094be171941935fd765cfff381.webp?v=1762739662","width":2000},{"alt":null,"id":26345462268003,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/add06193beb0ab3cafd2e3e18bf1709250f078b3.webp?v=1762739663"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/add06193beb0ab3cafd2e3e18bf1709250f078b3.webp?v=1762739663","width":2000},{"alt":null,"id":26351753658467,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/743455b02a8e82656d7325308bc512bbc923a1cc_328f4308-4e00-44f9-8941-8420a834b1b5.webp?v=1762825922"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/743455b02a8e82656d7325308bc512bbc923a1cc_328f4308-4e00-44f9-8941-8420a834b1b5.webp?v=1762825922","width":2000},{"alt":null,"id":26351753789539,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/073fc31818a16e094be171941935fd765cfff381_cc61a19b-8225-469f-a17f-45e75064fb16.webp?v=1762825922"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/073fc31818a16e094be171941935fd765cfff381_cc61a19b-8225-469f-a17f-45e75064fb16.webp?v=1762825922","width":2000},{"alt":null,"id":26351753986147,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e083f507ce837054f4aba49a0d77ceb7766f1ef9_43d097a2-e65e-45dd-9f6b-9196f34fe5b2.webp?v=1762825923"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e083f507ce837054f4aba49a0d77ceb7766f1ef9_43d097a2-e65e-45dd-9f6b-9196f34fe5b2.webp?v=1762825923","width":2000},{"alt":null,"id":26351754281059,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34b5e6ac9366f701fc3cfd3816470a11f948e475_5ae3202e-af28-4ecd-86a6-5df3c99109aa.webp?v=1762825924"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34b5e6ac9366f701fc3cfd3816470a11f948e475_5ae3202e-af28-4ecd-86a6-5df3c99109aa.webp?v=1762825924","width":2000},{"alt":null,"id":26351754575971,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d4ba4433351e88512928f6b3fb69c7ca635df62d_76795583-cac8-4aef-b9b7-efe60c3b76f8.webp?v=1762825925"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d4ba4433351e88512928f6b3fb69c7ca635df62d_76795583-cac8-4aef-b9b7-efe60c3b76f8.webp?v=1762825925","width":2000},{"alt":null,"id":26351754739811,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/add06193beb0ab3cafd2e3e18bf1709250f078b3_225b3f78-e01b-41e7-b81b-4bef36739d73.webp?v=1762825925"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/add06193beb0ab3cafd2e3e18bf1709250f078b3_225b3f78-e01b-41e7-b81b-4bef36739d73.webp?v=1762825925","width":2000},{"alt":null,"id":26351755264099,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fba979df8e06c0b3c51e8859f841b82ac0889b5b_70d27d73-6fe9-4215-9e74-321bfb3bb7ad.webp?v=1762825927"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fba979df8e06c0b3c51e8859f841b82ac0889b5b_70d27d73-6fe9-4215-9e74-321bfb3bb7ad.webp?v=1762825927","width":2000},{"alt":null,"id":26351755460707,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8ce3d455e7a70c7bd0f6faf18682b8fbc2300a4_d2cd1ec2-8c4e-4b14-8599-25c535e2942b.webp?v=1762825927"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8ce3d455e7a70c7bd0f6faf18682b8fbc2300a4_d2cd1ec2-8c4e-4b14-8599-25c535e2942b.webp?v=1762825927","width":2000},{"alt":null,"id":26351755821155,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d3be2170f2173c7a7353b56e781c60dc584a58f_aac6fb59-242d-4617-83ee-5267e59139c2.webp?v=1762825928"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d3be2170f2173c7a7353b56e781c60dc584a58f_aac6fb59-242d-4617-83ee-5267e59139c2.webp?v=1762825928","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":43827552714851,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01232J5-HD71","requires_shipping":true,"taxable":true,"featured_image":{"id":34786298527843,"product_id":7919965405283,"position":17,"created_at":"2025-11-11T09:52:05+08:00","updated_at":"2025-11-11T09:52:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8ce3d455e7a70c7bd0f6faf18682b8fbc2300a4_d2cd1ec2-8c4e-4b14-8599-25c535e2942b.webp?v=1762825927","variant_ids":[43827552714851]},"available":true,"name":"iPhone 13 Pro Max Mod NX Incrediville 怪奇事物所 所長的星際迷航 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01232J5-HD71","featured_media":{"alt":null,"id":26351755460707,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8ce3d455e7a70c7bd0f6faf18682b8fbc2300a4_d2cd1ec2-8c4e-4b14-8599-25c535e2942b.webp?v=1762825927"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43827552780387,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0123224-HD71","requires_shipping":true,"taxable":true,"featured_image":{"id":34786297643107,"product_id":7919965405283,"position":14,"created_at":"2025-11-11T09:52:02+08:00","updated_at":"2025-11-11T09:52:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d4ba4433351e88512928f6b3fb69c7ca635df62d_76795583-cac8-4aef-b9b7-efe60c3b76f8.webp?v=1762825925","variant_ids":[43827552780387]},"available":true,"name":"iPhone 13 Pro Max Mod NX Incrediville 怪奇事物所 所長的星際迷航 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0123224-HD71","featured_media":{"alt":null,"id":26351754575971,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d4ba4433351e88512928f6b3fb69c7ca635df62d_76795583-cac8-4aef-b9b7-efe60c3b76f8.webp?v=1762825925"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43827552714851,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01232J5-HD71","requires_shipping":true,"taxable":true,"featured_image":{"id":34786298527843,"product_id":7919965405283,"position":17,"created_at":"2025-11-11T09:52:05+08:00","updated_at":"2025-11-11T09:52:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8ce3d455e7a70c7bd0f6faf18682b8fbc2300a4_d2cd1ec2-8c4e-4b14-8599-25c535e2942b.webp?v=1762825927","variant_ids":[43827552714851]},"available":true,"name":"iPhone 13 Pro Max Mod NX Incrediville 怪奇事物所 所長的星際迷航 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01232J5-HD71","featured_media":{"alt":null,"id":26351755460707,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8ce3d455e7a70c7bd0f6faf18682b8fbc2300a4_d2cd1ec2-8c4e-4b14-8599-25c535e2942b.webp?v=1762825927"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}; $device_handle = null var sellingStatus if ($bumper) { $(document).ready(function() { var productImg = $product.images[0] var bumperVariants = $bumper.variants; var bumperColors = new Object(); var currentVariant = ''; var productType = ''; bumperVariants.forEach(variant => { bumperColors[`${variant.title.split(' (')[0].toLowerCase()}`] = variant.featured_image.src; }); if (productType === 'mod-nx-backplate' || productType === 'mod-backplate') { mergeImages( [productImg, bumperColors[currentVariant]], { crossOrigin: 'anonymous' } ).then(mergedImg => { $('.merged-img').attr('src', mergedImg); }); } else { mergeImages( [bumperColors[currentVariant], productImg], { crossOrigin: 'anonymous' } ).then(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: "停產" }