$product = {"id":7856301310051,"title":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Ducati Technical Drawing","handle":"iphone-13-pro-max-solidsuit-magsafe-bumper-back-crossover-design-du03","description":null,"published_at":"2025-08-15T15:15:29+08:00","created_at":"2025-08-14T15:05:56+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-ducati","device-iPhone 13 Pro Max","merge","reseller-ducati"],"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":43590828097635,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012320F-DU03","requires_shipping":true,"taxable":true,"featured_image":{"id":34327983784035,"product_id":7856301310051,"position":2,"created_at":"2025-08-14T15:06:01+08:00","updated_at":"2025-08-14T15:06:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/df0bba57ee5422ad9871059235c8264326c5157f.webp?v=1755155163","variant_ids":[43590828097635]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Ducati Technical Drawing - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320F-DU03","featured_media":{"alt":null,"id":25912237228131,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/df0bba57ee5422ad9871059235c8264326c5157f.webp?v=1755155163"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43590831439971,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST012320E-DU03","requires_shipping":true,"taxable":true,"featured_image":{"id":34327985061987,"product_id":7856301310051,"position":10,"created_at":"2025-08-14T15:06:05+08:00","updated_at":"2025-08-14T15:06:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9808bfbeb78c26b2c6b453855be344afbd9ec749.webp?v=1755155168","variant_ids":[43590831439971]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Ducati Technical Drawing - Parakeet Green","public_title":"Parakeet Green","options":["Parakeet Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320E-DU03","featured_media":{"alt":null,"id":25912238506083,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9808bfbeb78c26b2c6b453855be344afbd9ec749.webp?v=1755155168"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43590831472739,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0123252-DU03","requires_shipping":true,"taxable":true,"featured_image":{"id":34327984242787,"product_id":7856301310051,"position":5,"created_at":"2025-08-14T15:06:03+08:00","updated_at":"2025-08-14T15:06:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8491f4b6682ac941c66fa30892c39045a46a1595.webp?v=1755155165","variant_ids":[43590831472739]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Ducati Technical Drawing - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0123252-DU03","featured_media":{"alt":null,"id":25912237686883,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8491f4b6682ac941c66fa30892c39045a46a1595.webp?v=1755155165"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43590831571043,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012320C-DU03","requires_shipping":true,"taxable":true,"featured_image":{"id":34327983521891,"product_id":7856301310051,"position":1,"created_at":"2025-08-14T15:06:00+08:00","updated_at":"2025-08-14T15:06:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e047cabf3bf0669f7c484b1a4cb45ebf9f7d533.webp?v=1755155162","variant_ids":[43590831571043]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Ducati Technical Drawing - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320C-DU03","featured_media":{"alt":null,"id":25912236965987,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e047cabf3bf0669f7c484b1a4cb45ebf9f7d533.webp?v=1755155162"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43590831603811,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST012320B-DU03","requires_shipping":true,"taxable":true,"featured_image":{"id":34327984472163,"product_id":7856301310051,"position":7,"created_at":"2025-08-14T15:06:04+08:00","updated_at":"2025-08-14T15:06:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa40a553c29bf55efff1eeddeeeaa79b332714de.webp?v=1755155166","variant_ids":[43590831603811]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Ducati Technical Drawing - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320B-DU03","featured_media":{"alt":null,"id":25912237949027,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa40a553c29bf55efff1eeddeeeaa79b332714de.webp?v=1755155166"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e047cabf3bf0669f7c484b1a4cb45ebf9f7d533.webp?v=1755155162","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/df0bba57ee5422ad9871059235c8264326c5157f.webp?v=1755155163","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68b9faf45691f45c59c0be21af217700a71907cb.webp?v=1755155164","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/896e21df6cab6a7db353af07129fbe2b9b8a0621.webp?v=1755155164","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8491f4b6682ac941c66fa30892c39045a46a1595.webp?v=1755155165","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8854449dd2de95b0eba09526b86caded893aa7e.webp?v=1755155166","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa40a553c29bf55efff1eeddeeeaa79b332714de.webp?v=1755155166","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/548343e37c14b6a246fa73cf4b49bb17d8ecc2b5.webp?v=1755155167","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf6124d760a9a5d2b011467713e65987b90b2483.webp?v=1755155167","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9808bfbeb78c26b2c6b453855be344afbd9ec749.webp?v=1755155168","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8f1c0f39cfca1105dd1606265185dafa78289eb1.webp?v=1755155168"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e047cabf3bf0669f7c484b1a4cb45ebf9f7d533.webp?v=1755155162","options":["color"],"media":[{"alt":null,"id":25912236965987,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e047cabf3bf0669f7c484b1a4cb45ebf9f7d533.webp?v=1755155162"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e047cabf3bf0669f7c484b1a4cb45ebf9f7d533.webp?v=1755155162","width":2000},{"alt":null,"id":25912237228131,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/df0bba57ee5422ad9871059235c8264326c5157f.webp?v=1755155163"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/df0bba57ee5422ad9871059235c8264326c5157f.webp?v=1755155163","width":2000},{"alt":null,"id":25912237424739,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68b9faf45691f45c59c0be21af217700a71907cb.webp?v=1755155164"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68b9faf45691f45c59c0be21af217700a71907cb.webp?v=1755155164","width":2000},{"alt":null,"id":25912237588579,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/896e21df6cab6a7db353af07129fbe2b9b8a0621.webp?v=1755155164"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/896e21df6cab6a7db353af07129fbe2b9b8a0621.webp?v=1755155164","width":2000},{"alt":null,"id":25912237686883,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8491f4b6682ac941c66fa30892c39045a46a1595.webp?v=1755155165"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8491f4b6682ac941c66fa30892c39045a46a1595.webp?v=1755155165","width":2000},{"alt":null,"id":25912237817955,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8854449dd2de95b0eba09526b86caded893aa7e.webp?v=1755155166"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b8854449dd2de95b0eba09526b86caded893aa7e.webp?v=1755155166","width":2000},{"alt":null,"id":25912237949027,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa40a553c29bf55efff1eeddeeeaa79b332714de.webp?v=1755155166"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa40a553c29bf55efff1eeddeeeaa79b332714de.webp?v=1755155166","width":2000},{"alt":null,"id":25912238112867,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/548343e37c14b6a246fa73cf4b49bb17d8ecc2b5.webp?v=1755155167"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/548343e37c14b6a246fa73cf4b49bb17d8ecc2b5.webp?v=1755155167","width":2000},{"alt":null,"id":25912238211171,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf6124d760a9a5d2b011467713e65987b90b2483.webp?v=1755155167"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf6124d760a9a5d2b011467713e65987b90b2483.webp?v=1755155167","width":2000},{"alt":null,"id":25912238506083,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9808bfbeb78c26b2c6b453855be344afbd9ec749.webp?v=1755155168"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9808bfbeb78c26b2c6b453855be344afbd9ec749.webp?v=1755155168","width":2000},{"alt":null,"id":25912238768227,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8f1c0f39cfca1105dd1606265185dafa78289eb1.webp?v=1755155168"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8f1c0f39cfca1105dd1606265185dafa78289eb1.webp?v=1755155168","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43590828097635,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012320F-DU03","requires_shipping":true,"taxable":true,"featured_image":{"id":34327983784035,"product_id":7856301310051,"position":2,"created_at":"2025-08-14T15:06:01+08:00","updated_at":"2025-08-14T15:06:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/df0bba57ee5422ad9871059235c8264326c5157f.webp?v=1755155163","variant_ids":[43590828097635]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Ducati Technical Drawing - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320F-DU03","featured_media":{"alt":null,"id":25912237228131,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/df0bba57ee5422ad9871059235c8264326c5157f.webp?v=1755155163"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43590831439971,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST012320E-DU03","requires_shipping":true,"taxable":true,"featured_image":{"id":34327985061987,"product_id":7856301310051,"position":10,"created_at":"2025-08-14T15:06:05+08:00","updated_at":"2025-08-14T15:06:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9808bfbeb78c26b2c6b453855be344afbd9ec749.webp?v=1755155168","variant_ids":[43590831439971]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Ducati Technical Drawing - Parakeet Green","public_title":"Parakeet Green","options":["Parakeet Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320E-DU03","featured_media":{"alt":null,"id":25912238506083,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9808bfbeb78c26b2c6b453855be344afbd9ec749.webp?v=1755155168"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43590831472739,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0123252-DU03","requires_shipping":true,"taxable":true,"featured_image":{"id":34327984242787,"product_id":7856301310051,"position":5,"created_at":"2025-08-14T15:06:03+08:00","updated_at":"2025-08-14T15:06:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8491f4b6682ac941c66fa30892c39045a46a1595.webp?v=1755155165","variant_ids":[43590831472739]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Ducati Technical Drawing - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0123252-DU03","featured_media":{"alt":null,"id":25912237686883,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8491f4b6682ac941c66fa30892c39045a46a1595.webp?v=1755155165"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43590831571043,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012320C-DU03","requires_shipping":true,"taxable":true,"featured_image":{"id":34327983521891,"product_id":7856301310051,"position":1,"created_at":"2025-08-14T15:06:00+08:00","updated_at":"2025-08-14T15:06:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e047cabf3bf0669f7c484b1a4cb45ebf9f7d533.webp?v=1755155162","variant_ids":[43590831571043]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Ducati Technical Drawing - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320C-DU03","featured_media":{"alt":null,"id":25912236965987,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e047cabf3bf0669f7c484b1a4cb45ebf9f7d533.webp?v=1755155162"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43590831603811,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST012320B-DU03","requires_shipping":true,"taxable":true,"featured_image":{"id":34327984472163,"product_id":7856301310051,"position":7,"created_at":"2025-08-14T15:06:04+08:00","updated_at":"2025-08-14T15:06:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa40a553c29bf55efff1eeddeeeaa79b332714de.webp?v=1755155166","variant_ids":[43590831603811]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Ducati Technical Drawing - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320B-DU03","featured_media":{"alt":null,"id":25912237949027,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa40a553c29bf55efff1eeddeeeaa79b332714de.webp?v=1755155166"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43590828097635,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012320F-DU03","requires_shipping":true,"taxable":true,"featured_image":{"id":34327983784035,"product_id":7856301310051,"position":2,"created_at":"2025-08-14T15:06:01+08:00","updated_at":"2025-08-14T15:06:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/df0bba57ee5422ad9871059235c8264326c5157f.webp?v=1755155163","variant_ids":[43590828097635]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Ducati Technical Drawing - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320F-DU03","featured_media":{"alt":null,"id":25912237228131,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/df0bba57ee5422ad9871059235c8264326c5157f.webp?v=1755155163"}},"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: "停產" }