$product = {"id":6980766204003,"title":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 火影忍者疾風傳 黑白線稿-宇智波佐助","handle":"iphone-13-pro-max-solidsuit-classic-magsafe-pk37","description":null,"published_at":"2023-08-01T17:36:26+08:00","created_at":"2023-07-26T18:32:41+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師SolidSuit MagSafe專區-齊柏林《看見台灣》十週年原創設計系列","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-naruto-shippuden","device-iPhone 13 Pro Max","merge","reseller-naruto-shippuden"],"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":43102719901795,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0123252-PK37","requires_shipping":true,"taxable":true,"featured_image":{"id":35521432060003,"product_id":6980766204003,"position":5,"created_at":"2026-03-20T14:39:18+08:00","updated_at":"2026-03-20T14:39:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/434f3a48152ddc1e7adef5c956b53cb4c82edf75.webp?v=1773988760","variant_ids":[43102719901795]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 火影忍者疾風傳 黑白線稿-宇智波佐助 - 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-PK37","featured_media":{"alt":null,"id":27055267479651,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/434f3a48152ddc1e7adef5c956b53cb4c82edf75.webp?v=1773988760"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102720032867,"title":"Tide Blue \/ Classic","option1":"Tide Blue","option2":"Classic","option3":null,"sku":"MST01232Z9-PK37","requires_shipping":true,"taxable":true,"featured_image":{"id":35521432092771,"product_id":6980766204003,"position":6,"created_at":"2026-03-20T14:39:19+08:00","updated_at":"2026-03-20T14:39:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d81203ca1c28b3bfcc43fa0c5c48013d365e594.webp?v=1773988761","variant_ids":[43102720032867]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 火影忍者疾風傳 黑白線稿-宇智波佐助 - 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-PK37","featured_media":{"alt":null,"id":27055267512419,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d81203ca1c28b3bfcc43fa0c5c48013d365e594.webp?v=1773988761"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102720098403,"title":"Shell Beige \/ Classic","option1":"Shell Beige","option2":"Classic","option3":null,"sku":"MST012320B-PK37","requires_shipping":true,"taxable":true,"featured_image":{"id":35521432617059,"product_id":6980766204003,"position":9,"created_at":"2026-03-20T14:39:27+08:00","updated_at":"2026-03-20T14:39:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae1ddae626f4a675f456c83505a41afdfc5418a1.webp?v=1773988770","variant_ids":[43102720098403]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 火影忍者疾風傳 黑白線稿-宇智波佐助 - 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-PK37","featured_media":{"alt":null,"id":27055268003939,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae1ddae626f4a675f456c83505a41afdfc5418a1.webp?v=1773988770"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102720196707,"title":"Classic Blue \/ Classic","option1":"Classic Blue","option2":"Classic","option3":null,"sku":"MST012320C-PK37","requires_shipping":true,"taxable":true,"featured_image":{"id":35521432420451,"product_id":6980766204003,"position":7,"created_at":"2026-03-20T14:39:25+08:00","updated_at":"2026-03-20T14:39:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5739c85944486771e8c97fa8a1c39d8a98b638.webp?v=1773988767","variant_ids":[43102720196707]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 火影忍者疾風傳 黑白線稿-宇智波佐助 - 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-PK37","featured_media":{"alt":null,"id":27055267840099,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5739c85944486771e8c97fa8a1c39d8a98b638.webp?v=1773988767"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102720229475,"title":"Parakeet Green \/ Classic","option1":"Parakeet Green","option2":"Classic","option3":null,"sku":"MST012320E-PK37","requires_shipping":true,"taxable":true,"featured_image":{"id":35521431306339,"product_id":6980766204003,"position":4,"created_at":"2026-03-20T14:39:16+08:00","updated_at":"2026-03-20T14:39:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e0934eb032e326fe9ada396d09c74eceae93cc2.webp?v=1773988758","variant_ids":[43102720229475]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 火影忍者疾風傳 黑白線稿-宇智波佐助 - 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-PK37","featured_media":{"alt":null,"id":27055266725987,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e0934eb032e326fe9ada396d09c74eceae93cc2.webp?v=1773988758"}},"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-PK37.png?v=1690367564","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/72fc47e1aa1db6ab620ce8312f406e7654ae660d.webp?v=1773988755","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e85e6267e48f9eecfe1f6205c558c7f7c569b511.webp?v=1773988756","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e0934eb032e326fe9ada396d09c74eceae93cc2.webp?v=1773988758","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/434f3a48152ddc1e7adef5c956b53cb4c82edf75.webp?v=1773988760","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d81203ca1c28b3bfcc43fa0c5c48013d365e594.webp?v=1773988761","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5739c85944486771e8c97fa8a1c39d8a98b638.webp?v=1773988767","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b211183314c53deb06e7c3a4fba71beb11aa88a4.webp?v=1773988768","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae1ddae626f4a675f456c83505a41afdfc5418a1.webp?v=1773988770"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-PK37.png?v=1690367564","options":["color","Types"],"media":[{"alt":null,"id":22630156501091,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-PK37.png?v=1690367564"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-PK37.png?v=1690367564","width":2000},{"alt":null,"id":27055266562147,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/72fc47e1aa1db6ab620ce8312f406e7654ae660d.webp?v=1773988755"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/72fc47e1aa1db6ab620ce8312f406e7654ae660d.webp?v=1773988755","width":2000},{"alt":null,"id":27055266627683,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e85e6267e48f9eecfe1f6205c558c7f7c569b511.webp?v=1773988756"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e85e6267e48f9eecfe1f6205c558c7f7c569b511.webp?v=1773988756","width":2000},{"alt":null,"id":27055266725987,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e0934eb032e326fe9ada396d09c74eceae93cc2.webp?v=1773988758"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e0934eb032e326fe9ada396d09c74eceae93cc2.webp?v=1773988758","width":2000},{"alt":null,"id":27055267479651,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/434f3a48152ddc1e7adef5c956b53cb4c82edf75.webp?v=1773988760"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/434f3a48152ddc1e7adef5c956b53cb4c82edf75.webp?v=1773988760","width":2000},{"alt":null,"id":27055267512419,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d81203ca1c28b3bfcc43fa0c5c48013d365e594.webp?v=1773988761"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d81203ca1c28b3bfcc43fa0c5c48013d365e594.webp?v=1773988761","width":2000},{"alt":null,"id":27055267840099,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5739c85944486771e8c97fa8a1c39d8a98b638.webp?v=1773988767"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5739c85944486771e8c97fa8a1c39d8a98b638.webp?v=1773988767","width":2000},{"alt":null,"id":27055267971171,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b211183314c53deb06e7c3a4fba71beb11aa88a4.webp?v=1773988768"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b211183314c53deb06e7c3a4fba71beb11aa88a4.webp?v=1773988768","width":2000},{"alt":null,"id":27055268003939,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae1ddae626f4a675f456c83505a41afdfc5418a1.webp?v=1773988770"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae1ddae626f4a675f456c83505a41afdfc5418a1.webp?v=1773988770","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43102719901795,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0123252-PK37","requires_shipping":true,"taxable":true,"featured_image":{"id":35521432060003,"product_id":6980766204003,"position":5,"created_at":"2026-03-20T14:39:18+08:00","updated_at":"2026-03-20T14:39:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/434f3a48152ddc1e7adef5c956b53cb4c82edf75.webp?v=1773988760","variant_ids":[43102719901795]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 火影忍者疾風傳 黑白線稿-宇智波佐助 - 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-PK37","featured_media":{"alt":null,"id":27055267479651,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/434f3a48152ddc1e7adef5c956b53cb4c82edf75.webp?v=1773988760"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102720032867,"title":"Tide Blue \/ Classic","option1":"Tide Blue","option2":"Classic","option3":null,"sku":"MST01232Z9-PK37","requires_shipping":true,"taxable":true,"featured_image":{"id":35521432092771,"product_id":6980766204003,"position":6,"created_at":"2026-03-20T14:39:19+08:00","updated_at":"2026-03-20T14:39:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d81203ca1c28b3bfcc43fa0c5c48013d365e594.webp?v=1773988761","variant_ids":[43102720032867]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 火影忍者疾風傳 黑白線稿-宇智波佐助 - 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-PK37","featured_media":{"alt":null,"id":27055267512419,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d81203ca1c28b3bfcc43fa0c5c48013d365e594.webp?v=1773988761"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102720098403,"title":"Shell Beige \/ Classic","option1":"Shell Beige","option2":"Classic","option3":null,"sku":"MST012320B-PK37","requires_shipping":true,"taxable":true,"featured_image":{"id":35521432617059,"product_id":6980766204003,"position":9,"created_at":"2026-03-20T14:39:27+08:00","updated_at":"2026-03-20T14:39:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae1ddae626f4a675f456c83505a41afdfc5418a1.webp?v=1773988770","variant_ids":[43102720098403]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 火影忍者疾風傳 黑白線稿-宇智波佐助 - 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-PK37","featured_media":{"alt":null,"id":27055268003939,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae1ddae626f4a675f456c83505a41afdfc5418a1.webp?v=1773988770"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102720196707,"title":"Classic Blue \/ Classic","option1":"Classic Blue","option2":"Classic","option3":null,"sku":"MST012320C-PK37","requires_shipping":true,"taxable":true,"featured_image":{"id":35521432420451,"product_id":6980766204003,"position":7,"created_at":"2026-03-20T14:39:25+08:00","updated_at":"2026-03-20T14:39:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5739c85944486771e8c97fa8a1c39d8a98b638.webp?v=1773988767","variant_ids":[43102720196707]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 火影忍者疾風傳 黑白線稿-宇智波佐助 - 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-PK37","featured_media":{"alt":null,"id":27055267840099,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5739c85944486771e8c97fa8a1c39d8a98b638.webp?v=1773988767"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102720229475,"title":"Parakeet Green \/ Classic","option1":"Parakeet Green","option2":"Classic","option3":null,"sku":"MST012320E-PK37","requires_shipping":true,"taxable":true,"featured_image":{"id":35521431306339,"product_id":6980766204003,"position":4,"created_at":"2026-03-20T14:39:16+08:00","updated_at":"2026-03-20T14:39:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e0934eb032e326fe9ada396d09c74eceae93cc2.webp?v=1773988758","variant_ids":[43102720229475]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 火影忍者疾風傳 黑白線稿-宇智波佐助 - 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-PK37","featured_media":{"alt":null,"id":27055266725987,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e0934eb032e326fe9ada396d09c74eceae93cc2.webp?v=1773988758"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43102719901795,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0123252-PK37","requires_shipping":true,"taxable":true,"featured_image":{"id":35521432060003,"product_id":6980766204003,"position":5,"created_at":"2026-03-20T14:39:18+08:00","updated_at":"2026-03-20T14:39:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/434f3a48152ddc1e7adef5c956b53cb4c82edf75.webp?v=1773988760","variant_ids":[43102719901795]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 火影忍者疾風傳 黑白線稿-宇智波佐助 - 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-PK37","featured_media":{"alt":null,"id":27055267479651,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/434f3a48152ddc1e7adef5c956b53cb4c82edf75.webp?v=1773988760"}},"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: "停產" }