$product = {"id":7951313698915,"title":"iPhone 15 Pro SolidX 田中 Shen Dream","handle":"iphone-15-pro-solidx-tan06","description":null,"published_at":"2026-01-13T10:11:20+08:00","created_at":"2026-01-12T17:16:08+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-tanakashen","device-iPhone 15 Pro","merge","reseller-tanakashen"],"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":43946340909155,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-TAN06","requires_shipping":true,"taxable":true,"featured_image":{"id":35094067118179,"product_id":7951313698915,"position":2,"created_at":"2026-01-12T17:16:12+08:00","updated_at":"2026-01-12T17:16:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06f7a5813fc91c1ac72fa91cfeea4062e6e7a9c9.webp?v=1768209374","variant_ids":[43946340909155]},"available":true,"name":"iPhone 15 Pro SolidX 田中 Shen Dream - 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-TAN06","featured_media":{"alt":null,"id":26650722926691,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06f7a5813fc91c1ac72fa91cfeea4062e6e7a9c9.webp?v=1768209374"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946343858275,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-TAN06","requires_shipping":true,"taxable":true,"featured_image":{"id":35094067904611,"product_id":7951313698915,"position":7,"created_at":"2026-01-12T17:16:15+08:00","updated_at":"2026-01-12T17:16:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/022a7a17d3fc88b3df38f1df414335264eac74ef.webp?v=1768209376","variant_ids":[43946343858275]},"available":true,"name":"iPhone 15 Pro SolidX 田中 Shen Dream - 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-TAN06","featured_media":{"alt":null,"id":26650723713123,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/022a7a17d3fc88b3df38f1df414335264eac74ef.webp?v=1768209376"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946343989347,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-TAN06","requires_shipping":true,"taxable":true,"featured_image":{"id":35094067478627,"product_id":7951313698915,"position":5,"created_at":"2026-01-12T17:16:14+08:00","updated_at":"2026-01-12T17:16:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b516daba8dc7ad15602d7bd19a099605b271112.webp?v=1768209376","variant_ids":[43946343989347]},"available":true,"name":"iPhone 15 Pro SolidX 田中 Shen Dream - 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-TAN06","featured_media":{"alt":null,"id":26650723287139,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b516daba8dc7ad15602d7bd19a099605b271112.webp?v=1768209376"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946344054883,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-TAN06","requires_shipping":true,"taxable":true,"featured_image":{"id":35094066987107,"product_id":7951313698915,"position":1,"created_at":"2026-01-12T17:16:12+08:00","updated_at":"2026-01-12T17:16:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb17dd66c902f5ff6a5f8a7c8a1db81a82c6eaad.webp?v=1768209374","variant_ids":[43946344054883]},"available":true,"name":"iPhone 15 Pro SolidX 田中 Shen Dream - 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-TAN06","featured_media":{"alt":null,"id":26650722533475,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb17dd66c902f5ff6a5f8a7c8a1db81a82c6eaad.webp?v=1768209374"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946344120419,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-TAN06","requires_shipping":true,"taxable":true,"featured_image":{"id":35094067314787,"product_id":7951313698915,"position":4,"created_at":"2026-01-12T17:16:13+08:00","updated_at":"2026-01-12T17:16:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c6a0758e0143b1c9d222189c746bc8b384b21c2.webp?v=1768209375","variant_ids":[43946344120419]},"available":true,"name":"iPhone 15 Pro SolidX 田中 Shen Dream - 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-TAN06","featured_media":{"alt":null,"id":26650723123299,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c6a0758e0143b1c9d222189c746bc8b384b21c2.webp?v=1768209375"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb17dd66c902f5ff6a5f8a7c8a1db81a82c6eaad.webp?v=1768209374","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06f7a5813fc91c1ac72fa91cfeea4062e6e7a9c9.webp?v=1768209374","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/705c8c334d4d1f5b893a15c32d62a88736d4add5.webp?v=1768209375","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c6a0758e0143b1c9d222189c746bc8b384b21c2.webp?v=1768209375","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b516daba8dc7ad15602d7bd19a099605b271112.webp?v=1768209376","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e586d9d2a089ee5fb70a01da67b0659dd54b2f2.webp?v=1768209376","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/022a7a17d3fc88b3df38f1df414335264eac74ef.webp?v=1768209376","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b71b2bae94e134852f7f2206eb800099c0308ca.webp?v=1768209377","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83f09b63597d385dcaeaa7b2e0042fb1ad5d269e.webp?v=1768209377","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5cca5e9425f0a5c747ad19c5d3d37ae7b5ed2864.webp?v=1768209378"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb17dd66c902f5ff6a5f8a7c8a1db81a82c6eaad.webp?v=1768209374","options":["color"],"media":[{"alt":null,"id":26650722533475,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb17dd66c902f5ff6a5f8a7c8a1db81a82c6eaad.webp?v=1768209374"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb17dd66c902f5ff6a5f8a7c8a1db81a82c6eaad.webp?v=1768209374","width":2000},{"alt":null,"id":26650722926691,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06f7a5813fc91c1ac72fa91cfeea4062e6e7a9c9.webp?v=1768209374"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06f7a5813fc91c1ac72fa91cfeea4062e6e7a9c9.webp?v=1768209374","width":2000},{"alt":null,"id":26650723024995,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/705c8c334d4d1f5b893a15c32d62a88736d4add5.webp?v=1768209375"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/705c8c334d4d1f5b893a15c32d62a88736d4add5.webp?v=1768209375","width":2000},{"alt":null,"id":26650723123299,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c6a0758e0143b1c9d222189c746bc8b384b21c2.webp?v=1768209375"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c6a0758e0143b1c9d222189c746bc8b384b21c2.webp?v=1768209375","width":2000},{"alt":null,"id":26650723287139,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b516daba8dc7ad15602d7bd19a099605b271112.webp?v=1768209376"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b516daba8dc7ad15602d7bd19a099605b271112.webp?v=1768209376","width":2000},{"alt":null,"id":26650723516515,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e586d9d2a089ee5fb70a01da67b0659dd54b2f2.webp?v=1768209376"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e586d9d2a089ee5fb70a01da67b0659dd54b2f2.webp?v=1768209376","width":2000},{"alt":null,"id":26650723713123,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/022a7a17d3fc88b3df38f1df414335264eac74ef.webp?v=1768209376"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/022a7a17d3fc88b3df38f1df414335264eac74ef.webp?v=1768209376","width":2000},{"alt":null,"id":26650723942499,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b71b2bae94e134852f7f2206eb800099c0308ca.webp?v=1768209377"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1b71b2bae94e134852f7f2206eb800099c0308ca.webp?v=1768209377","width":2000},{"alt":null,"id":26650724171875,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83f09b63597d385dcaeaa7b2e0042fb1ad5d269e.webp?v=1768209377"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83f09b63597d385dcaeaa7b2e0042fb1ad5d269e.webp?v=1768209377","width":2000},{"alt":null,"id":26650724368483,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5cca5e9425f0a5c747ad19c5d3d37ae7b5ed2864.webp?v=1768209378"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5cca5e9425f0a5c747ad19c5d3d37ae7b5ed2864.webp?v=1768209378","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43946340909155,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-TAN06","requires_shipping":true,"taxable":true,"featured_image":{"id":35094067118179,"product_id":7951313698915,"position":2,"created_at":"2026-01-12T17:16:12+08:00","updated_at":"2026-01-12T17:16:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06f7a5813fc91c1ac72fa91cfeea4062e6e7a9c9.webp?v=1768209374","variant_ids":[43946340909155]},"available":true,"name":"iPhone 15 Pro SolidX 田中 Shen Dream - 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-TAN06","featured_media":{"alt":null,"id":26650722926691,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06f7a5813fc91c1ac72fa91cfeea4062e6e7a9c9.webp?v=1768209374"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946343858275,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-TAN06","requires_shipping":true,"taxable":true,"featured_image":{"id":35094067904611,"product_id":7951313698915,"position":7,"created_at":"2026-01-12T17:16:15+08:00","updated_at":"2026-01-12T17:16:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/022a7a17d3fc88b3df38f1df414335264eac74ef.webp?v=1768209376","variant_ids":[43946343858275]},"available":true,"name":"iPhone 15 Pro SolidX 田中 Shen Dream - 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-TAN06","featured_media":{"alt":null,"id":26650723713123,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/022a7a17d3fc88b3df38f1df414335264eac74ef.webp?v=1768209376"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946343989347,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-TAN06","requires_shipping":true,"taxable":true,"featured_image":{"id":35094067478627,"product_id":7951313698915,"position":5,"created_at":"2026-01-12T17:16:14+08:00","updated_at":"2026-01-12T17:16:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b516daba8dc7ad15602d7bd19a099605b271112.webp?v=1768209376","variant_ids":[43946343989347]},"available":true,"name":"iPhone 15 Pro SolidX 田中 Shen Dream - 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-TAN06","featured_media":{"alt":null,"id":26650723287139,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b516daba8dc7ad15602d7bd19a099605b271112.webp?v=1768209376"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946344054883,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-TAN06","requires_shipping":true,"taxable":true,"featured_image":{"id":35094066987107,"product_id":7951313698915,"position":1,"created_at":"2026-01-12T17:16:12+08:00","updated_at":"2026-01-12T17:16:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb17dd66c902f5ff6a5f8a7c8a1db81a82c6eaad.webp?v=1768209374","variant_ids":[43946344054883]},"available":true,"name":"iPhone 15 Pro SolidX 田中 Shen Dream - 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-TAN06","featured_media":{"alt":null,"id":26650722533475,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb17dd66c902f5ff6a5f8a7c8a1db81a82c6eaad.webp?v=1768209374"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43946344120419,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-TAN06","requires_shipping":true,"taxable":true,"featured_image":{"id":35094067314787,"product_id":7951313698915,"position":4,"created_at":"2026-01-12T17:16:13+08:00","updated_at":"2026-01-12T17:16:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c6a0758e0143b1c9d222189c746bc8b384b21c2.webp?v=1768209375","variant_ids":[43946344120419]},"available":true,"name":"iPhone 15 Pro SolidX 田中 Shen Dream - 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-TAN06","featured_media":{"alt":null,"id":26650723123299,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c6a0758e0143b1c9d222189c746bc8b384b21c2.webp?v=1768209375"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43946340909155,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-TAN06","requires_shipping":true,"taxable":true,"featured_image":{"id":35094067118179,"product_id":7951313698915,"position":2,"created_at":"2026-01-12T17:16:12+08:00","updated_at":"2026-01-12T17:16:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06f7a5813fc91c1ac72fa91cfeea4062e6e7a9c9.webp?v=1768209374","variant_ids":[43946340909155]},"available":true,"name":"iPhone 15 Pro SolidX 田中 Shen Dream - 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-TAN06","featured_media":{"alt":null,"id":26650722926691,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06f7a5813fc91c1ac72fa91cfeea4062e6e7a9c9.webp?v=1768209374"}},"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: "停產" }