$product = {"id":7888477323363,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 布朗尼 annnbrownie 晚安熊熊","handle":"iphone-12-pro-mod-nx-magsafe-printable-es06","description":null,"published_at":"2025-09-23T09:15:13+08:00","created_at":"2025-09-22T15:52:42+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-annnbrownie","device-iPhone 12 Pro","merge","reseller-annnbrownie"],"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":43743263916131,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-ES06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514575753315,"product_id":7888477323363,"position":3,"created_at":"2025-09-22T15:52:47+08:00","updated_at":"2025-09-22T15:52:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63cd36c24aab966ee173def473762cb416a6462a.webp?v=1758527569","variant_ids":[43743263916131]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 布朗尼 annnbrownie 晚安熊熊 - 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-ES06","featured_media":{"alt":null,"id":26085018239075,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63cd36c24aab966ee173def473762cb416a6462a.webp?v=1758527569"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743267913827,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-ES06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514575360099,"product_id":7888477323363,"position":2,"created_at":"2025-09-22T15:52:46+08:00","updated_at":"2025-09-22T15:52:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce00b6026c427b27881d144c5223076fd65ffcc5.webp?v=1758527568","variant_ids":[43743267913827]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 布朗尼 annnbrownie 晚安熊熊 - 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-ES06","featured_media":{"alt":null,"id":26085017845859,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce00b6026c427b27881d144c5223076fd65ffcc5.webp?v=1758527568"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743267946595,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-ES06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514576670819,"product_id":7888477323363,"position":9,"created_at":"2025-09-22T15:52:50+08:00","updated_at":"2025-09-22T15:52:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/93370181df10ad17575df68326b3bc988e1316e9.webp?v=1758527572","variant_ids":[43743267946595]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 布朗尼 annnbrownie 晚安熊熊 - 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-ES06","featured_media":{"alt":null,"id":26085019156579,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/93370181df10ad17575df68326b3bc988e1316e9.webp?v=1758527572"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743268012131,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-ES06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514575065187,"product_id":7888477323363,"position":1,"created_at":"2025-09-22T15:52:46+08:00","updated_at":"2025-09-22T15:52:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf22bf5ef76265e45a814e15eee51891e805210d.webp?v=1758527568","variant_ids":[43743268012131]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 布朗尼 annnbrownie 晚安熊熊 - 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-ES06","featured_media":{"alt":null,"id":26085017550947,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf22bf5ef76265e45a814e15eee51891e805210d.webp?v=1758527568"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743268110435,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-ES06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514575982691,"product_id":7888477323363,"position":5,"created_at":"2025-09-22T15:52:48+08:00","updated_at":"2025-09-22T15:52:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dc021a5b4f78f9c7c20c0b446ce845c11d3e6b1.webp?v=1758527570","variant_ids":[43743268110435]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 布朗尼 annnbrownie 晚安熊熊 - 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-ES06","featured_media":{"alt":null,"id":26085018468451,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dc021a5b4f78f9c7c20c0b446ce845c11d3e6b1.webp?v=1758527570"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf22bf5ef76265e45a814e15eee51891e805210d.webp?v=1758527568","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce00b6026c427b27881d144c5223076fd65ffcc5.webp?v=1758527568","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63cd36c24aab966ee173def473762cb416a6462a.webp?v=1758527569","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36639ad75bc09d0d9cfcfee0f1bf0b81593280df.webp?v=1758527569","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dc021a5b4f78f9c7c20c0b446ce845c11d3e6b1.webp?v=1758527570","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfd2f22803bdd2124d6441f8880d56a15d8a2968.webp?v=1758527570","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80c56eb1811b1eb240a1c3d79cd11af507664ec8.webp?v=1758527571","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/402ba346351166c9e4a30114cfc0128fe34d0f32.webp?v=1758527571","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/93370181df10ad17575df68326b3bc988e1316e9.webp?v=1758527572","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3470aaa532405e8ca81a82477950dca4f9251c7d.webp?v=1758527572","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dd638890351b4ac087a43a08e161b82893016af.webp?v=1758527573"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf22bf5ef76265e45a814e15eee51891e805210d.webp?v=1758527568","options":["color"],"media":[{"alt":null,"id":26085017550947,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf22bf5ef76265e45a814e15eee51891e805210d.webp?v=1758527568"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf22bf5ef76265e45a814e15eee51891e805210d.webp?v=1758527568","width":2000},{"alt":null,"id":26085017845859,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce00b6026c427b27881d144c5223076fd65ffcc5.webp?v=1758527568"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce00b6026c427b27881d144c5223076fd65ffcc5.webp?v=1758527568","width":2000},{"alt":null,"id":26085018239075,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63cd36c24aab966ee173def473762cb416a6462a.webp?v=1758527569"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63cd36c24aab966ee173def473762cb416a6462a.webp?v=1758527569","width":2000},{"alt":null,"id":26085018402915,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36639ad75bc09d0d9cfcfee0f1bf0b81593280df.webp?v=1758527569"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36639ad75bc09d0d9cfcfee0f1bf0b81593280df.webp?v=1758527569","width":2000},{"alt":null,"id":26085018468451,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dc021a5b4f78f9c7c20c0b446ce845c11d3e6b1.webp?v=1758527570"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dc021a5b4f78f9c7c20c0b446ce845c11d3e6b1.webp?v=1758527570","width":2000},{"alt":null,"id":26085018632291,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfd2f22803bdd2124d6441f8880d56a15d8a2968.webp?v=1758527570"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfd2f22803bdd2124d6441f8880d56a15d8a2968.webp?v=1758527570","width":2000},{"alt":null,"id":26085018763363,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80c56eb1811b1eb240a1c3d79cd11af507664ec8.webp?v=1758527571"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80c56eb1811b1eb240a1c3d79cd11af507664ec8.webp?v=1758527571","width":2000},{"alt":null,"id":26085018959971,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/402ba346351166c9e4a30114cfc0128fe34d0f32.webp?v=1758527571"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/402ba346351166c9e4a30114cfc0128fe34d0f32.webp?v=1758527571","width":2000},{"alt":null,"id":26085019156579,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/93370181df10ad17575df68326b3bc988e1316e9.webp?v=1758527572"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/93370181df10ad17575df68326b3bc988e1316e9.webp?v=1758527572","width":2000},{"alt":null,"id":26085019385955,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3470aaa532405e8ca81a82477950dca4f9251c7d.webp?v=1758527572"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3470aaa532405e8ca81a82477950dca4f9251c7d.webp?v=1758527572","width":2000},{"alt":null,"id":26085019648099,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dd638890351b4ac087a43a08e161b82893016af.webp?v=1758527573"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dd638890351b4ac087a43a08e161b82893016af.webp?v=1758527573","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43743263916131,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-ES06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514575753315,"product_id":7888477323363,"position":3,"created_at":"2025-09-22T15:52:47+08:00","updated_at":"2025-09-22T15:52:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63cd36c24aab966ee173def473762cb416a6462a.webp?v=1758527569","variant_ids":[43743263916131]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 布朗尼 annnbrownie 晚安熊熊 - 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-ES06","featured_media":{"alt":null,"id":26085018239075,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63cd36c24aab966ee173def473762cb416a6462a.webp?v=1758527569"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743267913827,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-ES06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514575360099,"product_id":7888477323363,"position":2,"created_at":"2025-09-22T15:52:46+08:00","updated_at":"2025-09-22T15:52:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce00b6026c427b27881d144c5223076fd65ffcc5.webp?v=1758527568","variant_ids":[43743267913827]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 布朗尼 annnbrownie 晚安熊熊 - 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-ES06","featured_media":{"alt":null,"id":26085017845859,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce00b6026c427b27881d144c5223076fd65ffcc5.webp?v=1758527568"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743267946595,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-ES06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514576670819,"product_id":7888477323363,"position":9,"created_at":"2025-09-22T15:52:50+08:00","updated_at":"2025-09-22T15:52:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/93370181df10ad17575df68326b3bc988e1316e9.webp?v=1758527572","variant_ids":[43743267946595]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 布朗尼 annnbrownie 晚安熊熊 - 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-ES06","featured_media":{"alt":null,"id":26085019156579,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/93370181df10ad17575df68326b3bc988e1316e9.webp?v=1758527572"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743268012131,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-ES06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514575065187,"product_id":7888477323363,"position":1,"created_at":"2025-09-22T15:52:46+08:00","updated_at":"2025-09-22T15:52:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf22bf5ef76265e45a814e15eee51891e805210d.webp?v=1758527568","variant_ids":[43743268012131]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 布朗尼 annnbrownie 晚安熊熊 - 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-ES06","featured_media":{"alt":null,"id":26085017550947,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf22bf5ef76265e45a814e15eee51891e805210d.webp?v=1758527568"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743268110435,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-ES06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514575982691,"product_id":7888477323363,"position":5,"created_at":"2025-09-22T15:52:48+08:00","updated_at":"2025-09-22T15:52:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dc021a5b4f78f9c7c20c0b446ce845c11d3e6b1.webp?v=1758527570","variant_ids":[43743268110435]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 布朗尼 annnbrownie 晚安熊熊 - 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-ES06","featured_media":{"alt":null,"id":26085018468451,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dc021a5b4f78f9c7c20c0b446ce845c11d3e6b1.webp?v=1758527570"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43743263916131,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-ES06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514575753315,"product_id":7888477323363,"position":3,"created_at":"2025-09-22T15:52:47+08:00","updated_at":"2025-09-22T15:52:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63cd36c24aab966ee173def473762cb416a6462a.webp?v=1758527569","variant_ids":[43743263916131]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 布朗尼 annnbrownie 晚安熊熊 - 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-ES06","featured_media":{"alt":null,"id":26085018239075,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/63cd36c24aab966ee173def473762cb416a6462a.webp?v=1758527569"}},"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: "停產" }