$product = {"id":7893831975011,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 紫野花語","handle":"iphone-12-pro-mod-nx-magsafe-printable-chu01","description":null,"published_at":"2025-10-09T09:29:24+08:00","created_at":"2025-10-07T10:22:48+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-chubbynida","device-iPhone 12 Pro","merge","reseller-chubbynida"],"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":43763431047267,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-CHU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34553165840483,"product_id":7893831975011,"position":8,"created_at":"2025-10-07T10:23:03+08:00","updated_at":"2025-10-07T10:23:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5debccaf475e3bee3e858941aeab6ac51b5a253.webp?v=1759803785","variant_ids":[43763431047267]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 紫野花語 - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-CHU01","featured_media":{"alt":null,"id":26122813472867,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5debccaf475e3bee3e858941aeab6ac51b5a253.webp?v=1759803785"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763435274339,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-CHU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34553164562531,"product_id":7893831975011,"position":3,"created_at":"2025-10-07T10:22:58+08:00","updated_at":"2025-10-07T10:23:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eae0114554ef9cef36a41540a46e332202b059a7.webp?v=1759803781","variant_ids":[43763435274339]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 紫野花語 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118524-CHU01","featured_media":{"alt":null,"id":26122812227683,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eae0114554ef9cef36a41540a46e332202b059a7.webp?v=1759803781"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763435339875,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-CHU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34553165152355,"product_id":7893831975011,"position":5,"created_at":"2025-10-07T10:23:00+08:00","updated_at":"2025-10-07T10:23:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/daf2cf2dd477b501307c72d9e0d442640359455b.webp?v=1759803783","variant_ids":[43763435339875]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 紫野花語 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118504-CHU01","featured_media":{"alt":null,"id":26122812817507,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/daf2cf2dd477b501307c72d9e0d442640359455b.webp?v=1759803783"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763435405411,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-CHU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34553163972707,"product_id":7893831975011,"position":1,"created_at":"2025-10-07T10:22:56+08:00","updated_at":"2025-10-07T10:22:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/604349ab9d560e142b2600ab4e18f94a292bae1c.webp?v=1759803778","variant_ids":[43763435405411]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 紫野花語 - 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":"MPB01185J5-CHU01","featured_media":{"alt":null,"id":26122811637859,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/604349ab9d560e142b2600ab4e18f94a292bae1c.webp?v=1759803778"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763435438179,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-CHU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34553166299235,"product_id":7893831975011,"position":10,"created_at":"2025-10-07T10:23:04+08:00","updated_at":"2025-10-07T10:23:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64f3da6a5a484b9ee78aa60c088668166fac8c58.webp?v=1759803786","variant_ids":[43763435438179]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 紫野花語 - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118569-CHU01","featured_media":{"alt":null,"id":26122813964387,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64f3da6a5a484b9ee78aa60c088668166fac8c58.webp?v=1759803786"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/604349ab9d560e142b2600ab4e18f94a292bae1c.webp?v=1759803778","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03d636ce51b9fd65db323b604ca5401c41cbcaac.webp?v=1759803779","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eae0114554ef9cef36a41540a46e332202b059a7.webp?v=1759803781","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7a348406b05b2aaceac5b378cd0cdf302521adfc.webp?v=1759803782","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/daf2cf2dd477b501307c72d9e0d442640359455b.webp?v=1759803783","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3aa3afe3cd4f0a8f84d8b990312362f65fb9c76.webp?v=1759803783","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/296c1ce6a7521739e8c481a3323ae8c107a96b04.webp?v=1759803784","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5debccaf475e3bee3e858941aeab6ac51b5a253.webp?v=1759803785","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8995678d8001b254d90398e5ddf00988dd0f61fa.webp?v=1759803785","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64f3da6a5a484b9ee78aa60c088668166fac8c58.webp?v=1759803786","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/986ed328f29796574f1e70182b98c43850f7c1e8.webp?v=1759803787"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/604349ab9d560e142b2600ab4e18f94a292bae1c.webp?v=1759803778","options":["color"],"media":[{"alt":null,"id":26122811637859,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/604349ab9d560e142b2600ab4e18f94a292bae1c.webp?v=1759803778"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/604349ab9d560e142b2600ab4e18f94a292bae1c.webp?v=1759803778","width":2000},{"alt":null,"id":26122811900003,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03d636ce51b9fd65db323b604ca5401c41cbcaac.webp?v=1759803779"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03d636ce51b9fd65db323b604ca5401c41cbcaac.webp?v=1759803779","width":2000},{"alt":null,"id":26122812227683,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eae0114554ef9cef36a41540a46e332202b059a7.webp?v=1759803781"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eae0114554ef9cef36a41540a46e332202b059a7.webp?v=1759803781","width":2000},{"alt":null,"id":26122812457059,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7a348406b05b2aaceac5b378cd0cdf302521adfc.webp?v=1759803782"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7a348406b05b2aaceac5b378cd0cdf302521adfc.webp?v=1759803782","width":2000},{"alt":null,"id":26122812817507,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/daf2cf2dd477b501307c72d9e0d442640359455b.webp?v=1759803783"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/daf2cf2dd477b501307c72d9e0d442640359455b.webp?v=1759803783","width":2000},{"alt":null,"id":26122813046883,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3aa3afe3cd4f0a8f84d8b990312362f65fb9c76.webp?v=1759803783"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3aa3afe3cd4f0a8f84d8b990312362f65fb9c76.webp?v=1759803783","width":2000},{"alt":null,"id":26122813309027,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/296c1ce6a7521739e8c481a3323ae8c107a96b04.webp?v=1759803784"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/296c1ce6a7521739e8c481a3323ae8c107a96b04.webp?v=1759803784","width":2000},{"alt":null,"id":26122813472867,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5debccaf475e3bee3e858941aeab6ac51b5a253.webp?v=1759803785"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5debccaf475e3bee3e858941aeab6ac51b5a253.webp?v=1759803785","width":2000},{"alt":null,"id":26122813669475,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8995678d8001b254d90398e5ddf00988dd0f61fa.webp?v=1759803785"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8995678d8001b254d90398e5ddf00988dd0f61fa.webp?v=1759803785","width":2000},{"alt":null,"id":26122813964387,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64f3da6a5a484b9ee78aa60c088668166fac8c58.webp?v=1759803786"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64f3da6a5a484b9ee78aa60c088668166fac8c58.webp?v=1759803786","width":2000},{"alt":null,"id":26122814193763,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/986ed328f29796574f1e70182b98c43850f7c1e8.webp?v=1759803787"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/986ed328f29796574f1e70182b98c43850f7c1e8.webp?v=1759803787","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43763431047267,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-CHU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34553165840483,"product_id":7893831975011,"position":8,"created_at":"2025-10-07T10:23:03+08:00","updated_at":"2025-10-07T10:23:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5debccaf475e3bee3e858941aeab6ac51b5a253.webp?v=1759803785","variant_ids":[43763431047267]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 紫野花語 - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-CHU01","featured_media":{"alt":null,"id":26122813472867,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5debccaf475e3bee3e858941aeab6ac51b5a253.webp?v=1759803785"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763435274339,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-CHU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34553164562531,"product_id":7893831975011,"position":3,"created_at":"2025-10-07T10:22:58+08:00","updated_at":"2025-10-07T10:23:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eae0114554ef9cef36a41540a46e332202b059a7.webp?v=1759803781","variant_ids":[43763435274339]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 紫野花語 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118524-CHU01","featured_media":{"alt":null,"id":26122812227683,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eae0114554ef9cef36a41540a46e332202b059a7.webp?v=1759803781"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763435339875,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-CHU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34553165152355,"product_id":7893831975011,"position":5,"created_at":"2025-10-07T10:23:00+08:00","updated_at":"2025-10-07T10:23:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/daf2cf2dd477b501307c72d9e0d442640359455b.webp?v=1759803783","variant_ids":[43763435339875]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 紫野花語 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118504-CHU01","featured_media":{"alt":null,"id":26122812817507,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/daf2cf2dd477b501307c72d9e0d442640359455b.webp?v=1759803783"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763435405411,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-CHU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34553163972707,"product_id":7893831975011,"position":1,"created_at":"2025-10-07T10:22:56+08:00","updated_at":"2025-10-07T10:22:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/604349ab9d560e142b2600ab4e18f94a292bae1c.webp?v=1759803778","variant_ids":[43763435405411]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 紫野花語 - 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":"MPB01185J5-CHU01","featured_media":{"alt":null,"id":26122811637859,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/604349ab9d560e142b2600ab4e18f94a292bae1c.webp?v=1759803778"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763435438179,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-CHU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34553166299235,"product_id":7893831975011,"position":10,"created_at":"2025-10-07T10:23:04+08:00","updated_at":"2025-10-07T10:23:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64f3da6a5a484b9ee78aa60c088668166fac8c58.webp?v=1759803786","variant_ids":[43763435438179]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 紫野花語 - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118569-CHU01","featured_media":{"alt":null,"id":26122813964387,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64f3da6a5a484b9ee78aa60c088668166fac8c58.webp?v=1759803786"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43763431047267,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-CHU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34553165840483,"product_id":7893831975011,"position":8,"created_at":"2025-10-07T10:23:03+08:00","updated_at":"2025-10-07T10:23:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5debccaf475e3bee3e858941aeab6ac51b5a253.webp?v=1759803785","variant_ids":[43763431047267]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 紫野花語 - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-CHU01","featured_media":{"alt":null,"id":26122813472867,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5debccaf475e3bee3e858941aeab6ac51b5a253.webp?v=1759803785"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}; $device_handle = null; $type = ""; var sellingStatus if ($isMerge) { $(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: "停產" }