$product = {"id":7873336311907,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Keigo Deep Sea","handle":"iphone-12-pro-mod-nx-magsafe-printable-kei09","description":null,"published_at":"2025-09-01T10:26:07+08:00","created_at":"2025-09-01T09:57:11+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-keigo","device-iPhone 12 Pro","merge","reseller-keigo"],"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":43658810982499,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34410160914531,"product_id":7873336311907,"position":3,"created_at":"2025-09-01T09:57:17+08:00","updated_at":"2025-09-01T09:57:19+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b359f4c1da7b74220da3edacf86614761c44ca76.webp?v=1756691839","variant_ids":[43658810982499]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Keigo Deep Sea - 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-KEI09","featured_media":{"alt":null,"id":25982475894883,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b359f4c1da7b74220da3edacf86614761c44ca76.webp?v=1756691839"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658811015267,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34410161504355,"product_id":7873336311907,"position":6,"created_at":"2025-09-01T09:57:19+08:00","updated_at":"2025-09-01T09:57:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bea862456e96770c06a603884cc620820edd7ef0.webp?v=1756691841","variant_ids":[43658811015267]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Keigo Deep Sea - 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-KEI09","featured_media":{"alt":null,"id":25982476484707,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bea862456e96770c06a603884cc620820edd7ef0.webp?v=1756691841"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658811113571,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34410160750691,"product_id":7873336311907,"position":2,"created_at":"2025-09-01T09:57:16+08:00","updated_at":"2025-09-01T09:57:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e1e3b8e27bbc106371422f6527e98b370dd86bb.webp?v=1756691838","variant_ids":[43658811113571]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Keigo Deep Sea - 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-KEI09","featured_media":{"alt":null,"id":25982475731043,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e1e3b8e27bbc106371422f6527e98b370dd86bb.webp?v=1756691838"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658811146339,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34410161700963,"product_id":7873336311907,"position":7,"created_at":"2025-09-01T09:57:20+08:00","updated_at":"2025-09-01T09:57:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/200250e4527620778e5b5918ce5eab7929ab19bd.webp?v=1756691842","variant_ids":[43658811146339]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Keigo Deep Sea - 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-KEI09","featured_media":{"alt":null,"id":25982476681315,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/200250e4527620778e5b5918ce5eab7929ab19bd.webp?v=1756691842"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658811244643,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34410161864803,"product_id":7873336311907,"position":8,"created_at":"2025-09-01T09:57:21+08:00","updated_at":"2025-09-01T09:57:23+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca1b0c3bb3c0eaea6f4373d40c4bb922aa7579ac.webp?v=1756691843","variant_ids":[43658811244643]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Keigo Deep Sea - 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-KEI09","featured_media":{"alt":null,"id":25982476845155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca1b0c3bb3c0eaea6f4373d40c4bb922aa7579ac.webp?v=1756691843"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ff1678ee06e1193403a931f64c45d44c099523.webp?v=1756691838","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e1e3b8e27bbc106371422f6527e98b370dd86bb.webp?v=1756691838","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b359f4c1da7b74220da3edacf86614761c44ca76.webp?v=1756691839","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c90fc0e858b8977e0fbe970f0568cdfaf0b4cd6a.webp?v=1756691839","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3bfd0933fba9e99271d2a15e22759a99378a28a.webp?v=1756691841","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bea862456e96770c06a603884cc620820edd7ef0.webp?v=1756691841","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/200250e4527620778e5b5918ce5eab7929ab19bd.webp?v=1756691842","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca1b0c3bb3c0eaea6f4373d40c4bb922aa7579ac.webp?v=1756691843","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e07152d911a9d234f883303eeac5572fd1447a6.webp?v=1756691844","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/daf8b6e305134faaddb7daeeef2549984d7c4d86.webp?v=1756691845","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b344efb3c7b6e278968d9bb4042a99ba29f2f02d.webp?v=1756691845"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ff1678ee06e1193403a931f64c45d44c099523.webp?v=1756691838","options":["color"],"media":[{"alt":null,"id":25982475567203,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ff1678ee06e1193403a931f64c45d44c099523.webp?v=1756691838"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ff1678ee06e1193403a931f64c45d44c099523.webp?v=1756691838","width":2000},{"alt":null,"id":25982475731043,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e1e3b8e27bbc106371422f6527e98b370dd86bb.webp?v=1756691838"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e1e3b8e27bbc106371422f6527e98b370dd86bb.webp?v=1756691838","width":2000},{"alt":null,"id":25982475894883,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b359f4c1da7b74220da3edacf86614761c44ca76.webp?v=1756691839"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b359f4c1da7b74220da3edacf86614761c44ca76.webp?v=1756691839","width":2000},{"alt":null,"id":25982476025955,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c90fc0e858b8977e0fbe970f0568cdfaf0b4cd6a.webp?v=1756691839"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c90fc0e858b8977e0fbe970f0568cdfaf0b4cd6a.webp?v=1756691839","width":2000},{"alt":null,"id":25982476255331,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3bfd0933fba9e99271d2a15e22759a99378a28a.webp?v=1756691841"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3bfd0933fba9e99271d2a15e22759a99378a28a.webp?v=1756691841","width":2000},{"alt":null,"id":25982476484707,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bea862456e96770c06a603884cc620820edd7ef0.webp?v=1756691841"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bea862456e96770c06a603884cc620820edd7ef0.webp?v=1756691841","width":2000},{"alt":null,"id":25982476681315,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/200250e4527620778e5b5918ce5eab7929ab19bd.webp?v=1756691842"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/200250e4527620778e5b5918ce5eab7929ab19bd.webp?v=1756691842","width":2000},{"alt":null,"id":25982476845155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca1b0c3bb3c0eaea6f4373d40c4bb922aa7579ac.webp?v=1756691843"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca1b0c3bb3c0eaea6f4373d40c4bb922aa7579ac.webp?v=1756691843","width":2000},{"alt":null,"id":25982476943459,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e07152d911a9d234f883303eeac5572fd1447a6.webp?v=1756691844"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e07152d911a9d234f883303eeac5572fd1447a6.webp?v=1756691844","width":2000},{"alt":null,"id":25982477172835,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/daf8b6e305134faaddb7daeeef2549984d7c4d86.webp?v=1756691845"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/daf8b6e305134faaddb7daeeef2549984d7c4d86.webp?v=1756691845","width":2000},{"alt":null,"id":25982477369443,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b344efb3c7b6e278968d9bb4042a99ba29f2f02d.webp?v=1756691845"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b344efb3c7b6e278968d9bb4042a99ba29f2f02d.webp?v=1756691845","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43658810982499,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34410160914531,"product_id":7873336311907,"position":3,"created_at":"2025-09-01T09:57:17+08:00","updated_at":"2025-09-01T09:57:19+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b359f4c1da7b74220da3edacf86614761c44ca76.webp?v=1756691839","variant_ids":[43658810982499]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Keigo Deep Sea - 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-KEI09","featured_media":{"alt":null,"id":25982475894883,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b359f4c1da7b74220da3edacf86614761c44ca76.webp?v=1756691839"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658811015267,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34410161504355,"product_id":7873336311907,"position":6,"created_at":"2025-09-01T09:57:19+08:00","updated_at":"2025-09-01T09:57:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bea862456e96770c06a603884cc620820edd7ef0.webp?v=1756691841","variant_ids":[43658811015267]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Keigo Deep Sea - 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-KEI09","featured_media":{"alt":null,"id":25982476484707,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bea862456e96770c06a603884cc620820edd7ef0.webp?v=1756691841"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658811113571,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34410160750691,"product_id":7873336311907,"position":2,"created_at":"2025-09-01T09:57:16+08:00","updated_at":"2025-09-01T09:57:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e1e3b8e27bbc106371422f6527e98b370dd86bb.webp?v=1756691838","variant_ids":[43658811113571]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Keigo Deep Sea - 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-KEI09","featured_media":{"alt":null,"id":25982475731043,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e1e3b8e27bbc106371422f6527e98b370dd86bb.webp?v=1756691838"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658811146339,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34410161700963,"product_id":7873336311907,"position":7,"created_at":"2025-09-01T09:57:20+08:00","updated_at":"2025-09-01T09:57:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/200250e4527620778e5b5918ce5eab7929ab19bd.webp?v=1756691842","variant_ids":[43658811146339]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Keigo Deep Sea - 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-KEI09","featured_media":{"alt":null,"id":25982476681315,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/200250e4527620778e5b5918ce5eab7929ab19bd.webp?v=1756691842"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658811244643,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34410161864803,"product_id":7873336311907,"position":8,"created_at":"2025-09-01T09:57:21+08:00","updated_at":"2025-09-01T09:57:23+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca1b0c3bb3c0eaea6f4373d40c4bb922aa7579ac.webp?v=1756691843","variant_ids":[43658811244643]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Keigo Deep Sea - 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-KEI09","featured_media":{"alt":null,"id":25982476845155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca1b0c3bb3c0eaea6f4373d40c4bb922aa7579ac.webp?v=1756691843"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43658810982499,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34410160914531,"product_id":7873336311907,"position":3,"created_at":"2025-09-01T09:57:17+08:00","updated_at":"2025-09-01T09:57:19+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b359f4c1da7b74220da3edacf86614761c44ca76.webp?v=1756691839","variant_ids":[43658810982499]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Keigo Deep Sea - 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-KEI09","featured_media":{"alt":null,"id":25982475894883,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b359f4c1da7b74220da3edacf86614761c44ca76.webp?v=1756691839"}},"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: "停產" }