$product = {"id":7951324708963,"title":"iPhone 11 Mod NX 田中 Shen Sparkly","handle":"iphone-11-mod-nx-tan04","description":null,"published_at":"2026-01-13T10:08:23+08:00","created_at":"2026-01-12T17:18:35+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-tanakashen","device-iPhone 11","merge","reseller-tanakashen"],"price":90000,"price_min":90000,"price_max":90000,"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":43946383802467,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01148C1-TAN04","requires_shipping":true,"taxable":true,"featured_image":{"id":35094110339171,"product_id":7951324708963,"position":2,"created_at":"2026-01-12T17:18:40+08:00","updated_at":"2026-01-12T17:18:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c555f009bd7bec8efe5e8fc521e3adf24118ac09.webp?v=1768209521","variant_ids":[43946383802467]},"available":true,"name":"iPhone 11 Mod NX 田中 Shen Sparkly - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01148C1-TAN04","featured_media":{"alt":null,"id":26650766147683,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c555f009bd7bec8efe5e8fc521e3adf24118ac09.webp?v=1768209521"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946385866851,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0114857-TAN04","requires_shipping":true,"taxable":true,"featured_image":{"id":35094110470243,"product_id":7951324708963,"position":3,"created_at":"2026-01-12T17:18:40+08:00","updated_at":"2026-01-12T17:18:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426d5e8b5139014881f282e20e82176a82b85a04.webp?v=1768209522","variant_ids":[43946385866851]},"available":true,"name":"iPhone 11 Mod NX 田中 Shen Sparkly - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114857-TAN04","featured_media":{"alt":null,"id":26650766278755,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426d5e8b5139014881f282e20e82176a82b85a04.webp?v=1768209522"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946386030691,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0114804-TAN04","requires_shipping":true,"taxable":true,"featured_image":{"id":35094110208099,"product_id":7951324708963,"position":1,"created_at":"2026-01-12T17:18:39+08:00","updated_at":"2026-01-12T17:18:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/333f638e20e40e8936b234c5730c0b9d8686ad09.webp?v=1768209521","variant_ids":[43946386030691]},"available":true,"name":"iPhone 11 Mod NX 田中 Shen Sparkly - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114804-TAN04","featured_media":{"alt":null,"id":26650766016611,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/333f638e20e40e8936b234c5730c0b9d8686ad09.webp?v=1768209521"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946386063459,"title":"Camo Green","option1":"Camo Green","option2":null,"option3":null,"sku":"NPB0114815-TAN04","requires_shipping":true,"taxable":true,"featured_image":{"id":35094112108643,"product_id":7951324708963,"position":10,"created_at":"2026-01-12T17:18:45+08:00","updated_at":"2026-01-12T17:18:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426a7c76e3220549a8b98ca82aff844706388b0a.webp?v=1768209527","variant_ids":[43946386063459]},"available":true,"name":"iPhone 11 Mod NX 田中 Shen Sparkly - Camo Green","public_title":"Camo Green","options":["Camo Green"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114815-TAN04","featured_media":{"alt":null,"id":26650767917155,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426a7c76e3220549a8b98ca82aff844706388b0a.webp?v=1768209527"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946386128995,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0114824-TAN04","requires_shipping":true,"taxable":true,"featured_image":{"id":35094112272483,"product_id":7951324708963,"position":11,"created_at":"2026-01-12T17:18:46+08:00","updated_at":"2026-01-12T17:18:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69fbe1714760fe4d10040e7e8de2e68fcb159baf.webp?v=1768209528","variant_ids":[43946386128995]},"available":true,"name":"iPhone 11 Mod NX 田中 Shen Sparkly - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114824-TAN04","featured_media":{"alt":null,"id":26650768080995,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69fbe1714760fe4d10040e7e8de2e68fcb159baf.webp?v=1768209528"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/333f638e20e40e8936b234c5730c0b9d8686ad09.webp?v=1768209521","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c555f009bd7bec8efe5e8fc521e3adf24118ac09.webp?v=1768209521","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426d5e8b5139014881f282e20e82176a82b85a04.webp?v=1768209522","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/654eb1919abe9f678973060fe7bdea62ba392879.webp?v=1768209522","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e20c2907be0a3e1ae5f49347685e4f2195cc1fe1.webp?v=1768209525","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc43f95aed9c2e65fb15ee805f84377162a9d9cd.webp?v=1768209525","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdf9307aa792bd0213765dea7f015a82fdfde0e4.webp?v=1768209526","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/202a5bb7dfd71fca7f5995ea6b370de0afc04be6.webp?v=1768209526","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74b8c130b54585b64337fac9a3e2a52bae131a52.webp?v=1768209527","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426a7c76e3220549a8b98ca82aff844706388b0a.webp?v=1768209527","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69fbe1714760fe4d10040e7e8de2e68fcb159baf.webp?v=1768209528"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/333f638e20e40e8936b234c5730c0b9d8686ad09.webp?v=1768209521","options":["color"],"media":[{"alt":null,"id":26650766016611,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/333f638e20e40e8936b234c5730c0b9d8686ad09.webp?v=1768209521"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/333f638e20e40e8936b234c5730c0b9d8686ad09.webp?v=1768209521","width":2000},{"alt":null,"id":26650766147683,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c555f009bd7bec8efe5e8fc521e3adf24118ac09.webp?v=1768209521"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c555f009bd7bec8efe5e8fc521e3adf24118ac09.webp?v=1768209521","width":2000},{"alt":null,"id":26650766278755,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426d5e8b5139014881f282e20e82176a82b85a04.webp?v=1768209522"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426d5e8b5139014881f282e20e82176a82b85a04.webp?v=1768209522","width":2000},{"alt":null,"id":26650766377059,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/654eb1919abe9f678973060fe7bdea62ba392879.webp?v=1768209522"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/654eb1919abe9f678973060fe7bdea62ba392879.webp?v=1768209522","width":2000},{"alt":null,"id":26650766606435,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e20c2907be0a3e1ae5f49347685e4f2195cc1fe1.webp?v=1768209525"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e20c2907be0a3e1ae5f49347685e4f2195cc1fe1.webp?v=1768209525","width":2000},{"alt":null,"id":26650767065187,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc43f95aed9c2e65fb15ee805f84377162a9d9cd.webp?v=1768209525"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc43f95aed9c2e65fb15ee805f84377162a9d9cd.webp?v=1768209525","width":2000},{"alt":null,"id":26650767327331,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdf9307aa792bd0213765dea7f015a82fdfde0e4.webp?v=1768209526"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdf9307aa792bd0213765dea7f015a82fdfde0e4.webp?v=1768209526","width":2000},{"alt":null,"id":26650767556707,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/202a5bb7dfd71fca7f5995ea6b370de0afc04be6.webp?v=1768209526"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/202a5bb7dfd71fca7f5995ea6b370de0afc04be6.webp?v=1768209526","width":2000},{"alt":null,"id":26650767753315,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74b8c130b54585b64337fac9a3e2a52bae131a52.webp?v=1768209527"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74b8c130b54585b64337fac9a3e2a52bae131a52.webp?v=1768209527","width":2000},{"alt":null,"id":26650767917155,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426a7c76e3220549a8b98ca82aff844706388b0a.webp?v=1768209527"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426a7c76e3220549a8b98ca82aff844706388b0a.webp?v=1768209527","width":2000},{"alt":null,"id":26650768080995,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69fbe1714760fe4d10040e7e8de2e68fcb159baf.webp?v=1768209528"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69fbe1714760fe4d10040e7e8de2e68fcb159baf.webp?v=1768209528","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43946383802467,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01148C1-TAN04","requires_shipping":true,"taxable":true,"featured_image":{"id":35094110339171,"product_id":7951324708963,"position":2,"created_at":"2026-01-12T17:18:40+08:00","updated_at":"2026-01-12T17:18:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c555f009bd7bec8efe5e8fc521e3adf24118ac09.webp?v=1768209521","variant_ids":[43946383802467]},"available":true,"name":"iPhone 11 Mod NX 田中 Shen Sparkly - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01148C1-TAN04","featured_media":{"alt":null,"id":26650766147683,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c555f009bd7bec8efe5e8fc521e3adf24118ac09.webp?v=1768209521"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946385866851,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0114857-TAN04","requires_shipping":true,"taxable":true,"featured_image":{"id":35094110470243,"product_id":7951324708963,"position":3,"created_at":"2026-01-12T17:18:40+08:00","updated_at":"2026-01-12T17:18:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426d5e8b5139014881f282e20e82176a82b85a04.webp?v=1768209522","variant_ids":[43946385866851]},"available":true,"name":"iPhone 11 Mod NX 田中 Shen Sparkly - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114857-TAN04","featured_media":{"alt":null,"id":26650766278755,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426d5e8b5139014881f282e20e82176a82b85a04.webp?v=1768209522"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946386030691,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0114804-TAN04","requires_shipping":true,"taxable":true,"featured_image":{"id":35094110208099,"product_id":7951324708963,"position":1,"created_at":"2026-01-12T17:18:39+08:00","updated_at":"2026-01-12T17:18:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/333f638e20e40e8936b234c5730c0b9d8686ad09.webp?v=1768209521","variant_ids":[43946386030691]},"available":true,"name":"iPhone 11 Mod NX 田中 Shen Sparkly - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114804-TAN04","featured_media":{"alt":null,"id":26650766016611,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/333f638e20e40e8936b234c5730c0b9d8686ad09.webp?v=1768209521"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946386063459,"title":"Camo Green","option1":"Camo Green","option2":null,"option3":null,"sku":"NPB0114815-TAN04","requires_shipping":true,"taxable":true,"featured_image":{"id":35094112108643,"product_id":7951324708963,"position":10,"created_at":"2026-01-12T17:18:45+08:00","updated_at":"2026-01-12T17:18:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426a7c76e3220549a8b98ca82aff844706388b0a.webp?v=1768209527","variant_ids":[43946386063459]},"available":true,"name":"iPhone 11 Mod NX 田中 Shen Sparkly - Camo Green","public_title":"Camo Green","options":["Camo Green"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114815-TAN04","featured_media":{"alt":null,"id":26650767917155,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/426a7c76e3220549a8b98ca82aff844706388b0a.webp?v=1768209527"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946386128995,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0114824-TAN04","requires_shipping":true,"taxable":true,"featured_image":{"id":35094112272483,"product_id":7951324708963,"position":11,"created_at":"2026-01-12T17:18:46+08:00","updated_at":"2026-01-12T17:18:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69fbe1714760fe4d10040e7e8de2e68fcb159baf.webp?v=1768209528","variant_ids":[43946386128995]},"available":true,"name":"iPhone 11 Mod NX 田中 Shen Sparkly - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114824-TAN04","featured_media":{"alt":null,"id":26650768080995,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69fbe1714760fe4d10040e7e8de2e68fcb159baf.webp?v=1768209528"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43946383802467,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01148C1-TAN04","requires_shipping":true,"taxable":true,"featured_image":{"id":35094110339171,"product_id":7951324708963,"position":2,"created_at":"2026-01-12T17:18:40+08:00","updated_at":"2026-01-12T17:18:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c555f009bd7bec8efe5e8fc521e3adf24118ac09.webp?v=1768209521","variant_ids":[43946383802467]},"available":true,"name":"iPhone 11 Mod NX 田中 Shen Sparkly - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01148C1-TAN04","featured_media":{"alt":null,"id":26650766147683,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c555f009bd7bec8efe5e8fc521e3adf24118ac09.webp?v=1768209521"}},"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: "停產" }