$product = {"id":7769614680163,"title":"iPhone 14 Pro Mod NX ilovedoodle The Sun and Cat - 太陽與貓","handle":"iphone-14-pro-mod-nx-printable-xf52","description":null,"published_at":"2025-07-16T17:18:03+08:00","created_at":"2025-04-15T18:28:38+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師MOD NX專區-I Love Doodle","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-ilovedoodle","device-iPhone 14 Pro","merge","reseller-ilovedoodle"],"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":43303179190371,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197193162851,"product_id":7769614680163,"position":8,"created_at":"2025-07-16T15:00:33+08:00","updated_at":"2025-07-16T15:00:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee81fce5cafca6dc41ed7602a9f1874a51b52a9a_582242d4-7042-4adf-9447-8bc6fb984484.webp?v=1752649235","variant_ids":[43303179190371]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126224-XF52","featured_media":{"alt":null,"id":25829765677155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee81fce5cafca6dc41ed7602a9f1874a51b52a9a_582242d4-7042-4adf-9447-8bc6fb984484.webp?v=1752649235"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303184040035,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197191819363,"product_id":7769614680163,"position":2,"created_at":"2025-07-16T15:00:30+08:00","updated_at":"2025-07-16T15:00:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33abf2fdf67e421098da5206f39db9cd6a2b3aba_5ba555fc-4b09-4d1d-9d3a-16dd9c2e5618.webp?v=1752649232","variant_ids":[43303184040035]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126204-XF52","featured_media":{"alt":null,"id":25829764726883,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33abf2fdf67e421098da5206f39db9cd6a2b3aba_5ba555fc-4b09-4d1d-9d3a-16dd9c2e5618.webp?v=1752649232"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303184203875,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197192048739,"product_id":7769614680163,"position":3,"created_at":"2025-07-16T15:00:31+08:00","updated_at":"2025-07-16T15:00:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d708acb9f4d5c82ec2677764805c993941bbe1a_02c84bf3-db62-439d-809d-279e82adfe03.webp?v=1752649233","variant_ids":[43303184203875]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - 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":"NPB01262J5-XF52","featured_media":{"alt":null,"id":25829764825187,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d708acb9f4d5c82ec2677764805c993941bbe1a_02c84bf3-db62-439d-809d-279e82adfe03.webp?v=1752649233"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4efc1606dd9882be71f7382b6437279a69aaf063.webp?v=1744712925","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33abf2fdf67e421098da5206f39db9cd6a2b3aba_5ba555fc-4b09-4d1d-9d3a-16dd9c2e5618.webp?v=1752649232","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d708acb9f4d5c82ec2677764805c993941bbe1a_02c84bf3-db62-439d-809d-279e82adfe03.webp?v=1752649233","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98a61265d5ae75e0ec952e4da84ecf4662943258_8130c7c5-064b-4877-ad24-e131b36d0860.webp?v=1752649233","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2df67fcefc7985de5c9f1e4de7d26be85a7e74e_fb23176c-5c93-43e2-9985-aacf0b62d821.webp?v=1752649234","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eafd5c59d628a93c662a8498910c1ef074964fde_e49a50d4-f3de-4849-8653-533caf052cf7.webp?v=1752649234","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e133b3623518662a19c1b70be6b942bcf5c19c5b_77d14b6d-84bb-48ae-91b3-fc462f9fb85b.webp?v=1752649235","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee81fce5cafca6dc41ed7602a9f1874a51b52a9a_582242d4-7042-4adf-9447-8bc6fb984484.webp?v=1752649235","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/46e9862aad866edfcca0c9014dfd2cbd9b714be7_b962f25c-cb12-4c0d-898f-13c85f938b16.webp?v=1752649236","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa46a2778e2aecfbe9917d1e6c0f21355fcf0900_077dba92-f238-489a-9471-5a5381150022.webp?v=1752649236","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54a6139fea58daaeb9c276469b57729d63364113_8a004fda-4729-4cb4-b27b-7404e24b0bca.webp?v=1752649237","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee5f39f65ecb480f7b4a21a7ed7f49108c7ec436_5a89d1e6-3eab-4405-ad35-b44c52e48bca.webp?v=1752649237","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8d25057c458ac0e5919595e9e5f36e1973ae3c8_11bd8a24-e74d-4e51-9405-5c2e93447a7c.webp?v=1752649238"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4efc1606dd9882be71f7382b6437279a69aaf063.webp?v=1744712925","options":["color"],"media":[{"alt":null,"id":25495962419299,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4efc1606dd9882be71f7382b6437279a69aaf063.webp?v=1744712925"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4efc1606dd9882be71f7382b6437279a69aaf063.webp?v=1744712925","width":2000},{"alt":null,"id":25829764726883,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33abf2fdf67e421098da5206f39db9cd6a2b3aba_5ba555fc-4b09-4d1d-9d3a-16dd9c2e5618.webp?v=1752649232"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33abf2fdf67e421098da5206f39db9cd6a2b3aba_5ba555fc-4b09-4d1d-9d3a-16dd9c2e5618.webp?v=1752649232","width":2000},{"alt":null,"id":25829764825187,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d708acb9f4d5c82ec2677764805c993941bbe1a_02c84bf3-db62-439d-809d-279e82adfe03.webp?v=1752649233"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d708acb9f4d5c82ec2677764805c993941bbe1a_02c84bf3-db62-439d-809d-279e82adfe03.webp?v=1752649233","width":2000},{"alt":null,"id":25829764923491,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98a61265d5ae75e0ec952e4da84ecf4662943258_8130c7c5-064b-4877-ad24-e131b36d0860.webp?v=1752649233"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98a61265d5ae75e0ec952e4da84ecf4662943258_8130c7c5-064b-4877-ad24-e131b36d0860.webp?v=1752649233","width":2000},{"alt":null,"id":25829764989027,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2df67fcefc7985de5c9f1e4de7d26be85a7e74e_fb23176c-5c93-43e2-9985-aacf0b62d821.webp?v=1752649234"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2df67fcefc7985de5c9f1e4de7d26be85a7e74e_fb23176c-5c93-43e2-9985-aacf0b62d821.webp?v=1752649234","width":2000},{"alt":null,"id":25829765447779,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eafd5c59d628a93c662a8498910c1ef074964fde_e49a50d4-f3de-4849-8653-533caf052cf7.webp?v=1752649234"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eafd5c59d628a93c662a8498910c1ef074964fde_e49a50d4-f3de-4849-8653-533caf052cf7.webp?v=1752649234","width":2000},{"alt":null,"id":25829765578851,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e133b3623518662a19c1b70be6b942bcf5c19c5b_77d14b6d-84bb-48ae-91b3-fc462f9fb85b.webp?v=1752649235"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e133b3623518662a19c1b70be6b942bcf5c19c5b_77d14b6d-84bb-48ae-91b3-fc462f9fb85b.webp?v=1752649235","width":2000},{"alt":null,"id":25829765677155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee81fce5cafca6dc41ed7602a9f1874a51b52a9a_582242d4-7042-4adf-9447-8bc6fb984484.webp?v=1752649235"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee81fce5cafca6dc41ed7602a9f1874a51b52a9a_582242d4-7042-4adf-9447-8bc6fb984484.webp?v=1752649235","width":2000},{"alt":null,"id":25829765808227,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/46e9862aad866edfcca0c9014dfd2cbd9b714be7_b962f25c-cb12-4c0d-898f-13c85f938b16.webp?v=1752649236"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/46e9862aad866edfcca0c9014dfd2cbd9b714be7_b962f25c-cb12-4c0d-898f-13c85f938b16.webp?v=1752649236","width":2000},{"alt":null,"id":25829765972067,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa46a2778e2aecfbe9917d1e6c0f21355fcf0900_077dba92-f238-489a-9471-5a5381150022.webp?v=1752649236"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa46a2778e2aecfbe9917d1e6c0f21355fcf0900_077dba92-f238-489a-9471-5a5381150022.webp?v=1752649236","width":2000},{"alt":null,"id":25829766103139,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54a6139fea58daaeb9c276469b57729d63364113_8a004fda-4729-4cb4-b27b-7404e24b0bca.webp?v=1752649237"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54a6139fea58daaeb9c276469b57729d63364113_8a004fda-4729-4cb4-b27b-7404e24b0bca.webp?v=1752649237","width":2000},{"alt":null,"id":25829766234211,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee5f39f65ecb480f7b4a21a7ed7f49108c7ec436_5a89d1e6-3eab-4405-ad35-b44c52e48bca.webp?v=1752649237"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee5f39f65ecb480f7b4a21a7ed7f49108c7ec436_5a89d1e6-3eab-4405-ad35-b44c52e48bca.webp?v=1752649237","width":2000},{"alt":null,"id":25829766692963,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8d25057c458ac0e5919595e9e5f36e1973ae3c8_11bd8a24-e74d-4e51-9405-5c2e93447a7c.webp?v=1752649238"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8d25057c458ac0e5919595e9e5f36e1973ae3c8_11bd8a24-e74d-4e51-9405-5c2e93447a7c.webp?v=1752649238","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":43303179190371,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197193162851,"product_id":7769614680163,"position":8,"created_at":"2025-07-16T15:00:33+08:00","updated_at":"2025-07-16T15:00:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee81fce5cafca6dc41ed7602a9f1874a51b52a9a_582242d4-7042-4adf-9447-8bc6fb984484.webp?v=1752649235","variant_ids":[43303179190371]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126224-XF52","featured_media":{"alt":null,"id":25829765677155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee81fce5cafca6dc41ed7602a9f1874a51b52a9a_582242d4-7042-4adf-9447-8bc6fb984484.webp?v=1752649235"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303184040035,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197191819363,"product_id":7769614680163,"position":2,"created_at":"2025-07-16T15:00:30+08:00","updated_at":"2025-07-16T15:00:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33abf2fdf67e421098da5206f39db9cd6a2b3aba_5ba555fc-4b09-4d1d-9d3a-16dd9c2e5618.webp?v=1752649232","variant_ids":[43303184040035]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126204-XF52","featured_media":{"alt":null,"id":25829764726883,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33abf2fdf67e421098da5206f39db9cd6a2b3aba_5ba555fc-4b09-4d1d-9d3a-16dd9c2e5618.webp?v=1752649232"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303184203875,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197192048739,"product_id":7769614680163,"position":3,"created_at":"2025-07-16T15:00:31+08:00","updated_at":"2025-07-16T15:00:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d708acb9f4d5c82ec2677764805c993941bbe1a_02c84bf3-db62-439d-809d-279e82adfe03.webp?v=1752649233","variant_ids":[43303184203875]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - 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":"NPB01262J5-XF52","featured_media":{"alt":null,"id":25829764825187,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d708acb9f4d5c82ec2677764805c993941bbe1a_02c84bf3-db62-439d-809d-279e82adfe03.webp?v=1752649233"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43303179190371,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197193162851,"product_id":7769614680163,"position":8,"created_at":"2025-07-16T15:00:33+08:00","updated_at":"2025-07-16T15:00:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee81fce5cafca6dc41ed7602a9f1874a51b52a9a_582242d4-7042-4adf-9447-8bc6fb984484.webp?v=1752649235","variant_ids":[43303179190371]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126224-XF52","featured_media":{"alt":null,"id":25829765677155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee81fce5cafca6dc41ed7602a9f1874a51b52a9a_582242d4-7042-4adf-9447-8bc6fb984484.webp?v=1752649235"}},"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: "停產" }