$product = {"id":7836890333283,"title":"iPhone 15 Pro SolidX OSAMU GOODS 多彩系列-Cat","handle":"iphone-15-pro-solidx-bumper-back-crossover-design-yn33","description":null,"published_at":"2025-07-14T15:49:04+08:00","created_at":"2025-07-14T14:54:09+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-osamugoods","device-iPhone 15 Pro","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":43525251104867,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-YN33","requires_shipping":true,"taxable":true,"featured_image":{"id":34179843817571,"product_id":7836890333283,"position":8,"created_at":"2025-07-14T14:54:18+08:00","updated_at":"2025-07-14T14:54:19+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bcfe67cb0df348430e918fa1fd3843da7ffb456.webp?v=1752476059","variant_ids":[43525251104867]},"available":true,"name":"iPhone 15 Pro SolidX OSAMU GOODS 多彩系列-Cat - 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-YN33","featured_media":{"alt":null,"id":25817043697763,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bcfe67cb0df348430e918fa1fd3843da7ffb456.webp?v=1752476059"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525252939875,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-YN33","requires_shipping":true,"taxable":true,"featured_image":{"id":34179841425507,"product_id":7836890333283,"position":1,"created_at":"2025-07-14T14:54:13+08:00","updated_at":"2025-07-14T14:54:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fb63cfa1b9ccfc78ab6c0edc27194762c08c5273.webp?v=1752476055","variant_ids":[43525252939875]},"available":true,"name":"iPhone 15 Pro SolidX OSAMU GOODS 多彩系列-Cat - 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-YN33","featured_media":{"alt":null,"id":25817042288739,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fb63cfa1b9ccfc78ab6c0edc27194762c08c5273.webp?v=1752476055"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525252972643,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-YN33","requires_shipping":true,"taxable":true,"featured_image":{"id":34179843031139,"product_id":7836890333283,"position":5,"created_at":"2025-07-14T14:54:16+08:00","updated_at":"2025-07-14T14:54:17+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef6a02f77696a0076beb1e07080a2bf589653217.webp?v=1752476057","variant_ids":[43525252972643]},"available":true,"name":"iPhone 15 Pro SolidX OSAMU GOODS 多彩系列-Cat - 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-YN33","featured_media":{"alt":null,"id":25817043304547,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef6a02f77696a0076beb1e07080a2bf589653217.webp?v=1752476057"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525253103715,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-YN33","requires_shipping":true,"taxable":true,"featured_image":{"id":34179844014179,"product_id":7836890333283,"position":9,"created_at":"2025-07-14T14:54:18+08:00","updated_at":"2025-07-14T14:54:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b9dff5c2176f7cf5f1718caff70ea0f87fd4a15.webp?v=1752476060","variant_ids":[43525253103715]},"available":true,"name":"iPhone 15 Pro SolidX OSAMU GOODS 多彩系列-Cat - 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-YN33","featured_media":{"alt":null,"id":25817043828835,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b9dff5c2176f7cf5f1718caff70ea0f87fd4a15.webp?v=1752476060"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525253169251,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-YN33","requires_shipping":true,"taxable":true,"featured_image":{"id":34179844440163,"product_id":7836890333283,"position":10,"created_at":"2025-07-14T14:54:19+08:00","updated_at":"2025-07-14T14:54:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ffcb047e37e34336dadb5c23922bca04f2e5432.webp?v=1752476061","variant_ids":[43525253169251]},"available":true,"name":"iPhone 15 Pro SolidX OSAMU GOODS 多彩系列-Cat - 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-YN33","featured_media":{"alt":null,"id":25817043959907,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ffcb047e37e34336dadb5c23922bca04f2e5432.webp?v=1752476061"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fb63cfa1b9ccfc78ab6c0edc27194762c08c5273.webp?v=1752476055","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3875db94f627adfc0d9e32464af72631d2713328.webp?v=1752476056","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/166735d924aea9b87140f56a46f9b3525dffb2fb.webp?v=1752476057","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7727339b5b6b221bbb42a9b255c60217d3a5f538.webp?v=1752476057","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef6a02f77696a0076beb1e07080a2bf589653217.webp?v=1752476057","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e790177b61d8875909ca308aa241101aa9177d3.webp?v=1752476058","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40a6bd8babb49fa2ef690372577e1c0c924bab35.webp?v=1752476059","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bcfe67cb0df348430e918fa1fd3843da7ffb456.webp?v=1752476059","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b9dff5c2176f7cf5f1718caff70ea0f87fd4a15.webp?v=1752476060","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ffcb047e37e34336dadb5c23922bca04f2e5432.webp?v=1752476061"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fb63cfa1b9ccfc78ab6c0edc27194762c08c5273.webp?v=1752476055","options":["color"],"media":[{"alt":null,"id":25817042288739,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fb63cfa1b9ccfc78ab6c0edc27194762c08c5273.webp?v=1752476055"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fb63cfa1b9ccfc78ab6c0edc27194762c08c5273.webp?v=1752476055","width":2000},{"alt":null,"id":25817042649187,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3875db94f627adfc0d9e32464af72631d2713328.webp?v=1752476056"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3875db94f627adfc0d9e32464af72631d2713328.webp?v=1752476056","width":2000},{"alt":null,"id":25817042911331,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/166735d924aea9b87140f56a46f9b3525dffb2fb.webp?v=1752476057"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/166735d924aea9b87140f56a46f9b3525dffb2fb.webp?v=1752476057","width":2000},{"alt":null,"id":25817043140707,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7727339b5b6b221bbb42a9b255c60217d3a5f538.webp?v=1752476057"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7727339b5b6b221bbb42a9b255c60217d3a5f538.webp?v=1752476057","width":2000},{"alt":null,"id":25817043304547,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef6a02f77696a0076beb1e07080a2bf589653217.webp?v=1752476057"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef6a02f77696a0076beb1e07080a2bf589653217.webp?v=1752476057","width":2000},{"alt":null,"id":25817043501155,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e790177b61d8875909ca308aa241101aa9177d3.webp?v=1752476058"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e790177b61d8875909ca308aa241101aa9177d3.webp?v=1752476058","width":2000},{"alt":null,"id":25817043632227,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40a6bd8babb49fa2ef690372577e1c0c924bab35.webp?v=1752476059"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40a6bd8babb49fa2ef690372577e1c0c924bab35.webp?v=1752476059","width":2000},{"alt":null,"id":25817043697763,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bcfe67cb0df348430e918fa1fd3843da7ffb456.webp?v=1752476059"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bcfe67cb0df348430e918fa1fd3843da7ffb456.webp?v=1752476059","width":2000},{"alt":null,"id":25817043828835,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b9dff5c2176f7cf5f1718caff70ea0f87fd4a15.webp?v=1752476060"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b9dff5c2176f7cf5f1718caff70ea0f87fd4a15.webp?v=1752476060","width":2000},{"alt":null,"id":25817043959907,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ffcb047e37e34336dadb5c23922bca04f2e5432.webp?v=1752476061"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ffcb047e37e34336dadb5c23922bca04f2e5432.webp?v=1752476061","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43525251104867,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-YN33","requires_shipping":true,"taxable":true,"featured_image":{"id":34179843817571,"product_id":7836890333283,"position":8,"created_at":"2025-07-14T14:54:18+08:00","updated_at":"2025-07-14T14:54:19+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bcfe67cb0df348430e918fa1fd3843da7ffb456.webp?v=1752476059","variant_ids":[43525251104867]},"available":true,"name":"iPhone 15 Pro SolidX OSAMU GOODS 多彩系列-Cat - 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-YN33","featured_media":{"alt":null,"id":25817043697763,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bcfe67cb0df348430e918fa1fd3843da7ffb456.webp?v=1752476059"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525252939875,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-YN33","requires_shipping":true,"taxable":true,"featured_image":{"id":34179841425507,"product_id":7836890333283,"position":1,"created_at":"2025-07-14T14:54:13+08:00","updated_at":"2025-07-14T14:54:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fb63cfa1b9ccfc78ab6c0edc27194762c08c5273.webp?v=1752476055","variant_ids":[43525252939875]},"available":true,"name":"iPhone 15 Pro SolidX OSAMU GOODS 多彩系列-Cat - 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-YN33","featured_media":{"alt":null,"id":25817042288739,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fb63cfa1b9ccfc78ab6c0edc27194762c08c5273.webp?v=1752476055"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525252972643,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-YN33","requires_shipping":true,"taxable":true,"featured_image":{"id":34179843031139,"product_id":7836890333283,"position":5,"created_at":"2025-07-14T14:54:16+08:00","updated_at":"2025-07-14T14:54:17+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef6a02f77696a0076beb1e07080a2bf589653217.webp?v=1752476057","variant_ids":[43525252972643]},"available":true,"name":"iPhone 15 Pro SolidX OSAMU GOODS 多彩系列-Cat - 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-YN33","featured_media":{"alt":null,"id":25817043304547,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef6a02f77696a0076beb1e07080a2bf589653217.webp?v=1752476057"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525253103715,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-YN33","requires_shipping":true,"taxable":true,"featured_image":{"id":34179844014179,"product_id":7836890333283,"position":9,"created_at":"2025-07-14T14:54:18+08:00","updated_at":"2025-07-14T14:54:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b9dff5c2176f7cf5f1718caff70ea0f87fd4a15.webp?v=1752476060","variant_ids":[43525253103715]},"available":true,"name":"iPhone 15 Pro SolidX OSAMU GOODS 多彩系列-Cat - 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-YN33","featured_media":{"alt":null,"id":25817043828835,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b9dff5c2176f7cf5f1718caff70ea0f87fd4a15.webp?v=1752476060"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525253169251,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-YN33","requires_shipping":true,"taxable":true,"featured_image":{"id":34179844440163,"product_id":7836890333283,"position":10,"created_at":"2025-07-14T14:54:19+08:00","updated_at":"2025-07-14T14:54:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ffcb047e37e34336dadb5c23922bca04f2e5432.webp?v=1752476061","variant_ids":[43525253169251]},"available":true,"name":"iPhone 15 Pro SolidX OSAMU GOODS 多彩系列-Cat - 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-YN33","featured_media":{"alt":null,"id":25817043959907,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ffcb047e37e34336dadb5c23922bca04f2e5432.webp?v=1752476061"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43525251104867,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-YN33","requires_shipping":true,"taxable":true,"featured_image":{"id":34179843817571,"product_id":7836890333283,"position":8,"created_at":"2025-07-14T14:54:18+08:00","updated_at":"2025-07-14T14:54:19+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bcfe67cb0df348430e918fa1fd3843da7ffb456.webp?v=1752476059","variant_ids":[43525251104867]},"available":true,"name":"iPhone 15 Pro SolidX OSAMU GOODS 多彩系列-Cat - 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-YN33","featured_media":{"alt":null,"id":25817043697763,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bcfe67cb0df348430e918fa1fd3843da7ffb456.webp?v=1752476059"}},"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: "停產" }