$product = {"id":7888435380323,"title":"iPhone XR SolidSuit 布朗尼 annnbrownie 線條熊熊","handle":"iphone-xr-solidsuit-classic-es08","description":null,"published_at":"2025-09-22T17:32:35+08:00","created_at":"2025-09-22T15:43:22+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-annnbrownie","device-iPhone XR","merge","reseller-annnbrownie"],"price":83000,"price_min":83000,"price_max":83000,"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":43743108399203,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"SST01085O8-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":36346131939427,"product_id":7888435380323,"position":10,"created_at":"2026-07-22T16:18:55+08:00","updated_at":"2026-07-22T16:18:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3939cd1da619637462b1eedd826398aeaaeaa5ef_9e629397-e79f-40e0-99dc-c0f6f48f59fc.webp?v=1784708337","variant_ids":[43743108399203]},"available":true,"name":"iPhone XR SolidSuit 布朗尼 annnbrownie 線條熊熊 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01085O8-ES08","featured_media":{"alt":null,"id":27849989783651,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3939cd1da619637462b1eedd826398aeaaeaa5ef_9e629397-e79f-40e0-99dc-c0f6f48f59fc.webp?v=1784708337"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743108431971,"title":"White","option1":"White","option2":null,"option3":null,"sku":"SST0108553-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":36346131710051,"product_id":7888435380323,"position":9,"created_at":"2026-07-22T16:18:54+08:00","updated_at":"2026-07-22T16:18:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c51cba0b3c287c5957326619fb7aae97fb507dd_896b87a5-678a-44f5-8c62-c3631a7651d1.webp?v=1784708336","variant_ids":[43743108431971]},"available":true,"name":"iPhone XR SolidSuit 布朗尼 annnbrownie 線條熊熊 - White","public_title":"White","options":["White"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0108553-ES08","featured_media":{"alt":null,"id":27849989554275,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c51cba0b3c287c5957326619fb7aae97fb507dd_896b87a5-678a-44f5-8c62-c3631a7651d1.webp?v=1784708336"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743108464739,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0108552-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":36346132267107,"product_id":7888435380323,"position":11,"created_at":"2026-07-22T16:18:55+08:00","updated_at":"2026-07-22T16:18:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b1bfb8cb1cb782b66a332e46ef2b1bd520b2730_4532eaba-d7b4-4e18-be33-2d80eb430a16.webp?v=1784708337","variant_ids":[43743108464739]},"available":true,"name":"iPhone XR SolidSuit 布朗尼 annnbrownie 線條熊熊 - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0108552-ES08","featured_media":{"alt":null,"id":27849990078563,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b1bfb8cb1cb782b66a332e46ef2b1bd520b2730_4532eaba-d7b4-4e18-be33-2d80eb430a16.webp?v=1784708337"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743108530275,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"SST0108557-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":36346131415139,"product_id":7888435380323,"position":8,"created_at":"2026-07-22T16:18:54+08:00","updated_at":"2026-07-22T16:18:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/75709d6418303ccc751648b03e3e9387eab70c52_77f27f50-3dc7-44d5-ae50-6578fdd525eb.webp?v=1784708336","variant_ids":[43743108530275]},"available":true,"name":"iPhone XR SolidSuit 布朗尼 annnbrownie 線條熊熊 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0108557-ES08","featured_media":{"alt":null,"id":27849989259363,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/75709d6418303ccc751648b03e3e9387eab70c52_77f27f50-3dc7-44d5-ae50-6578fdd525eb.webp?v=1784708336"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c51cba0b3c287c5957326619fb7aae97fb507dd.webp?v=1758527008","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/75709d6418303ccc751648b03e3e9387eab70c52.webp?v=1758527008","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44fc10ea917aadc958758f512926db221901a050.webp?v=1758527008","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5237cf1579330d3069fc1da1e776e6595d650b2f.webp?v=1758527009","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b0dd51909691d07ede2b358d2d623a5175ebf3e.webp?v=1758527010","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b1bfb8cb1cb782b66a332e46ef2b1bd520b2730.webp?v=1758527010","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3939cd1da619637462b1eedd826398aeaaeaa5ef.webp?v=1758527011","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/75709d6418303ccc751648b03e3e9387eab70c52_77f27f50-3dc7-44d5-ae50-6578fdd525eb.webp?v=1784708336","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c51cba0b3c287c5957326619fb7aae97fb507dd_896b87a5-678a-44f5-8c62-c3631a7651d1.webp?v=1784708336","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3939cd1da619637462b1eedd826398aeaaeaa5ef_9e629397-e79f-40e0-99dc-c0f6f48f59fc.webp?v=1784708337","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b1bfb8cb1cb782b66a332e46ef2b1bd520b2730_4532eaba-d7b4-4e18-be33-2d80eb430a16.webp?v=1784708337","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5237cf1579330d3069fc1da1e776e6595d650b2f_91cace8b-941d-4515-95dd-593e7e380f57.webp?v=1784708338"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c51cba0b3c287c5957326619fb7aae97fb507dd.webp?v=1758527008","options":["color"],"media":[{"alt":null,"id":26084852334691,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c51cba0b3c287c5957326619fb7aae97fb507dd.webp?v=1758527008"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c51cba0b3c287c5957326619fb7aae97fb507dd.webp?v=1758527008","width":2000},{"alt":null,"id":26084852564067,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/75709d6418303ccc751648b03e3e9387eab70c52.webp?v=1758527008"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/75709d6418303ccc751648b03e3e9387eab70c52.webp?v=1758527008","width":2000},{"alt":null,"id":26084852727907,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44fc10ea917aadc958758f512926db221901a050.webp?v=1758527008"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44fc10ea917aadc958758f512926db221901a050.webp?v=1758527008","width":2000},{"alt":null,"id":26084852858979,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5237cf1579330d3069fc1da1e776e6595d650b2f.webp?v=1758527009"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5237cf1579330d3069fc1da1e776e6595d650b2f.webp?v=1758527009","width":2000},{"alt":null,"id":26084853022819,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b0dd51909691d07ede2b358d2d623a5175ebf3e.webp?v=1758527010"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b0dd51909691d07ede2b358d2d623a5175ebf3e.webp?v=1758527010","width":2000},{"alt":null,"id":26084853219427,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b1bfb8cb1cb782b66a332e46ef2b1bd520b2730.webp?v=1758527010"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b1bfb8cb1cb782b66a332e46ef2b1bd520b2730.webp?v=1758527010","width":2000},{"alt":null,"id":26084853350499,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3939cd1da619637462b1eedd826398aeaaeaa5ef.webp?v=1758527011"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3939cd1da619637462b1eedd826398aeaaeaa5ef.webp?v=1758527011","width":2000},{"alt":null,"id":27849989259363,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/75709d6418303ccc751648b03e3e9387eab70c52_77f27f50-3dc7-44d5-ae50-6578fdd525eb.webp?v=1784708336"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/75709d6418303ccc751648b03e3e9387eab70c52_77f27f50-3dc7-44d5-ae50-6578fdd525eb.webp?v=1784708336","width":2000},{"alt":null,"id":27849989554275,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c51cba0b3c287c5957326619fb7aae97fb507dd_896b87a5-678a-44f5-8c62-c3631a7651d1.webp?v=1784708336"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c51cba0b3c287c5957326619fb7aae97fb507dd_896b87a5-678a-44f5-8c62-c3631a7651d1.webp?v=1784708336","width":2000},{"alt":null,"id":27849989783651,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3939cd1da619637462b1eedd826398aeaaeaa5ef_9e629397-e79f-40e0-99dc-c0f6f48f59fc.webp?v=1784708337"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3939cd1da619637462b1eedd826398aeaaeaa5ef_9e629397-e79f-40e0-99dc-c0f6f48f59fc.webp?v=1784708337","width":2000},{"alt":null,"id":27849990078563,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b1bfb8cb1cb782b66a332e46ef2b1bd520b2730_4532eaba-d7b4-4e18-be33-2d80eb430a16.webp?v=1784708337"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b1bfb8cb1cb782b66a332e46ef2b1bd520b2730_4532eaba-d7b4-4e18-be33-2d80eb430a16.webp?v=1784708337","width":2000},{"alt":null,"id":27849990406243,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5237cf1579330d3069fc1da1e776e6595d650b2f_91cace8b-941d-4515-95dd-593e7e380f57.webp?v=1784708338"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5237cf1579330d3069fc1da1e776e6595d650b2f_91cace8b-941d-4515-95dd-593e7e380f57.webp?v=1784708338","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43743108399203,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"SST01085O8-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":36346131939427,"product_id":7888435380323,"position":10,"created_at":"2026-07-22T16:18:55+08:00","updated_at":"2026-07-22T16:18:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3939cd1da619637462b1eedd826398aeaaeaa5ef_9e629397-e79f-40e0-99dc-c0f6f48f59fc.webp?v=1784708337","variant_ids":[43743108399203]},"available":true,"name":"iPhone XR SolidSuit 布朗尼 annnbrownie 線條熊熊 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01085O8-ES08","featured_media":{"alt":null,"id":27849989783651,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3939cd1da619637462b1eedd826398aeaaeaa5ef_9e629397-e79f-40e0-99dc-c0f6f48f59fc.webp?v=1784708337"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743108431971,"title":"White","option1":"White","option2":null,"option3":null,"sku":"SST0108553-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":36346131710051,"product_id":7888435380323,"position":9,"created_at":"2026-07-22T16:18:54+08:00","updated_at":"2026-07-22T16:18:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c51cba0b3c287c5957326619fb7aae97fb507dd_896b87a5-678a-44f5-8c62-c3631a7651d1.webp?v=1784708336","variant_ids":[43743108431971]},"available":true,"name":"iPhone XR SolidSuit 布朗尼 annnbrownie 線條熊熊 - White","public_title":"White","options":["White"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0108553-ES08","featured_media":{"alt":null,"id":27849989554275,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c51cba0b3c287c5957326619fb7aae97fb507dd_896b87a5-678a-44f5-8c62-c3631a7651d1.webp?v=1784708336"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743108464739,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0108552-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":36346132267107,"product_id":7888435380323,"position":11,"created_at":"2026-07-22T16:18:55+08:00","updated_at":"2026-07-22T16:18:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b1bfb8cb1cb782b66a332e46ef2b1bd520b2730_4532eaba-d7b4-4e18-be33-2d80eb430a16.webp?v=1784708337","variant_ids":[43743108464739]},"available":true,"name":"iPhone XR SolidSuit 布朗尼 annnbrownie 線條熊熊 - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0108552-ES08","featured_media":{"alt":null,"id":27849990078563,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b1bfb8cb1cb782b66a332e46ef2b1bd520b2730_4532eaba-d7b4-4e18-be33-2d80eb430a16.webp?v=1784708337"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743108530275,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"SST0108557-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":36346131415139,"product_id":7888435380323,"position":8,"created_at":"2026-07-22T16:18:54+08:00","updated_at":"2026-07-22T16:18:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/75709d6418303ccc751648b03e3e9387eab70c52_77f27f50-3dc7-44d5-ae50-6578fdd525eb.webp?v=1784708336","variant_ids":[43743108530275]},"available":true,"name":"iPhone XR SolidSuit 布朗尼 annnbrownie 線條熊熊 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0108557-ES08","featured_media":{"alt":null,"id":27849989259363,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/75709d6418303ccc751648b03e3e9387eab70c52_77f27f50-3dc7-44d5-ae50-6578fdd525eb.webp?v=1784708336"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43743108399203,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"SST01085O8-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":36346131939427,"product_id":7888435380323,"position":10,"created_at":"2026-07-22T16:18:55+08:00","updated_at":"2026-07-22T16:18:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3939cd1da619637462b1eedd826398aeaaeaa5ef_9e629397-e79f-40e0-99dc-c0f6f48f59fc.webp?v=1784708337","variant_ids":[43743108399203]},"available":true,"name":"iPhone XR SolidSuit 布朗尼 annnbrownie 線條熊熊 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01085O8-ES08","featured_media":{"alt":null,"id":27849989783651,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3939cd1da619637462b1eedd826398aeaaeaa5ef_9e629397-e79f-40e0-99dc-c0f6f48f59fc.webp?v=1784708337"}},"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: "停產" }