$product = {"id":7836880797795,"title":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Dog","handle":"iphone-15-pro-max-solidx-bumper-back-crossover-design-yn30","description":null,"published_at":"2025-07-14T15:52:48+08:00","created_at":"2025-07-14T14:50:46+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-osamugoods","device-iPhone 15 Pro Max","merge","reseller-osamugoods"],"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":43525222727779,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-YN30","requires_shipping":true,"taxable":true,"featured_image":{"id":34179731587171,"product_id":7836880797795,"position":7,"created_at":"2025-07-14T14:50:54+08:00","updated_at":"2025-07-14T14:50:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12d5564f27d960b673f84b4becb19a370949630b.webp?v=1752475855","variant_ids":[43525222727779]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Dog - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-YN30","featured_media":{"alt":null,"id":25816979865699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12d5564f27d960b673f84b4becb19a370949630b.webp?v=1752475855"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525222760547,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-YN30","requires_shipping":true,"taxable":true,"featured_image":{"id":34179729457251,"product_id":7836880797795,"position":2,"created_at":"2025-07-14T14:50:51+08:00","updated_at":"2025-07-14T14:50:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/277184b1dee966b3b3a9beb0e43c52d882b1efdd.webp?v=1752475853","variant_ids":[43525222760547]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Dog - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-YN30","featured_media":{"alt":null,"id":25816978620515,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/277184b1dee966b3b3a9beb0e43c52d882b1efdd.webp?v=1752475853"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525222891619,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-YN30","requires_shipping":true,"taxable":true,"featured_image":{"id":34179731882083,"product_id":7836880797795,"position":8,"created_at":"2025-07-14T14:50:54+08:00","updated_at":"2025-07-14T14:50:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6af5cd75dff140455bbbd463eb3cc6dcab7ea0dc.webp?v=1752475856","variant_ids":[43525222891619]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Dog - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298O8-YN30","featured_media":{"alt":null,"id":25816980193379,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6af5cd75dff140455bbbd463eb3cc6dcab7ea0dc.webp?v=1752475856"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525222924387,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-YN30","requires_shipping":true,"taxable":true,"featured_image":{"id":34179730309219,"product_id":7836880797795,"position":4,"created_at":"2025-07-14T14:50:52+08:00","updated_at":"2025-07-14T14:50:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddb1ceb0fc856f81d5013e7db8879bd8e8114d3d.webp?v=1752475854","variant_ids":[43525222924387]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Dog - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129853-YN30","featured_media":{"alt":null,"id":25816979079267,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddb1ceb0fc856f81d5013e7db8879bd8e8114d3d.webp?v=1752475854"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525222957155,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-YN30","requires_shipping":true,"taxable":true,"featured_image":{"id":34179730636899,"product_id":7836880797795,"position":5,"created_at":"2025-07-14T14:50:53+08:00","updated_at":"2025-07-14T14:50:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dd88c6e6b6fd9512d94df94cc340861f8e744b1.webp?v=1752475854","variant_ids":[43525222957155]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Dog - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129857-YN30","featured_media":{"alt":null,"id":25816979177571,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dd88c6e6b6fd9512d94df94cc340861f8e744b1.webp?v=1752475854"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aad71b9f6da2ee2e1b6033449a191f1e5ed56265.webp?v=1752475852","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/277184b1dee966b3b3a9beb0e43c52d882b1efdd.webp?v=1752475853","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82e936e00f5ccf3f581c02b2a33da4b42b6d617d.webp?v=1752475853","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddb1ceb0fc856f81d5013e7db8879bd8e8114d3d.webp?v=1752475854","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dd88c6e6b6fd9512d94df94cc340861f8e744b1.webp?v=1752475854","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9385205068dcba3dbdd4a47b5f74d9834077efae.webp?v=1752475855","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12d5564f27d960b673f84b4becb19a370949630b.webp?v=1752475855","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6af5cd75dff140455bbbd463eb3cc6dcab7ea0dc.webp?v=1752475856","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ef96b13a539949c3a35e03cf814038ad175e6a9.webp?v=1752475857","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0366c91c7157e622e0ebf4d6cfd08ce3129f9163.webp?v=1752475857"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aad71b9f6da2ee2e1b6033449a191f1e5ed56265.webp?v=1752475852","options":["color"],"media":[{"alt":null,"id":25816978489443,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aad71b9f6da2ee2e1b6033449a191f1e5ed56265.webp?v=1752475852"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aad71b9f6da2ee2e1b6033449a191f1e5ed56265.webp?v=1752475852","width":2000},{"alt":null,"id":25816978620515,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/277184b1dee966b3b3a9beb0e43c52d882b1efdd.webp?v=1752475853"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/277184b1dee966b3b3a9beb0e43c52d882b1efdd.webp?v=1752475853","width":2000},{"alt":null,"id":25816978784355,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82e936e00f5ccf3f581c02b2a33da4b42b6d617d.webp?v=1752475853"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82e936e00f5ccf3f581c02b2a33da4b42b6d617d.webp?v=1752475853","width":2000},{"alt":null,"id":25816979079267,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddb1ceb0fc856f81d5013e7db8879bd8e8114d3d.webp?v=1752475854"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddb1ceb0fc856f81d5013e7db8879bd8e8114d3d.webp?v=1752475854","width":2000},{"alt":null,"id":25816979177571,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dd88c6e6b6fd9512d94df94cc340861f8e744b1.webp?v=1752475854"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dd88c6e6b6fd9512d94df94cc340861f8e744b1.webp?v=1752475854","width":2000},{"alt":null,"id":25816979341411,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9385205068dcba3dbdd4a47b5f74d9834077efae.webp?v=1752475855"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9385205068dcba3dbdd4a47b5f74d9834077efae.webp?v=1752475855","width":2000},{"alt":null,"id":25816979865699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12d5564f27d960b673f84b4becb19a370949630b.webp?v=1752475855"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12d5564f27d960b673f84b4becb19a370949630b.webp?v=1752475855","width":2000},{"alt":null,"id":25816980193379,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6af5cd75dff140455bbbd463eb3cc6dcab7ea0dc.webp?v=1752475856"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6af5cd75dff140455bbbd463eb3cc6dcab7ea0dc.webp?v=1752475856","width":2000},{"alt":null,"id":25816980422755,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ef96b13a539949c3a35e03cf814038ad175e6a9.webp?v=1752475857"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ef96b13a539949c3a35e03cf814038ad175e6a9.webp?v=1752475857","width":2000},{"alt":null,"id":25816980652131,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0366c91c7157e622e0ebf4d6cfd08ce3129f9163.webp?v=1752475857"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0366c91c7157e622e0ebf4d6cfd08ce3129f9163.webp?v=1752475857","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43525222727779,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-YN30","requires_shipping":true,"taxable":true,"featured_image":{"id":34179731587171,"product_id":7836880797795,"position":7,"created_at":"2025-07-14T14:50:54+08:00","updated_at":"2025-07-14T14:50:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12d5564f27d960b673f84b4becb19a370949630b.webp?v=1752475855","variant_ids":[43525222727779]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Dog - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-YN30","featured_media":{"alt":null,"id":25816979865699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12d5564f27d960b673f84b4becb19a370949630b.webp?v=1752475855"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525222760547,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-YN30","requires_shipping":true,"taxable":true,"featured_image":{"id":34179729457251,"product_id":7836880797795,"position":2,"created_at":"2025-07-14T14:50:51+08:00","updated_at":"2025-07-14T14:50:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/277184b1dee966b3b3a9beb0e43c52d882b1efdd.webp?v=1752475853","variant_ids":[43525222760547]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Dog - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-YN30","featured_media":{"alt":null,"id":25816978620515,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/277184b1dee966b3b3a9beb0e43c52d882b1efdd.webp?v=1752475853"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525222891619,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-YN30","requires_shipping":true,"taxable":true,"featured_image":{"id":34179731882083,"product_id":7836880797795,"position":8,"created_at":"2025-07-14T14:50:54+08:00","updated_at":"2025-07-14T14:50:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6af5cd75dff140455bbbd463eb3cc6dcab7ea0dc.webp?v=1752475856","variant_ids":[43525222891619]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Dog - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298O8-YN30","featured_media":{"alt":null,"id":25816980193379,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6af5cd75dff140455bbbd463eb3cc6dcab7ea0dc.webp?v=1752475856"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525222924387,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-YN30","requires_shipping":true,"taxable":true,"featured_image":{"id":34179730309219,"product_id":7836880797795,"position":4,"created_at":"2025-07-14T14:50:52+08:00","updated_at":"2025-07-14T14:50:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddb1ceb0fc856f81d5013e7db8879bd8e8114d3d.webp?v=1752475854","variant_ids":[43525222924387]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Dog - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129853-YN30","featured_media":{"alt":null,"id":25816979079267,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddb1ceb0fc856f81d5013e7db8879bd8e8114d3d.webp?v=1752475854"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525222957155,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-YN30","requires_shipping":true,"taxable":true,"featured_image":{"id":34179730636899,"product_id":7836880797795,"position":5,"created_at":"2025-07-14T14:50:53+08:00","updated_at":"2025-07-14T14:50:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dd88c6e6b6fd9512d94df94cc340861f8e744b1.webp?v=1752475854","variant_ids":[43525222957155]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Dog - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129857-YN30","featured_media":{"alt":null,"id":25816979177571,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dd88c6e6b6fd9512d94df94cc340861f8e744b1.webp?v=1752475854"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43525222727779,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-YN30","requires_shipping":true,"taxable":true,"featured_image":{"id":34179731587171,"product_id":7836880797795,"position":7,"created_at":"2025-07-14T14:50:54+08:00","updated_at":"2025-07-14T14:50:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12d5564f27d960b673f84b4becb19a370949630b.webp?v=1752475855","variant_ids":[43525222727779]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Dog - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-YN30","featured_media":{"alt":null,"id":25816979865699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12d5564f27d960b673f84b4becb19a370949630b.webp?v=1752475855"}},"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: "停產" }