$product = {"id":7931628814435,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 產房 • 廢料棲息地 海龜這座城市","handle":"iphone-12-pro-mod-nx-magsafe-bir02","description":null,"published_at":"2026-01-27T14:22:37+08:00","created_at":"2025-11-28T11:17:15+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-everydayishappybirthday","device-iPhone 12 Pro","merge","reseller-everydayishappybirthday"],"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":43861345992803,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-BIR02","requires_shipping":true,"taxable":true,"featured_image":{"id":34863681568867,"product_id":7931628814435,"position":6,"created_at":"2025-11-28T11:17:22+08:00","updated_at":"2025-11-28T11:17:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/11b2c7bd6d9845b076c049424972711b7a0819ec.webp?v=1764299844","variant_ids":[43861345992803]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 產房 • 廢料棲息地 海龜這座城市 - 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-BIR02","featured_media":{"alt":null,"id":26428100608099,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/11b2c7bd6d9845b076c049424972711b7a0819ec.webp?v=1764299844"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43861348057187,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-BIR02","requires_shipping":true,"taxable":true,"featured_image":{"id":34863681732707,"product_id":7931628814435,"position":9,"created_at":"2025-11-28T11:17:23+08:00","updated_at":"2025-11-28T11:17:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02f44d5d52e66c2f6881898b93465589a5bca328.webp?v=1764299845","variant_ids":[43861348057187]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 產房 • 廢料棲息地 海龜這座城市 - 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-BIR02","featured_media":{"alt":null,"id":26428100771939,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02f44d5d52e66c2f6881898b93465589a5bca328.webp?v=1764299845"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43861348089955,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-BIR02","requires_shipping":true,"taxable":true,"featured_image":{"id":34863681208419,"product_id":7931628814435,"position":4,"created_at":"2025-11-28T11:17:21+08:00","updated_at":"2025-11-28T11:17:23+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/556df7bbc182cab628e38790745470c2c2f1d937.webp?v=1764299843","variant_ids":[43861348089955]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 產房 • 廢料棲息地 海龜這座城市 - 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-BIR02","featured_media":{"alt":null,"id":26428100411491,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/556df7bbc182cab628e38790745470c2c2f1d937.webp?v=1764299843"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43861348253795,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-BIR02","requires_shipping":true,"taxable":true,"featured_image":{"id":34863682027619,"product_id":7931628814435,"position":11,"created_at":"2025-11-28T11:17:24+08:00","updated_at":"2025-11-28T11:17:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a2e23c1941d7da0dd52d61bc1badb8c3320fe82.webp?v=1764299846","variant_ids":[43861348253795]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 產房 • 廢料棲息地 海龜這座城市 - 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-BIR02","featured_media":{"alt":null,"id":26428101066851,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a2e23c1941d7da0dd52d61bc1badb8c3320fe82.webp?v=1764299846"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43861348352099,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-BIR02","requires_shipping":true,"taxable":true,"featured_image":{"id":34863681863779,"product_id":7931628814435,"position":10,"created_at":"2025-11-28T11:17:24+08:00","updated_at":"2025-11-28T11:17:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/addd69d9562a0f18d417089095f7aa5849b117ef.webp?v=1764299845","variant_ids":[43861348352099]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 產房 • 廢料棲息地 海龜這座城市 - 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-BIR02","featured_media":{"alt":null,"id":26428100903011,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/addd69d9562a0f18d417089095f7aa5849b117ef.webp?v=1764299845"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e735f041a3697bfefa775d26395948c6d381417.webp?v=1764299842","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/09bea604c510e813da13c23e0d2c0a9c99a958be.webp?v=1764299842","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/20c352a283adb7b57d39b52837840ab6b0830d43.webp?v=1764299842","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/556df7bbc182cab628e38790745470c2c2f1d937.webp?v=1764299843","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e1d7b4bc8472f509783bbc5c301efb6c43e23f8.webp?v=1764299844","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/11b2c7bd6d9845b076c049424972711b7a0819ec.webp?v=1764299844","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0c66cd46c6d50c3fb001c893bedf161a252249a0.webp?v=1764299844","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81059f4e0abf112ca3857aee4e6c919a7a9f948f.webp?v=1764299845","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02f44d5d52e66c2f6881898b93465589a5bca328.webp?v=1764299845","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/addd69d9562a0f18d417089095f7aa5849b117ef.webp?v=1764299845","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a2e23c1941d7da0dd52d61bc1badb8c3320fe82.webp?v=1764299846"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e735f041a3697bfefa775d26395948c6d381417.webp?v=1764299842","options":["color"],"media":[{"alt":null,"id":26428100018275,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e735f041a3697bfefa775d26395948c6d381417.webp?v=1764299842"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e735f041a3697bfefa775d26395948c6d381417.webp?v=1764299842","width":2000},{"alt":null,"id":26428100149347,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/09bea604c510e813da13c23e0d2c0a9c99a958be.webp?v=1764299842"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/09bea604c510e813da13c23e0d2c0a9c99a958be.webp?v=1764299842","width":2000},{"alt":null,"id":26428100247651,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/20c352a283adb7b57d39b52837840ab6b0830d43.webp?v=1764299842"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/20c352a283adb7b57d39b52837840ab6b0830d43.webp?v=1764299842","width":2000},{"alt":null,"id":26428100411491,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/556df7bbc182cab628e38790745470c2c2f1d937.webp?v=1764299843"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/556df7bbc182cab628e38790745470c2c2f1d937.webp?v=1764299843","width":2000},{"alt":null,"id":26428100575331,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e1d7b4bc8472f509783bbc5c301efb6c43e23f8.webp?v=1764299844"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e1d7b4bc8472f509783bbc5c301efb6c43e23f8.webp?v=1764299844","width":2000},{"alt":null,"id":26428100608099,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/11b2c7bd6d9845b076c049424972711b7a0819ec.webp?v=1764299844"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/11b2c7bd6d9845b076c049424972711b7a0819ec.webp?v=1764299844","width":2000},{"alt":null,"id":26428100673635,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0c66cd46c6d50c3fb001c893bedf161a252249a0.webp?v=1764299844"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0c66cd46c6d50c3fb001c893bedf161a252249a0.webp?v=1764299844","width":2000},{"alt":null,"id":26428100706403,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81059f4e0abf112ca3857aee4e6c919a7a9f948f.webp?v=1764299845"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81059f4e0abf112ca3857aee4e6c919a7a9f948f.webp?v=1764299845","width":2000},{"alt":null,"id":26428100771939,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02f44d5d52e66c2f6881898b93465589a5bca328.webp?v=1764299845"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02f44d5d52e66c2f6881898b93465589a5bca328.webp?v=1764299845","width":2000},{"alt":null,"id":26428100903011,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/addd69d9562a0f18d417089095f7aa5849b117ef.webp?v=1764299845"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/addd69d9562a0f18d417089095f7aa5849b117ef.webp?v=1764299845","width":2000},{"alt":null,"id":26428101066851,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a2e23c1941d7da0dd52d61bc1badb8c3320fe82.webp?v=1764299846"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a2e23c1941d7da0dd52d61bc1badb8c3320fe82.webp?v=1764299846","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43861345992803,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-BIR02","requires_shipping":true,"taxable":true,"featured_image":{"id":34863681568867,"product_id":7931628814435,"position":6,"created_at":"2025-11-28T11:17:22+08:00","updated_at":"2025-11-28T11:17:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/11b2c7bd6d9845b076c049424972711b7a0819ec.webp?v=1764299844","variant_ids":[43861345992803]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 產房 • 廢料棲息地 海龜這座城市 - 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-BIR02","featured_media":{"alt":null,"id":26428100608099,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/11b2c7bd6d9845b076c049424972711b7a0819ec.webp?v=1764299844"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43861348057187,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-BIR02","requires_shipping":true,"taxable":true,"featured_image":{"id":34863681732707,"product_id":7931628814435,"position":9,"created_at":"2025-11-28T11:17:23+08:00","updated_at":"2025-11-28T11:17:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02f44d5d52e66c2f6881898b93465589a5bca328.webp?v=1764299845","variant_ids":[43861348057187]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 產房 • 廢料棲息地 海龜這座城市 - 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-BIR02","featured_media":{"alt":null,"id":26428100771939,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02f44d5d52e66c2f6881898b93465589a5bca328.webp?v=1764299845"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43861348089955,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-BIR02","requires_shipping":true,"taxable":true,"featured_image":{"id":34863681208419,"product_id":7931628814435,"position":4,"created_at":"2025-11-28T11:17:21+08:00","updated_at":"2025-11-28T11:17:23+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/556df7bbc182cab628e38790745470c2c2f1d937.webp?v=1764299843","variant_ids":[43861348089955]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 產房 • 廢料棲息地 海龜這座城市 - 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-BIR02","featured_media":{"alt":null,"id":26428100411491,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/556df7bbc182cab628e38790745470c2c2f1d937.webp?v=1764299843"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43861348253795,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-BIR02","requires_shipping":true,"taxable":true,"featured_image":{"id":34863682027619,"product_id":7931628814435,"position":11,"created_at":"2025-11-28T11:17:24+08:00","updated_at":"2025-11-28T11:17:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a2e23c1941d7da0dd52d61bc1badb8c3320fe82.webp?v=1764299846","variant_ids":[43861348253795]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 產房 • 廢料棲息地 海龜這座城市 - 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-BIR02","featured_media":{"alt":null,"id":26428101066851,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a2e23c1941d7da0dd52d61bc1badb8c3320fe82.webp?v=1764299846"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43861348352099,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-BIR02","requires_shipping":true,"taxable":true,"featured_image":{"id":34863681863779,"product_id":7931628814435,"position":10,"created_at":"2025-11-28T11:17:24+08:00","updated_at":"2025-11-28T11:17:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/addd69d9562a0f18d417089095f7aa5849b117ef.webp?v=1764299845","variant_ids":[43861348352099]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 產房 • 廢料棲息地 海龜這座城市 - 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-BIR02","featured_media":{"alt":null,"id":26428100903011,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/addd69d9562a0f18d417089095f7aa5849b117ef.webp?v=1764299845"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43861345992803,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-BIR02","requires_shipping":true,"taxable":true,"featured_image":{"id":34863681568867,"product_id":7931628814435,"position":6,"created_at":"2025-11-28T11:17:22+08:00","updated_at":"2025-11-28T11:17:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/11b2c7bd6d9845b076c049424972711b7a0819ec.webp?v=1764299844","variant_ids":[43861345992803]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 產房 • 廢料棲息地 海龜這座城市 - 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-BIR02","featured_media":{"alt":null,"id":26428100608099,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/11b2c7bd6d9845b076c049424972711b7a0819ec.webp?v=1764299844"}},"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: "停產" }