$product = {"id":7829066711139,"title":"iPhone 15 Pro SolidX 老高與小茉 五歲抬頭系列-經典款","handle":"iphone-15-pro-solidx-bumper-back-crossover-design-gao01","description":null,"published_at":"2025-07-31T09:51:57+08:00","created_at":"2025-06-30T16:00:41+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-mrandmrsgao","device-iPhone 15 Pro","merge","reseller-mrandmrsgao"],"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":43502803189859,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-GAO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34099632046179,"product_id":7829066711139,"position":6,"created_at":"2025-06-30T16:00:47+08:00","updated_at":"2025-06-30T16:00:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76ed4e2ce6d459ac7da1893879b9b55cd9ab318d.webp?v=1751270449","variant_ids":[43502803189859]},"available":true,"name":"iPhone 15 Pro SolidX 老高與小茉 五歲抬頭系列-經典款 - 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":"NST012970B-GAO01","featured_media":{"alt":null,"id":25756222914659,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76ed4e2ce6d459ac7da1893879b9b55cd9ab318d.webp?v=1751270449"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502807384163,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-GAO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34099631259747,"product_id":7829066711139,"position":5,"created_at":"2025-06-30T16:00:47+08:00","updated_at":"2025-06-30T16:00:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f10fc39fe7afa27bed2fa813f05db4d87f82ed04.webp?v=1751270448","variant_ids":[43502807384163]},"available":true,"name":"iPhone 15 Pro SolidX 老高與小茉 五歲抬頭系列-經典款 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01297Z8-GAO01","featured_media":{"alt":null,"id":25756222554211,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f10fc39fe7afa27bed2fa813f05db4d87f82ed04.webp?v=1751270448"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502807416931,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-GAO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34099633815651,"product_id":7829066711139,"position":9,"created_at":"2025-06-30T16:00:49+08:00","updated_at":"2025-06-30T16:00:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc08d5dc3121c613cbd81009a5275ed38d164.webp?v=1751270450","variant_ids":[43502807416931]},"available":true,"name":"iPhone 15 Pro SolidX 老高與小茉 五歲抬頭系列-經典款 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970A-GAO01","featured_media":{"alt":null,"id":25756223897699,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc08d5dc3121c613cbd81009a5275ed38d164.webp?v=1751270450"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502807449699,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-GAO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34099630243939,"product_id":7829066711139,"position":3,"created_at":"2025-06-30T16:00:46+08:00","updated_at":"2025-06-30T16:00:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0049db76da1e737a9f360b957f1d2c935c286979.webp?v=1751270447","variant_ids":[43502807449699]},"available":true,"name":"iPhone 15 Pro SolidX 老高與小茉 五歲抬頭系列-經典款 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129752-GAO01","featured_media":{"alt":null,"id":25756221735011,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0049db76da1e737a9f360b957f1d2c935c286979.webp?v=1751270447"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502807580771,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-GAO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34099633061987,"product_id":7829066711139,"position":8,"created_at":"2025-06-30T16:00:48+08:00","updated_at":"2025-06-30T16:00:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa943826c8eb7a21935ec228ee9af83e9eaa49e8.webp?v=1751270450","variant_ids":[43502807580771]},"available":true,"name":"iPhone 15 Pro SolidX 老高與小茉 五歲抬頭系列-經典款 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129753-GAO01","featured_media":{"alt":null,"id":25756223570019,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa943826c8eb7a21935ec228ee9af83e9eaa49e8.webp?v=1751270450"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c34b801917309cc31e9893ada7a3663146985cbf.webp?v=1751270446","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42cbf447bf7e578162b7e368782ace34aea8a44.webp?v=1751270447","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0049db76da1e737a9f360b957f1d2c935c286979.webp?v=1751270447","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/489be5fd773d00d81b23ca88d26d13c4d1da3560.webp?v=1751270448","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f10fc39fe7afa27bed2fa813f05db4d87f82ed04.webp?v=1751270448","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76ed4e2ce6d459ac7da1893879b9b55cd9ab318d.webp?v=1751270449","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/701ee8589dab1de3a65c08f21e0c0a43ae7717a9.webp?v=1751270449","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa943826c8eb7a21935ec228ee9af83e9eaa49e8.webp?v=1751270450","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc08d5dc3121c613cbd81009a5275ed38d164.webp?v=1751270450","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4637e78b91b0353dbec2efc9e772be8dc293e7ad.webp?v=1751270451"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c34b801917309cc31e9893ada7a3663146985cbf.webp?v=1751270446","options":["color"],"media":[{"alt":null,"id":25756221112419,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c34b801917309cc31e9893ada7a3663146985cbf.webp?v=1751270446"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c34b801917309cc31e9893ada7a3663146985cbf.webp?v=1751270446","width":2000},{"alt":null,"id":25756221440099,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42cbf447bf7e578162b7e368782ace34aea8a44.webp?v=1751270447"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42cbf447bf7e578162b7e368782ace34aea8a44.webp?v=1751270447","width":2000},{"alt":null,"id":25756221735011,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0049db76da1e737a9f360b957f1d2c935c286979.webp?v=1751270447"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0049db76da1e737a9f360b957f1d2c935c286979.webp?v=1751270447","width":2000},{"alt":null,"id":25756222193763,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/489be5fd773d00d81b23ca88d26d13c4d1da3560.webp?v=1751270448"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/489be5fd773d00d81b23ca88d26d13c4d1da3560.webp?v=1751270448","width":2000},{"alt":null,"id":25756222554211,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f10fc39fe7afa27bed2fa813f05db4d87f82ed04.webp?v=1751270448"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f10fc39fe7afa27bed2fa813f05db4d87f82ed04.webp?v=1751270448","width":2000},{"alt":null,"id":25756222914659,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76ed4e2ce6d459ac7da1893879b9b55cd9ab318d.webp?v=1751270449"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76ed4e2ce6d459ac7da1893879b9b55cd9ab318d.webp?v=1751270449","width":2000},{"alt":null,"id":25756223307875,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/701ee8589dab1de3a65c08f21e0c0a43ae7717a9.webp?v=1751270449"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/701ee8589dab1de3a65c08f21e0c0a43ae7717a9.webp?v=1751270449","width":2000},{"alt":null,"id":25756223570019,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa943826c8eb7a21935ec228ee9af83e9eaa49e8.webp?v=1751270450"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa943826c8eb7a21935ec228ee9af83e9eaa49e8.webp?v=1751270450","width":2000},{"alt":null,"id":25756223897699,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc08d5dc3121c613cbd81009a5275ed38d164.webp?v=1751270450"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc08d5dc3121c613cbd81009a5275ed38d164.webp?v=1751270450","width":2000},{"alt":null,"id":25756224258147,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4637e78b91b0353dbec2efc9e772be8dc293e7ad.webp?v=1751270451"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4637e78b91b0353dbec2efc9e772be8dc293e7ad.webp?v=1751270451","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43502803189859,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-GAO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34099632046179,"product_id":7829066711139,"position":6,"created_at":"2025-06-30T16:00:47+08:00","updated_at":"2025-06-30T16:00:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76ed4e2ce6d459ac7da1893879b9b55cd9ab318d.webp?v=1751270449","variant_ids":[43502803189859]},"available":true,"name":"iPhone 15 Pro SolidX 老高與小茉 五歲抬頭系列-經典款 - 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":"NST012970B-GAO01","featured_media":{"alt":null,"id":25756222914659,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76ed4e2ce6d459ac7da1893879b9b55cd9ab318d.webp?v=1751270449"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502807384163,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-GAO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34099631259747,"product_id":7829066711139,"position":5,"created_at":"2025-06-30T16:00:47+08:00","updated_at":"2025-06-30T16:00:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f10fc39fe7afa27bed2fa813f05db4d87f82ed04.webp?v=1751270448","variant_ids":[43502807384163]},"available":true,"name":"iPhone 15 Pro SolidX 老高與小茉 五歲抬頭系列-經典款 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01297Z8-GAO01","featured_media":{"alt":null,"id":25756222554211,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f10fc39fe7afa27bed2fa813f05db4d87f82ed04.webp?v=1751270448"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502807416931,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-GAO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34099633815651,"product_id":7829066711139,"position":9,"created_at":"2025-06-30T16:00:49+08:00","updated_at":"2025-06-30T16:00:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc08d5dc3121c613cbd81009a5275ed38d164.webp?v=1751270450","variant_ids":[43502807416931]},"available":true,"name":"iPhone 15 Pro SolidX 老高與小茉 五歲抬頭系列-經典款 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970A-GAO01","featured_media":{"alt":null,"id":25756223897699,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc08d5dc3121c613cbd81009a5275ed38d164.webp?v=1751270450"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502807449699,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-GAO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34099630243939,"product_id":7829066711139,"position":3,"created_at":"2025-06-30T16:00:46+08:00","updated_at":"2025-06-30T16:00:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0049db76da1e737a9f360b957f1d2c935c286979.webp?v=1751270447","variant_ids":[43502807449699]},"available":true,"name":"iPhone 15 Pro SolidX 老高與小茉 五歲抬頭系列-經典款 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129752-GAO01","featured_media":{"alt":null,"id":25756221735011,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0049db76da1e737a9f360b957f1d2c935c286979.webp?v=1751270447"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43502807580771,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-GAO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34099633061987,"product_id":7829066711139,"position":8,"created_at":"2025-06-30T16:00:48+08:00","updated_at":"2025-06-30T16:00:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa943826c8eb7a21935ec228ee9af83e9eaa49e8.webp?v=1751270450","variant_ids":[43502807580771]},"available":true,"name":"iPhone 15 Pro SolidX 老高與小茉 五歲抬頭系列-經典款 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129753-GAO01","featured_media":{"alt":null,"id":25756223570019,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa943826c8eb7a21935ec228ee9af83e9eaa49e8.webp?v=1751270450"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43502803189859,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-GAO01","requires_shipping":true,"taxable":true,"featured_image":{"id":34099632046179,"product_id":7829066711139,"position":6,"created_at":"2025-06-30T16:00:47+08:00","updated_at":"2025-06-30T16:00:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76ed4e2ce6d459ac7da1893879b9b55cd9ab318d.webp?v=1751270449","variant_ids":[43502803189859]},"available":true,"name":"iPhone 15 Pro SolidX 老高與小茉 五歲抬頭系列-經典款 - 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":"NST012970B-GAO01","featured_media":{"alt":null,"id":25756222914659,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76ed4e2ce6d459ac7da1893879b9b55cd9ab318d.webp?v=1751270449"}},"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: "停產" }