$product = {"id":7769591414883,"title":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Lunar Mirage Cat - 月光貓","handle":"iphone-14-pro-mod-nx-magsafe-printable-xf53","description":null,"published_at":"2025-07-16T17:20:30+08:00","created_at":"2025-04-15T18:11:33+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師MOD NX MagSafe專區I Love Doodle","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-ilovedoodle","device-iPhone 14 Pro","merge","reseller-ilovedoodle"],"price":110000,"price_min":110000,"price_max":110000,"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":43303078559843,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-XF53","requires_shipping":true,"taxable":true,"featured_image":{"id":34197799370851,"product_id":7769591414883,"position":10,"created_at":"2025-07-16T15:22:45+08:00","updated_at":"2025-07-16T15:22:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b2a3dde839adf619c99ed5afca6bdc607e75ac8_3eedbe0b-f7ba-4f0c-8d2e-1f8d9aa833b2.webp?v=1752650567","variant_ids":[43303078559843]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Lunar Mirage Cat - 月光貓 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126224-XF53","featured_media":{"alt":null,"id":25830108266595,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b2a3dde839adf619c99ed5afca6bdc607e75ac8_3eedbe0b-f7ba-4f0c-8d2e-1f8d9aa833b2.webp?v=1752650567"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303083442275,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-XF53","requires_shipping":true,"taxable":true,"featured_image":{"id":34197801402467,"product_id":7769591414883,"position":13,"created_at":"2025-07-16T15:22:47+08:00","updated_at":"2025-07-16T15:22:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f128a8e56772ffbf4a118964910b03c2b58fa04a_77a959dd-0a7a-4545-9f2f-a0e0be36b66a.webp?v=1752650568","variant_ids":[43303083442275]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Lunar Mirage Cat - 月光貓 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126204-XF53","featured_media":{"alt":null,"id":25830109184099,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f128a8e56772ffbf4a118964910b03c2b58fa04a_77a959dd-0a7a-4545-9f2f-a0e0be36b66a.webp?v=1752650568"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303083606115,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-XF53","requires_shipping":true,"taxable":true,"featured_image":{"id":34197794848867,"product_id":7769591414883,"position":3,"created_at":"2025-07-16T15:22:41+08:00","updated_at":"2025-07-16T15:22:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/828d293624e12e335aec6281cf925f93370eb530_74b10bc6-8ac7-43a4-acdd-7aed85b8cd5e.webp?v=1752650563","variant_ids":[43303083606115]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Lunar Mirage Cat - 月光貓 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01262J5-XF53","featured_media":{"alt":null,"id":25830106071139,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/828d293624e12e335aec6281cf925f93370eb530_74b10bc6-8ac7-43a4-acdd-7aed85b8cd5e.webp?v=1752650563"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9805e0511ddd3f0555c9b06cfea2823258b77273_62aec87b-7387-4b13-b25c-58d1ef3b31ab.webp?v=1744711900","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/271b9e775df39548159d1ce36a35f572bd97419a_080fa852-5483-426b-9509-983ed5112c4a.webp?v=1752650563","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/828d293624e12e335aec6281cf925f93370eb530_74b10bc6-8ac7-43a4-acdd-7aed85b8cd5e.webp?v=1752650563","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/93b9746e44454aa781529b95fec66530f27635e2_8e5b40ac-5467-493f-9530-758d193a8899.webp?v=1752650564","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3f78a54c446a8e3d40ba3c2784496d4fad8d876a_3e99241b-deef-4131-be31-23b2eb296064.webp?v=1752650564","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a175b48486881f8d50ae356bef4aa4f6774dcbc0_806ec6c8-daa5-4990-87ca-32e66e157e12.webp?v=1752650564","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b30d38fa07e15e927abc0464599728183ed054cb_c65039a6-4672-432a-ad4f-36f6b32f8667.webp?v=1752650565","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d9e35a3800c3a978292181669248485f752c6c6_60fbb1e6-974e-4259-9848-2957c8f33007.webp?v=1752650566","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8ef6a567e71ad88c8ca51fc688b8ee8dc21fa72a_c8403234-448a-483e-bba4-faa23e427977.webp?v=1752650566","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b2a3dde839adf619c99ed5afca6bdc607e75ac8_3eedbe0b-f7ba-4f0c-8d2e-1f8d9aa833b2.webp?v=1752650567","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d8f5e8c68c9c51ce1cbcb29e7fbfc8cd59b373be_21c34148-66a6-495e-a6c6-70e1f2f90086.webp?v=1752650568","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c3df5c1ef6bc00dab5ef1f4d2ffaeb3d2b435072_b95d6c07-7a9c-4ba2-8910-92f8c9ff1dd9.webp?v=1752650568","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f128a8e56772ffbf4a118964910b03c2b58fa04a_77a959dd-0a7a-4545-9f2f-a0e0be36b66a.webp?v=1752650568"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9805e0511ddd3f0555c9b06cfea2823258b77273_62aec87b-7387-4b13-b25c-58d1ef3b31ab.webp?v=1744711900","options":["color"],"media":[{"alt":null,"id":25495893770339,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9805e0511ddd3f0555c9b06cfea2823258b77273_62aec87b-7387-4b13-b25c-58d1ef3b31ab.webp?v=1744711900"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9805e0511ddd3f0555c9b06cfea2823258b77273_62aec87b-7387-4b13-b25c-58d1ef3b31ab.webp?v=1744711900","width":2000},{"alt":null,"id":25830105743459,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/271b9e775df39548159d1ce36a35f572bd97419a_080fa852-5483-426b-9509-983ed5112c4a.webp?v=1752650563"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/271b9e775df39548159d1ce36a35f572bd97419a_080fa852-5483-426b-9509-983ed5112c4a.webp?v=1752650563","width":2000},{"alt":null,"id":25830106071139,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/828d293624e12e335aec6281cf925f93370eb530_74b10bc6-8ac7-43a4-acdd-7aed85b8cd5e.webp?v=1752650563"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/828d293624e12e335aec6281cf925f93370eb530_74b10bc6-8ac7-43a4-acdd-7aed85b8cd5e.webp?v=1752650563","width":2000},{"alt":null,"id":25830106398819,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/93b9746e44454aa781529b95fec66530f27635e2_8e5b40ac-5467-493f-9530-758d193a8899.webp?v=1752650564"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/93b9746e44454aa781529b95fec66530f27635e2_8e5b40ac-5467-493f-9530-758d193a8899.webp?v=1752650564","width":2000},{"alt":null,"id":25830106660963,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3f78a54c446a8e3d40ba3c2784496d4fad8d876a_3e99241b-deef-4131-be31-23b2eb296064.webp?v=1752650564"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3f78a54c446a8e3d40ba3c2784496d4fad8d876a_3e99241b-deef-4131-be31-23b2eb296064.webp?v=1752650564","width":2000},{"alt":null,"id":25830106955875,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a175b48486881f8d50ae356bef4aa4f6774dcbc0_806ec6c8-daa5-4990-87ca-32e66e157e12.webp?v=1752650564"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a175b48486881f8d50ae356bef4aa4f6774dcbc0_806ec6c8-daa5-4990-87ca-32e66e157e12.webp?v=1752650564","width":2000},{"alt":null,"id":25830107283555,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b30d38fa07e15e927abc0464599728183ed054cb_c65039a6-4672-432a-ad4f-36f6b32f8667.webp?v=1752650565"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b30d38fa07e15e927abc0464599728183ed054cb_c65039a6-4672-432a-ad4f-36f6b32f8667.webp?v=1752650565","width":2000},{"alt":null,"id":25830107578467,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d9e35a3800c3a978292181669248485f752c6c6_60fbb1e6-974e-4259-9848-2957c8f33007.webp?v=1752650566"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d9e35a3800c3a978292181669248485f752c6c6_60fbb1e6-974e-4259-9848-2957c8f33007.webp?v=1752650566","width":2000},{"alt":null,"id":25830107807843,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8ef6a567e71ad88c8ca51fc688b8ee8dc21fa72a_c8403234-448a-483e-bba4-faa23e427977.webp?v=1752650566"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8ef6a567e71ad88c8ca51fc688b8ee8dc21fa72a_c8403234-448a-483e-bba4-faa23e427977.webp?v=1752650566","width":2000},{"alt":null,"id":25830108266595,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b2a3dde839adf619c99ed5afca6bdc607e75ac8_3eedbe0b-f7ba-4f0c-8d2e-1f8d9aa833b2.webp?v=1752650567"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b2a3dde839adf619c99ed5afca6bdc607e75ac8_3eedbe0b-f7ba-4f0c-8d2e-1f8d9aa833b2.webp?v=1752650567","width":2000},{"alt":null,"id":25830108594275,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d8f5e8c68c9c51ce1cbcb29e7fbfc8cd59b373be_21c34148-66a6-495e-a6c6-70e1f2f90086.webp?v=1752650568"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d8f5e8c68c9c51ce1cbcb29e7fbfc8cd59b373be_21c34148-66a6-495e-a6c6-70e1f2f90086.webp?v=1752650568","width":2000},{"alt":null,"id":25830108823651,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c3df5c1ef6bc00dab5ef1f4d2ffaeb3d2b435072_b95d6c07-7a9c-4ba2-8910-92f8c9ff1dd9.webp?v=1752650568"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c3df5c1ef6bc00dab5ef1f4d2ffaeb3d2b435072_b95d6c07-7a9c-4ba2-8910-92f8c9ff1dd9.webp?v=1752650568","width":2000},{"alt":null,"id":25830109184099,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f128a8e56772ffbf4a118964910b03c2b58fa04a_77a959dd-0a7a-4545-9f2f-a0e0be36b66a.webp?v=1752650568"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f128a8e56772ffbf4a118964910b03c2b58fa04a_77a959dd-0a7a-4545-9f2f-a0e0be36b66a.webp?v=1752650568","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43303078559843,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-XF53","requires_shipping":true,"taxable":true,"featured_image":{"id":34197799370851,"product_id":7769591414883,"position":10,"created_at":"2025-07-16T15:22:45+08:00","updated_at":"2025-07-16T15:22:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b2a3dde839adf619c99ed5afca6bdc607e75ac8_3eedbe0b-f7ba-4f0c-8d2e-1f8d9aa833b2.webp?v=1752650567","variant_ids":[43303078559843]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Lunar Mirage Cat - 月光貓 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126224-XF53","featured_media":{"alt":null,"id":25830108266595,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b2a3dde839adf619c99ed5afca6bdc607e75ac8_3eedbe0b-f7ba-4f0c-8d2e-1f8d9aa833b2.webp?v=1752650567"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303083442275,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-XF53","requires_shipping":true,"taxable":true,"featured_image":{"id":34197801402467,"product_id":7769591414883,"position":13,"created_at":"2025-07-16T15:22:47+08:00","updated_at":"2025-07-16T15:22:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f128a8e56772ffbf4a118964910b03c2b58fa04a_77a959dd-0a7a-4545-9f2f-a0e0be36b66a.webp?v=1752650568","variant_ids":[43303083442275]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Lunar Mirage Cat - 月光貓 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126204-XF53","featured_media":{"alt":null,"id":25830109184099,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f128a8e56772ffbf4a118964910b03c2b58fa04a_77a959dd-0a7a-4545-9f2f-a0e0be36b66a.webp?v=1752650568"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303083606115,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-XF53","requires_shipping":true,"taxable":true,"featured_image":{"id":34197794848867,"product_id":7769591414883,"position":3,"created_at":"2025-07-16T15:22:41+08:00","updated_at":"2025-07-16T15:22:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/828d293624e12e335aec6281cf925f93370eb530_74b10bc6-8ac7-43a4-acdd-7aed85b8cd5e.webp?v=1752650563","variant_ids":[43303083606115]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Lunar Mirage Cat - 月光貓 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01262J5-XF53","featured_media":{"alt":null,"id":25830106071139,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/828d293624e12e335aec6281cf925f93370eb530_74b10bc6-8ac7-43a4-acdd-7aed85b8cd5e.webp?v=1752650563"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43303078559843,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-XF53","requires_shipping":true,"taxable":true,"featured_image":{"id":34197799370851,"product_id":7769591414883,"position":10,"created_at":"2025-07-16T15:22:45+08:00","updated_at":"2025-07-16T15:22:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b2a3dde839adf619c99ed5afca6bdc607e75ac8_3eedbe0b-f7ba-4f0c-8d2e-1f8d9aa833b2.webp?v=1752650567","variant_ids":[43303078559843]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Lunar Mirage Cat - 月光貓 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126224-XF53","featured_media":{"alt":null,"id":25830108266595,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b2a3dde839adf619c99ed5afca6bdc607e75ac8_3eedbe0b-f7ba-4f0c-8d2e-1f8d9aa833b2.webp?v=1752650567"}},"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: "停產" }