$product = {"id":7769768296547,"title":"iPhone 14 Pro Mod NX ilovedoodle Mindful Cat - 冷靜","handle":"iphone-14-pro-mod-nx-printable-xf46","description":null,"published_at":"2025-07-16T17:01:05+08:00","created_at":"2025-04-15T20:23:47+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":43303885406307,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF46","requires_shipping":true,"taxable":true,"featured_image":{"id":34196528595043,"product_id":7769768296547,"position":8,"created_at":"2025-07-16T14:45:25+08:00","updated_at":"2025-07-16T14:45:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28b217e6e9aa1b5c021bbf24d363979dd8288995_776cb21a-a53c-448d-8afe-e7b0bc387e42.webp?v=1752648327","variant_ids":[43303885406307]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful 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-XF46","featured_media":{"alt":null,"id":25829403754595,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28b217e6e9aa1b5c021bbf24d363979dd8288995_776cb21a-a53c-448d-8afe-e7b0bc387e42.webp?v=1752648327"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303892320355,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF46","requires_shipping":true,"taxable":true,"featured_image":{"id":34196526039139,"product_id":7769768296547,"position":2,"created_at":"2025-07-16T14:45:22+08:00","updated_at":"2025-07-16T14:45:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d6768019baca94296157b2009d173e370105ce_2f203db4-a418-45d2-8fda-3ddefeca43d7.webp?v=1752648324","variant_ids":[43303892320355]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful 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-XF46","featured_media":{"alt":null,"id":25829402411107,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d6768019baca94296157b2009d173e370105ce_2f203db4-a418-45d2-8fda-3ddefeca43d7.webp?v=1752648324"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303892484195,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF46","requires_shipping":true,"taxable":true,"featured_image":{"id":34196527022179,"product_id":7769768296547,"position":4,"created_at":"2025-07-16T14:45:23+08:00","updated_at":"2025-07-16T14:45:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8f1c7438b1fbb9b472e921b6d39552365482d3a_340b3111-126c-4a01-b035-e2df3bbfb348.webp?v=1752648325","variant_ids":[43303892484195]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful 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-XF46","featured_media":{"alt":null,"id":25829402935395,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8f1c7438b1fbb9b472e921b6d39552365482d3a_340b3111-126c-4a01-b035-e2df3bbfb348.webp?v=1752648325"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9d5799a17c5b3d544664bd1e7756add6c6c5bbe2_000a8e11-e79e-48af-974e-f73668189dfd.webp?v=1744719835","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d6768019baca94296157b2009d173e370105ce_2f203db4-a418-45d2-8fda-3ddefeca43d7.webp?v=1752648324","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d8b3abb3081ac406db08da9c55f20cfea52be78_af24eeab-2057-4578-ae54-e70996d6eff3.webp?v=1752648325","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8f1c7438b1fbb9b472e921b6d39552365482d3a_340b3111-126c-4a01-b035-e2df3bbfb348.webp?v=1752648325","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e461027c61a23750e892f67aeb6d51a21236eb58_99934346-8e7e-4175-9100-2bba7f2045c5.webp?v=1752648326","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/612b117f5ce047499ef24994064bdc8e2d55c18f_8b7c5697-1490-4e22-a3ed-f7240d2fe009.webp?v=1752648326","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2cc53b95919c26eba4853880c91d42eb6da7cddd_ccd600b1-b873-43e5-a7cd-3538d03f21a8.webp?v=1752648327","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28b217e6e9aa1b5c021bbf24d363979dd8288995_776cb21a-a53c-448d-8afe-e7b0bc387e42.webp?v=1752648327","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd3cb3f2d28649134672ec43184f3548cc1c5ffb_899fbde7-0e76-40c4-ad27-ac3abc3e6404.webp?v=1752648328","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fa8674aa2cb9f81edee900713cb625a39a350ddf_e95ebea4-5ec5-4342-8aa8-bec790f0cfc4.webp?v=1752648328","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/314b99cc6c8e2e8903a7e7d06858cefb68a86a7a_9bf22f24-7ed6-45a1-a0ae-cca27394d4b4.webp?v=1752648329","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba95078656802aea496d46a86a89b1e81c795385_003a5a1a-cefb-44b4-8172-6edb07ae5912.webp?v=1752648329","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aceefabbf2bbc71d49b3e1e0df07c0d65072a38_8e95f5cb-6749-481c-b8a2-745d1f38e9a8.webp?v=1752648330"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9d5799a17c5b3d544664bd1e7756add6c6c5bbe2_000a8e11-e79e-48af-974e-f73668189dfd.webp?v=1744719835","options":["color"],"media":[{"alt":null,"id":25496259559523,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9d5799a17c5b3d544664bd1e7756add6c6c5bbe2_000a8e11-e79e-48af-974e-f73668189dfd.webp?v=1744719835"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9d5799a17c5b3d544664bd1e7756add6c6c5bbe2_000a8e11-e79e-48af-974e-f73668189dfd.webp?v=1744719835","width":2000},{"alt":null,"id":25829402411107,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d6768019baca94296157b2009d173e370105ce_2f203db4-a418-45d2-8fda-3ddefeca43d7.webp?v=1752648324"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d6768019baca94296157b2009d173e370105ce_2f203db4-a418-45d2-8fda-3ddefeca43d7.webp?v=1752648324","width":2000},{"alt":null,"id":25829402738787,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d8b3abb3081ac406db08da9c55f20cfea52be78_af24eeab-2057-4578-ae54-e70996d6eff3.webp?v=1752648325"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d8b3abb3081ac406db08da9c55f20cfea52be78_af24eeab-2057-4578-ae54-e70996d6eff3.webp?v=1752648325","width":2000},{"alt":null,"id":25829402935395,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8f1c7438b1fbb9b472e921b6d39552365482d3a_340b3111-126c-4a01-b035-e2df3bbfb348.webp?v=1752648325"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8f1c7438b1fbb9b472e921b6d39552365482d3a_340b3111-126c-4a01-b035-e2df3bbfb348.webp?v=1752648325","width":2000},{"alt":null,"id":25829403164771,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e461027c61a23750e892f67aeb6d51a21236eb58_99934346-8e7e-4175-9100-2bba7f2045c5.webp?v=1752648326"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e461027c61a23750e892f67aeb6d51a21236eb58_99934346-8e7e-4175-9100-2bba7f2045c5.webp?v=1752648326","width":2000},{"alt":null,"id":25829403328611,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/612b117f5ce047499ef24994064bdc8e2d55c18f_8b7c5697-1490-4e22-a3ed-f7240d2fe009.webp?v=1752648326"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/612b117f5ce047499ef24994064bdc8e2d55c18f_8b7c5697-1490-4e22-a3ed-f7240d2fe009.webp?v=1752648326","width":2000},{"alt":null,"id":25829403557987,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2cc53b95919c26eba4853880c91d42eb6da7cddd_ccd600b1-b873-43e5-a7cd-3538d03f21a8.webp?v=1752648327"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2cc53b95919c26eba4853880c91d42eb6da7cddd_ccd600b1-b873-43e5-a7cd-3538d03f21a8.webp?v=1752648327","width":2000},{"alt":null,"id":25829403754595,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28b217e6e9aa1b5c021bbf24d363979dd8288995_776cb21a-a53c-448d-8afe-e7b0bc387e42.webp?v=1752648327"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28b217e6e9aa1b5c021bbf24d363979dd8288995_776cb21a-a53c-448d-8afe-e7b0bc387e42.webp?v=1752648327","width":2000},{"alt":null,"id":25829403918435,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd3cb3f2d28649134672ec43184f3548cc1c5ffb_899fbde7-0e76-40c4-ad27-ac3abc3e6404.webp?v=1752648328"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd3cb3f2d28649134672ec43184f3548cc1c5ffb_899fbde7-0e76-40c4-ad27-ac3abc3e6404.webp?v=1752648328","width":2000},{"alt":null,"id":25829404147811,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fa8674aa2cb9f81edee900713cb625a39a350ddf_e95ebea4-5ec5-4342-8aa8-bec790f0cfc4.webp?v=1752648328"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fa8674aa2cb9f81edee900713cb625a39a350ddf_e95ebea4-5ec5-4342-8aa8-bec790f0cfc4.webp?v=1752648328","width":2000},{"alt":null,"id":25829404639331,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/314b99cc6c8e2e8903a7e7d06858cefb68a86a7a_9bf22f24-7ed6-45a1-a0ae-cca27394d4b4.webp?v=1752648329"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/314b99cc6c8e2e8903a7e7d06858cefb68a86a7a_9bf22f24-7ed6-45a1-a0ae-cca27394d4b4.webp?v=1752648329","width":2000},{"alt":null,"id":25829404803171,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba95078656802aea496d46a86a89b1e81c795385_003a5a1a-cefb-44b4-8172-6edb07ae5912.webp?v=1752648329"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba95078656802aea496d46a86a89b1e81c795385_003a5a1a-cefb-44b4-8172-6edb07ae5912.webp?v=1752648329","width":2000},{"alt":null,"id":25829404934243,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aceefabbf2bbc71d49b3e1e0df07c0d65072a38_8e95f5cb-6749-481c-b8a2-745d1f38e9a8.webp?v=1752648330"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aceefabbf2bbc71d49b3e1e0df07c0d65072a38_8e95f5cb-6749-481c-b8a2-745d1f38e9a8.webp?v=1752648330","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43303885406307,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF46","requires_shipping":true,"taxable":true,"featured_image":{"id":34196528595043,"product_id":7769768296547,"position":8,"created_at":"2025-07-16T14:45:25+08:00","updated_at":"2025-07-16T14:45:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28b217e6e9aa1b5c021bbf24d363979dd8288995_776cb21a-a53c-448d-8afe-e7b0bc387e42.webp?v=1752648327","variant_ids":[43303885406307]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful 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-XF46","featured_media":{"alt":null,"id":25829403754595,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28b217e6e9aa1b5c021bbf24d363979dd8288995_776cb21a-a53c-448d-8afe-e7b0bc387e42.webp?v=1752648327"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303892320355,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF46","requires_shipping":true,"taxable":true,"featured_image":{"id":34196526039139,"product_id":7769768296547,"position":2,"created_at":"2025-07-16T14:45:22+08:00","updated_at":"2025-07-16T14:45:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d6768019baca94296157b2009d173e370105ce_2f203db4-a418-45d2-8fda-3ddefeca43d7.webp?v=1752648324","variant_ids":[43303892320355]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful 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-XF46","featured_media":{"alt":null,"id":25829402411107,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d6768019baca94296157b2009d173e370105ce_2f203db4-a418-45d2-8fda-3ddefeca43d7.webp?v=1752648324"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303892484195,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF46","requires_shipping":true,"taxable":true,"featured_image":{"id":34196527022179,"product_id":7769768296547,"position":4,"created_at":"2025-07-16T14:45:23+08:00","updated_at":"2025-07-16T14:45:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8f1c7438b1fbb9b472e921b6d39552365482d3a_340b3111-126c-4a01-b035-e2df3bbfb348.webp?v=1752648325","variant_ids":[43303892484195]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful 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-XF46","featured_media":{"alt":null,"id":25829402935395,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8f1c7438b1fbb9b472e921b6d39552365482d3a_340b3111-126c-4a01-b035-e2df3bbfb348.webp?v=1752648325"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43303885406307,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF46","requires_shipping":true,"taxable":true,"featured_image":{"id":34196528595043,"product_id":7769768296547,"position":8,"created_at":"2025-07-16T14:45:25+08:00","updated_at":"2025-07-16T14:45:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28b217e6e9aa1b5c021bbf24d363979dd8288995_776cb21a-a53c-448d-8afe-e7b0bc387e42.webp?v=1752648327","variant_ids":[43303885406307]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful 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-XF46","featured_media":{"alt":null,"id":25829403754595,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28b217e6e9aa1b5c021bbf24d363979dd8288995_776cb21a-a53c-448d-8afe-e7b0bc387e42.webp?v=1752648327"}},"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: "停產" }