$product = {"id":7836866543715,"title":"iPhone 15 Pro Max SolidX OSAMU GOODS 多彩系列-Jill","handle":"iphone-15-pro-max-solidx-bumper-back-crossover-design-yn31","description":null,"published_at":"2025-07-14T15:58:16+08:00","created_at":"2025-07-14T14:45:48+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":43525172625507,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-YN31","requires_shipping":true,"taxable":true,"featured_image":{"id":34179549495395,"product_id":7836866543715,"position":2,"created_at":"2025-07-14T14:45:53+08:00","updated_at":"2025-07-14T14:45:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d89c96d9403ad584c4d78382632ea7047cb655c7.webp?v=1752475555","variant_ids":[43525172625507]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 多彩系列-Jill - 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-YN31","featured_media":{"alt":null,"id":25816878579811,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d89c96d9403ad584c4d78382632ea7047cb655c7.webp?v=1752475555"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525172658275,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-YN31","requires_shipping":true,"taxable":true,"featured_image":{"id":34179550281827,"product_id":7836866543715,"position":6,"created_at":"2025-07-14T14:45:55+08:00","updated_at":"2025-07-14T14:45:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6203a9240db0f821048e6a06cf1c0efae099b4c1.webp?v=1752475557","variant_ids":[43525172658275]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 多彩系列-Jill - 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-YN31","featured_media":{"alt":null,"id":25816878973027,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6203a9240db0f821048e6a06cf1c0efae099b4c1.webp?v=1752475557"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525172789347,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-YN31","requires_shipping":true,"taxable":true,"featured_image":{"id":34179550609507,"product_id":7836866543715,"position":7,"created_at":"2025-07-14T14:45:55+08:00","updated_at":"2025-07-14T14:45:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eba2c5061184e3fe396238467e40291eae853a52.webp?v=1752475557","variant_ids":[43525172789347]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 多彩系列-Jill - 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-YN31","featured_media":{"alt":null,"id":25816879104099,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eba2c5061184e3fe396238467e40291eae853a52.webp?v=1752475557"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525172822115,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-YN31","requires_shipping":true,"taxable":true,"featured_image":{"id":34179549855843,"product_id":7836866543715,"position":4,"created_at":"2025-07-14T14:45:54+08:00","updated_at":"2025-07-14T14:45:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5f5cc76662d3e4f261f12f73cd475fcad647f211.webp?v=1752475556","variant_ids":[43525172822115]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 多彩系列-Jill - 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-YN31","featured_media":{"alt":null,"id":25816878678115,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5f5cc76662d3e4f261f12f73cd475fcad647f211.webp?v=1752475556"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525172854883,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-YN31","requires_shipping":true,"taxable":true,"featured_image":{"id":34179550052451,"product_id":7836866543715,"position":5,"created_at":"2025-07-14T14:45:54+08:00","updated_at":"2025-07-14T14:45:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cd0524df6a6cec30fa070e69ef1f1f1a4c33503.webp?v=1752475556","variant_ids":[43525172854883]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 多彩系列-Jill - 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-YN31","featured_media":{"alt":null,"id":25816878809187,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cd0524df6a6cec30fa070e69ef1f1f1a4c33503.webp?v=1752475556"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9aee38db3c7b7bf4d6f9e037319b8f2cedaef6b.webp?v=1752475554","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d89c96d9403ad584c4d78382632ea7047cb655c7.webp?v=1752475555","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b19d2172cee832cca22409a4dbf8fb61dd84a40.webp?v=1752475555","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5f5cc76662d3e4f261f12f73cd475fcad647f211.webp?v=1752475556","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cd0524df6a6cec30fa070e69ef1f1f1a4c33503.webp?v=1752475556","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6203a9240db0f821048e6a06cf1c0efae099b4c1.webp?v=1752475557","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eba2c5061184e3fe396238467e40291eae853a52.webp?v=1752475557","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7f5994482cdf17e14151df48e1e9ab54f9a0c290.webp?v=1752475558","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c7f6da98281544857b207cd7ad9d053969391b0b.webp?v=1752475559","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21a8ee3f013a5a2f745227a57c4fd646005a0576.webp?v=1752475559"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9aee38db3c7b7bf4d6f9e037319b8f2cedaef6b.webp?v=1752475554","options":["color"],"media":[{"alt":null,"id":25816878350435,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9aee38db3c7b7bf4d6f9e037319b8f2cedaef6b.webp?v=1752475554"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9aee38db3c7b7bf4d6f9e037319b8f2cedaef6b.webp?v=1752475554","width":2000},{"alt":null,"id":25816878579811,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d89c96d9403ad584c4d78382632ea7047cb655c7.webp?v=1752475555"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d89c96d9403ad584c4d78382632ea7047cb655c7.webp?v=1752475555","width":2000},{"alt":null,"id":25816878645347,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b19d2172cee832cca22409a4dbf8fb61dd84a40.webp?v=1752475555"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b19d2172cee832cca22409a4dbf8fb61dd84a40.webp?v=1752475555","width":2000},{"alt":null,"id":25816878678115,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5f5cc76662d3e4f261f12f73cd475fcad647f211.webp?v=1752475556"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5f5cc76662d3e4f261f12f73cd475fcad647f211.webp?v=1752475556","width":2000},{"alt":null,"id":25816878809187,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cd0524df6a6cec30fa070e69ef1f1f1a4c33503.webp?v=1752475556"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cd0524df6a6cec30fa070e69ef1f1f1a4c33503.webp?v=1752475556","width":2000},{"alt":null,"id":25816878973027,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6203a9240db0f821048e6a06cf1c0efae099b4c1.webp?v=1752475557"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6203a9240db0f821048e6a06cf1c0efae099b4c1.webp?v=1752475557","width":2000},{"alt":null,"id":25816879104099,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eba2c5061184e3fe396238467e40291eae853a52.webp?v=1752475557"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eba2c5061184e3fe396238467e40291eae853a52.webp?v=1752475557","width":2000},{"alt":null,"id":25816879267939,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7f5994482cdf17e14151df48e1e9ab54f9a0c290.webp?v=1752475558"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7f5994482cdf17e14151df48e1e9ab54f9a0c290.webp?v=1752475558","width":2000},{"alt":null,"id":25816879595619,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c7f6da98281544857b207cd7ad9d053969391b0b.webp?v=1752475559"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c7f6da98281544857b207cd7ad9d053969391b0b.webp?v=1752475559","width":2000},{"alt":null,"id":25816879792227,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21a8ee3f013a5a2f745227a57c4fd646005a0576.webp?v=1752475559"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21a8ee3f013a5a2f745227a57c4fd646005a0576.webp?v=1752475559","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43525172625507,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-YN31","requires_shipping":true,"taxable":true,"featured_image":{"id":34179549495395,"product_id":7836866543715,"position":2,"created_at":"2025-07-14T14:45:53+08:00","updated_at":"2025-07-14T14:45:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d89c96d9403ad584c4d78382632ea7047cb655c7.webp?v=1752475555","variant_ids":[43525172625507]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 多彩系列-Jill - 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-YN31","featured_media":{"alt":null,"id":25816878579811,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d89c96d9403ad584c4d78382632ea7047cb655c7.webp?v=1752475555"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525172658275,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-YN31","requires_shipping":true,"taxable":true,"featured_image":{"id":34179550281827,"product_id":7836866543715,"position":6,"created_at":"2025-07-14T14:45:55+08:00","updated_at":"2025-07-14T14:45:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6203a9240db0f821048e6a06cf1c0efae099b4c1.webp?v=1752475557","variant_ids":[43525172658275]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 多彩系列-Jill - 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-YN31","featured_media":{"alt":null,"id":25816878973027,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6203a9240db0f821048e6a06cf1c0efae099b4c1.webp?v=1752475557"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525172789347,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-YN31","requires_shipping":true,"taxable":true,"featured_image":{"id":34179550609507,"product_id":7836866543715,"position":7,"created_at":"2025-07-14T14:45:55+08:00","updated_at":"2025-07-14T14:45:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eba2c5061184e3fe396238467e40291eae853a52.webp?v=1752475557","variant_ids":[43525172789347]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 多彩系列-Jill - 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-YN31","featured_media":{"alt":null,"id":25816879104099,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eba2c5061184e3fe396238467e40291eae853a52.webp?v=1752475557"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525172822115,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-YN31","requires_shipping":true,"taxable":true,"featured_image":{"id":34179549855843,"product_id":7836866543715,"position":4,"created_at":"2025-07-14T14:45:54+08:00","updated_at":"2025-07-14T14:45:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5f5cc76662d3e4f261f12f73cd475fcad647f211.webp?v=1752475556","variant_ids":[43525172822115]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 多彩系列-Jill - 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-YN31","featured_media":{"alt":null,"id":25816878678115,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5f5cc76662d3e4f261f12f73cd475fcad647f211.webp?v=1752475556"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525172854883,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-YN31","requires_shipping":true,"taxable":true,"featured_image":{"id":34179550052451,"product_id":7836866543715,"position":5,"created_at":"2025-07-14T14:45:54+08:00","updated_at":"2025-07-14T14:45:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cd0524df6a6cec30fa070e69ef1f1f1a4c33503.webp?v=1752475556","variant_ids":[43525172854883]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 多彩系列-Jill - 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-YN31","featured_media":{"alt":null,"id":25816878809187,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7cd0524df6a6cec30fa070e69ef1f1f1a4c33503.webp?v=1752475556"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43525172625507,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-YN31","requires_shipping":true,"taxable":true,"featured_image":{"id":34179549495395,"product_id":7836866543715,"position":2,"created_at":"2025-07-14T14:45:53+08:00","updated_at":"2025-07-14T14:45:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d89c96d9403ad584c4d78382632ea7047cb655c7.webp?v=1752475555","variant_ids":[43525172625507]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 多彩系列-Jill - 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-YN31","featured_media":{"alt":null,"id":25816878579811,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d89c96d9403ad584c4d78382632ea7047cb655c7.webp?v=1752475555"}},"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: "停產" }