$product = {"id":7931296383075,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 白白日記 By Darylhochi OOOPS!!","handle":"iphone-12-pro-mod-nx-magsafe-ei80","description":null,"published_at":"2025-11-28T11:00:00+08:00","created_at":"2025-11-28T10:17:15+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-darylhochi","device-iPhone 12 Pro","merge","reseller-darylhochi"],"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":43860907196515,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-EI80","requires_shipping":true,"taxable":true,"featured_image":{"id":34861686095971,"product_id":7931296383075,"position":10,"created_at":"2025-11-28T10:18:34+08:00","updated_at":"2025-11-28T10:18:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775ec6ed8d14bf0992d2f79710444a52a1db8036.webp?v=1764296316","variant_ids":[43860907196515]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 白白日記 By Darylhochi OOOPS!! - 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-EI80","featured_media":{"alt":null,"id":26426105593955,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775ec6ed8d14bf0992d2f79710444a52a1db8036.webp?v=1764296316"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860910866531,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-EI80","requires_shipping":true,"taxable":true,"featured_image":{"id":34861651034211,"product_id":7931296383075,"position":1,"created_at":"2025-11-28T10:17:21+08:00","updated_at":"2025-11-28T10:17:23+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6bd610fd73b84876f00c527e4c46a4fb384f00f4.webp?v=1764296243","variant_ids":[43860910866531]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 白白日記 By Darylhochi OOOPS!! - 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-EI80","featured_media":{"alt":null,"id":26426070499427,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6bd610fd73b84876f00c527e4c46a4fb384f00f4.webp?v=1764296243"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860910899299,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-EI80","requires_shipping":true,"taxable":true,"featured_image":{"id":34861670137955,"product_id":7931296383075,"position":6,"created_at":"2025-11-28T10:17:50+08:00","updated_at":"2025-11-28T10:17:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e840f0056b0ff4d61b0174275823768caee531f.webp?v=1764296272","variant_ids":[43860910899299]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 白白日記 By Darylhochi OOOPS!! - 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-EI80","featured_media":{"alt":null,"id":26426089635939,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e840f0056b0ff4d61b0174275823768caee531f.webp?v=1764296272"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860911030371,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-EI80","requires_shipping":true,"taxable":true,"featured_image":{"id":34861685571683,"product_id":7931296383075,"position":9,"created_at":"2025-11-28T10:18:28+08:00","updated_at":"2025-11-28T10:18:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf6b9dbcffdef3be290f205e08202a01aa2da710.webp?v=1764296310","variant_ids":[43860911030371]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 白白日記 By Darylhochi OOOPS!! - 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-EI80","featured_media":{"alt":null,"id":26426105069667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf6b9dbcffdef3be290f205e08202a01aa2da710.webp?v=1764296310"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860911063139,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-EI80","requires_shipping":true,"taxable":true,"featured_image":{"id":34861653065827,"product_id":7931296383075,"position":5,"created_at":"2025-11-28T10:17:31+08:00","updated_at":"2025-11-28T10:17:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d601e04d261d091938655fc12738b09ab4f29c66.webp?v=1764296252","variant_ids":[43860911063139]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 白白日記 By Darylhochi OOOPS!! - 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-EI80","featured_media":{"alt":null,"id":26426072531043,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d601e04d261d091938655fc12738b09ab4f29c66.webp?v=1764296252"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6bd610fd73b84876f00c527e4c46a4fb384f00f4.webp?v=1764296243","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f451a86c886b736bdd325c5f3804c1c6ba6a2b74.webp?v=1764296244","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02628c86ad2345af1f2c617b6d8fff1d672b616a.webp?v=1764296245","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/828df0f476f5b6d4350801b40cf9940096975503.webp?v=1764296245","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d601e04d261d091938655fc12738b09ab4f29c66.webp?v=1764296252","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e840f0056b0ff4d61b0174275823768caee531f.webp?v=1764296272","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a0a7877f656b133e6a2b7546583185c87dc6cd41.webp?v=1764296307","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2b4b794979db73d4d4adcc2057aae242927783eb.webp?v=1764296309","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf6b9dbcffdef3be290f205e08202a01aa2da710.webp?v=1764296310","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775ec6ed8d14bf0992d2f79710444a52a1db8036.webp?v=1764296316","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d110c3a2cecdf1d50bfce89bfaf3bdd7ad5494c.webp?v=1764296321"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6bd610fd73b84876f00c527e4c46a4fb384f00f4.webp?v=1764296243","options":["color"],"media":[{"alt":null,"id":26426070499427,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6bd610fd73b84876f00c527e4c46a4fb384f00f4.webp?v=1764296243"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6bd610fd73b84876f00c527e4c46a4fb384f00f4.webp?v=1764296243","width":2000},{"alt":null,"id":26426070892643,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f451a86c886b736bdd325c5f3804c1c6ba6a2b74.webp?v=1764296244"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f451a86c886b736bdd325c5f3804c1c6ba6a2b74.webp?v=1764296244","width":2000},{"alt":null,"id":26426070990947,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02628c86ad2345af1f2c617b6d8fff1d672b616a.webp?v=1764296245"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02628c86ad2345af1f2c617b6d8fff1d672b616a.webp?v=1764296245","width":2000},{"alt":null,"id":26426071122019,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/828df0f476f5b6d4350801b40cf9940096975503.webp?v=1764296245"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/828df0f476f5b6d4350801b40cf9940096975503.webp?v=1764296245","width":2000},{"alt":null,"id":26426072531043,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d601e04d261d091938655fc12738b09ab4f29c66.webp?v=1764296252"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d601e04d261d091938655fc12738b09ab4f29c66.webp?v=1764296252","width":2000},{"alt":null,"id":26426089635939,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e840f0056b0ff4d61b0174275823768caee531f.webp?v=1764296272"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e840f0056b0ff4d61b0174275823768caee531f.webp?v=1764296272","width":2000},{"alt":null,"id":26426104774755,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a0a7877f656b133e6a2b7546583185c87dc6cd41.webp?v=1764296307"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a0a7877f656b133e6a2b7546583185c87dc6cd41.webp?v=1764296307","width":2000},{"alt":null,"id":26426104873059,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2b4b794979db73d4d4adcc2057aae242927783eb.webp?v=1764296309"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2b4b794979db73d4d4adcc2057aae242927783eb.webp?v=1764296309","width":2000},{"alt":null,"id":26426105069667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf6b9dbcffdef3be290f205e08202a01aa2da710.webp?v=1764296310"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf6b9dbcffdef3be290f205e08202a01aa2da710.webp?v=1764296310","width":2000},{"alt":null,"id":26426105593955,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775ec6ed8d14bf0992d2f79710444a52a1db8036.webp?v=1764296316"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775ec6ed8d14bf0992d2f79710444a52a1db8036.webp?v=1764296316","width":2000},{"alt":null,"id":26426105856099,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d110c3a2cecdf1d50bfce89bfaf3bdd7ad5494c.webp?v=1764296321"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d110c3a2cecdf1d50bfce89bfaf3bdd7ad5494c.webp?v=1764296321","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43860907196515,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-EI80","requires_shipping":true,"taxable":true,"featured_image":{"id":34861686095971,"product_id":7931296383075,"position":10,"created_at":"2025-11-28T10:18:34+08:00","updated_at":"2025-11-28T10:18:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775ec6ed8d14bf0992d2f79710444a52a1db8036.webp?v=1764296316","variant_ids":[43860907196515]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 白白日記 By Darylhochi OOOPS!! - 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-EI80","featured_media":{"alt":null,"id":26426105593955,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775ec6ed8d14bf0992d2f79710444a52a1db8036.webp?v=1764296316"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860910866531,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-EI80","requires_shipping":true,"taxable":true,"featured_image":{"id":34861651034211,"product_id":7931296383075,"position":1,"created_at":"2025-11-28T10:17:21+08:00","updated_at":"2025-11-28T10:17:23+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6bd610fd73b84876f00c527e4c46a4fb384f00f4.webp?v=1764296243","variant_ids":[43860910866531]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 白白日記 By Darylhochi OOOPS!! - 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-EI80","featured_media":{"alt":null,"id":26426070499427,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6bd610fd73b84876f00c527e4c46a4fb384f00f4.webp?v=1764296243"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860910899299,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-EI80","requires_shipping":true,"taxable":true,"featured_image":{"id":34861670137955,"product_id":7931296383075,"position":6,"created_at":"2025-11-28T10:17:50+08:00","updated_at":"2025-11-28T10:17:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e840f0056b0ff4d61b0174275823768caee531f.webp?v=1764296272","variant_ids":[43860910899299]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 白白日記 By Darylhochi OOOPS!! - 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-EI80","featured_media":{"alt":null,"id":26426089635939,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e840f0056b0ff4d61b0174275823768caee531f.webp?v=1764296272"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860911030371,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-EI80","requires_shipping":true,"taxable":true,"featured_image":{"id":34861685571683,"product_id":7931296383075,"position":9,"created_at":"2025-11-28T10:18:28+08:00","updated_at":"2025-11-28T10:18:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf6b9dbcffdef3be290f205e08202a01aa2da710.webp?v=1764296310","variant_ids":[43860911030371]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 白白日記 By Darylhochi OOOPS!! - 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-EI80","featured_media":{"alt":null,"id":26426105069667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf6b9dbcffdef3be290f205e08202a01aa2da710.webp?v=1764296310"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860911063139,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-EI80","requires_shipping":true,"taxable":true,"featured_image":{"id":34861653065827,"product_id":7931296383075,"position":5,"created_at":"2025-11-28T10:17:31+08:00","updated_at":"2025-11-28T10:17:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d601e04d261d091938655fc12738b09ab4f29c66.webp?v=1764296252","variant_ids":[43860911063139]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 白白日記 By Darylhochi OOOPS!! - 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-EI80","featured_media":{"alt":null,"id":26426072531043,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d601e04d261d091938655fc12738b09ab4f29c66.webp?v=1764296252"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43860907196515,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-EI80","requires_shipping":true,"taxable":true,"featured_image":{"id":34861686095971,"product_id":7931296383075,"position":10,"created_at":"2025-11-28T10:18:34+08:00","updated_at":"2025-11-28T10:18:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775ec6ed8d14bf0992d2f79710444a52a1db8036.webp?v=1764296316","variant_ids":[43860907196515]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 白白日記 By Darylhochi OOOPS!! - 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-EI80","featured_media":{"alt":null,"id":26426105593955,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775ec6ed8d14bf0992d2f79710444a52a1db8036.webp?v=1764296316"}},"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: "停產" }