$product = {"id":6979360358499,"title":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Snoopy 史努比 Snoopy Take A Nap","handle":"iphone-13-pro-max-solidsuit-classic-magsafe-pl08","description":null,"published_at":"2023-08-01T16:14:33+08:00","created_at":"2023-07-25T10:00:57+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師SolidSuit專區Snoopy 史努比","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-snoopy","device-iPhone 13 Pro Max","merge","reseller-snoopy"],"price":125000,"price_min":125000,"price_max":125000,"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":43102061559907,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0123252-PL08","requires_shipping":true,"taxable":true,"featured_image":{"id":35582098473059,"product_id":6979360358499,"position":2,"created_at":"2026-04-02T16:06:07+08:00","updated_at":"2026-04-02T16:06:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/901b98c27e4040504a069b2c8b23959fc941a280.webp?v=1775117169","variant_ids":[43102061559907]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Snoopy 史努比 Snoopy Take A Nap - Black \/ Classic","public_title":"Black \/ Classic","options":["Black","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0123252-PL08","featured_media":{"alt":null,"id":27114718330979,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/901b98c27e4040504a069b2c8b23959fc941a280.webp?v=1775117169"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102061690979,"title":"Tide Blue \/ Classic","option1":"Tide Blue","option2":"Classic","option3":null,"sku":"MST01232Z9-PL08","requires_shipping":true,"taxable":true,"featured_image":{"id":35582099259491,"product_id":6979360358499,"position":5,"created_at":"2026-04-02T16:06:09+08:00","updated_at":"2026-04-02T16:06:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08b11d7534d6f282ffce7a2ce503a5f15cbd4d6b.webp?v=1775117171","variant_ids":[43102061690979]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Snoopy 史努比 Snoopy Take A Nap - Tide Blue \/ Classic","public_title":"Tide Blue \/ Classic","options":["Tide Blue","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01232Z9-PL08","featured_media":{"alt":null,"id":27114719117411,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08b11d7534d6f282ffce7a2ce503a5f15cbd4d6b.webp?v=1775117171"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102061756515,"title":"Shell Beige \/ Classic","option1":"Shell Beige","option2":"Classic","option3":null,"sku":"MST012320B-PL08","requires_shipping":true,"taxable":true,"featured_image":{"id":35582099390563,"product_id":6979360358499,"position":6,"created_at":"2026-04-02T16:06:09+08:00","updated_at":"2026-04-02T16:06:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/406f493d073a4ac3c04fd15246b0e3dd11bcfe0d.webp?v=1775117171","variant_ids":[43102061756515]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Snoopy 史努比 Snoopy Take A Nap - Shell Beige \/ Classic","public_title":"Shell Beige \/ Classic","options":["Shell Beige","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320B-PL08","featured_media":{"alt":null,"id":27114719248483,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/406f493d073a4ac3c04fd15246b0e3dd11bcfe0d.webp?v=1775117171"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102061854819,"title":"Classic Blue \/ Classic","option1":"Classic Blue","option2":"Classic","option3":null,"sku":"MST012320C-PL08","requires_shipping":true,"taxable":true,"featured_image":{"id":35582099030115,"product_id":6979360358499,"position":4,"created_at":"2026-04-02T16:06:08+08:00","updated_at":"2026-04-02T16:06:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3cb2fb0c56e1f00b9e250fb9d76ec679b49b8d.webp?v=1775117170","variant_ids":[43102061854819]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Snoopy 史努比 Snoopy Take A Nap - Classic Blue \/ Classic","public_title":"Classic Blue \/ Classic","options":["Classic Blue","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320C-PL08","featured_media":{"alt":null,"id":27114718888035,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3cb2fb0c56e1f00b9e250fb9d76ec679b49b8d.webp?v=1775117170"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102061887587,"title":"Parakeet Green \/ Classic","option1":"Parakeet Green","option2":"Classic","option3":null,"sku":"MST012320E-PL08","requires_shipping":true,"taxable":true,"featured_image":{"id":35582099554403,"product_id":6979360358499,"position":7,"created_at":"2026-04-02T16:06:10+08:00","updated_at":"2026-04-02T16:06:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c183bcb661fbff5d9540fb9588e06249176042e.webp?v=1775117172","variant_ids":[43102061887587]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Snoopy 史努比 Snoopy Take A Nap - Parakeet Green \/ Classic","public_title":"Parakeet Green \/ Classic","options":["Parakeet Green","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320E-PL08","featured_media":{"alt":null,"id":27114719412323,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c183bcb661fbff5d9540fb9588e06249176042e.webp?v=1775117172"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-PL08_a041c6ac-6356-405b-bc10-7f0d03f7688b.png?v=1690250460","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/901b98c27e4040504a069b2c8b23959fc941a280.webp?v=1775117169","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/725138a7a148b18ff9200f67ece7f3eaf2677096.webp?v=1775117170","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3cb2fb0c56e1f00b9e250fb9d76ec679b49b8d.webp?v=1775117170","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08b11d7534d6f282ffce7a2ce503a5f15cbd4d6b.webp?v=1775117171","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/406f493d073a4ac3c04fd15246b0e3dd11bcfe0d.webp?v=1775117171","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c183bcb661fbff5d9540fb9588e06249176042e.webp?v=1775117172","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8f94983f5bc7c677772d3e615d2bdb59827db342.webp?v=1775117173","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9fd73393ec3c0d92f0ce99d3cc0a92a95200b90.webp?v=1775117173"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-PL08_a041c6ac-6356-405b-bc10-7f0d03f7688b.png?v=1690250460","options":["color","Types"],"media":[{"alt":null,"id":22626272477283,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-PL08_a041c6ac-6356-405b-bc10-7f0d03f7688b.png?v=1690250460"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-PL08_a041c6ac-6356-405b-bc10-7f0d03f7688b.png?v=1690250460","width":2000},{"alt":null,"id":27114718330979,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/901b98c27e4040504a069b2c8b23959fc941a280.webp?v=1775117169"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/901b98c27e4040504a069b2c8b23959fc941a280.webp?v=1775117169","width":2000},{"alt":null,"id":27114718625891,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/725138a7a148b18ff9200f67ece7f3eaf2677096.webp?v=1775117170"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/725138a7a148b18ff9200f67ece7f3eaf2677096.webp?v=1775117170","width":2000},{"alt":null,"id":27114718888035,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3cb2fb0c56e1f00b9e250fb9d76ec679b49b8d.webp?v=1775117170"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3cb2fb0c56e1f00b9e250fb9d76ec679b49b8d.webp?v=1775117170","width":2000},{"alt":null,"id":27114719117411,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08b11d7534d6f282ffce7a2ce503a5f15cbd4d6b.webp?v=1775117171"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08b11d7534d6f282ffce7a2ce503a5f15cbd4d6b.webp?v=1775117171","width":2000},{"alt":null,"id":27114719248483,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/406f493d073a4ac3c04fd15246b0e3dd11bcfe0d.webp?v=1775117171"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/406f493d073a4ac3c04fd15246b0e3dd11bcfe0d.webp?v=1775117171","width":2000},{"alt":null,"id":27114719412323,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c183bcb661fbff5d9540fb9588e06249176042e.webp?v=1775117172"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c183bcb661fbff5d9540fb9588e06249176042e.webp?v=1775117172","width":2000},{"alt":null,"id":27114719543395,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8f94983f5bc7c677772d3e615d2bdb59827db342.webp?v=1775117173"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8f94983f5bc7c677772d3e615d2bdb59827db342.webp?v=1775117173","width":2000},{"alt":null,"id":27114719674467,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9fd73393ec3c0d92f0ce99d3cc0a92a95200b90.webp?v=1775117173"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9fd73393ec3c0d92f0ce99d3cc0a92a95200b90.webp?v=1775117173","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43102061559907,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0123252-PL08","requires_shipping":true,"taxable":true,"featured_image":{"id":35582098473059,"product_id":6979360358499,"position":2,"created_at":"2026-04-02T16:06:07+08:00","updated_at":"2026-04-02T16:06:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/901b98c27e4040504a069b2c8b23959fc941a280.webp?v=1775117169","variant_ids":[43102061559907]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Snoopy 史努比 Snoopy Take A Nap - Black \/ Classic","public_title":"Black \/ Classic","options":["Black","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0123252-PL08","featured_media":{"alt":null,"id":27114718330979,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/901b98c27e4040504a069b2c8b23959fc941a280.webp?v=1775117169"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102061690979,"title":"Tide Blue \/ Classic","option1":"Tide Blue","option2":"Classic","option3":null,"sku":"MST01232Z9-PL08","requires_shipping":true,"taxable":true,"featured_image":{"id":35582099259491,"product_id":6979360358499,"position":5,"created_at":"2026-04-02T16:06:09+08:00","updated_at":"2026-04-02T16:06:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08b11d7534d6f282ffce7a2ce503a5f15cbd4d6b.webp?v=1775117171","variant_ids":[43102061690979]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Snoopy 史努比 Snoopy Take A Nap - Tide Blue \/ Classic","public_title":"Tide Blue \/ Classic","options":["Tide Blue","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01232Z9-PL08","featured_media":{"alt":null,"id":27114719117411,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08b11d7534d6f282ffce7a2ce503a5f15cbd4d6b.webp?v=1775117171"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102061756515,"title":"Shell Beige \/ Classic","option1":"Shell Beige","option2":"Classic","option3":null,"sku":"MST012320B-PL08","requires_shipping":true,"taxable":true,"featured_image":{"id":35582099390563,"product_id":6979360358499,"position":6,"created_at":"2026-04-02T16:06:09+08:00","updated_at":"2026-04-02T16:06:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/406f493d073a4ac3c04fd15246b0e3dd11bcfe0d.webp?v=1775117171","variant_ids":[43102061756515]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Snoopy 史努比 Snoopy Take A Nap - Shell Beige \/ Classic","public_title":"Shell Beige \/ Classic","options":["Shell Beige","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320B-PL08","featured_media":{"alt":null,"id":27114719248483,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/406f493d073a4ac3c04fd15246b0e3dd11bcfe0d.webp?v=1775117171"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102061854819,"title":"Classic Blue \/ Classic","option1":"Classic Blue","option2":"Classic","option3":null,"sku":"MST012320C-PL08","requires_shipping":true,"taxable":true,"featured_image":{"id":35582099030115,"product_id":6979360358499,"position":4,"created_at":"2026-04-02T16:06:08+08:00","updated_at":"2026-04-02T16:06:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3cb2fb0c56e1f00b9e250fb9d76ec679b49b8d.webp?v=1775117170","variant_ids":[43102061854819]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Snoopy 史努比 Snoopy Take A Nap - Classic Blue \/ Classic","public_title":"Classic Blue \/ Classic","options":["Classic Blue","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320C-PL08","featured_media":{"alt":null,"id":27114718888035,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3cb2fb0c56e1f00b9e250fb9d76ec679b49b8d.webp?v=1775117170"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102061887587,"title":"Parakeet Green \/ Classic","option1":"Parakeet Green","option2":"Classic","option3":null,"sku":"MST012320E-PL08","requires_shipping":true,"taxable":true,"featured_image":{"id":35582099554403,"product_id":6979360358499,"position":7,"created_at":"2026-04-02T16:06:10+08:00","updated_at":"2026-04-02T16:06:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c183bcb661fbff5d9540fb9588e06249176042e.webp?v=1775117172","variant_ids":[43102061887587]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Snoopy 史努比 Snoopy Take A Nap - Parakeet Green \/ Classic","public_title":"Parakeet Green \/ Classic","options":["Parakeet Green","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320E-PL08","featured_media":{"alt":null,"id":27114719412323,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c183bcb661fbff5d9540fb9588e06249176042e.webp?v=1775117172"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43102061559907,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0123252-PL08","requires_shipping":true,"taxable":true,"featured_image":{"id":35582098473059,"product_id":6979360358499,"position":2,"created_at":"2026-04-02T16:06:07+08:00","updated_at":"2026-04-02T16:06:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/901b98c27e4040504a069b2c8b23959fc941a280.webp?v=1775117169","variant_ids":[43102061559907]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Snoopy 史努比 Snoopy Take A Nap - Black \/ Classic","public_title":"Black \/ Classic","options":["Black","Classic"],"price":125000,"weight":1350,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0123252-PL08","featured_media":{"alt":null,"id":27114718330979,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/901b98c27e4040504a069b2c8b23959fc941a280.webp?v=1775117169"}},"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: "停產" }