$product = {"id":7892330676323,"title":"iPhone 15 Pro Max SolidX 小王子 讓星星指引你","handle":"iphone-15-pro-max-solidx-to57","description":null,"published_at":"2025-10-03T10:21:44+08:00","created_at":"2025-10-01T15:27:40+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-le-petit-prince","device-iPhone 15 Pro Max","merge","reseller-le-petit-prince"],"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":43755328077923,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-TO57","requires_shipping":true,"taxable":true,"featured_image":{"id":34541888208995,"product_id":7892330676323,"position":3,"created_at":"2025-10-01T15:27:45+08:00","updated_at":"2025-10-01T15:27:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31d9fe04d0b32255bc0d1055afdc9e00abd2d44e.webp?v=1759303667","variant_ids":[43755328077923]},"available":true,"name":"iPhone 15 Pro Max 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":"NST0129853-TO57","featured_media":{"alt":null,"id":26111653281891,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31d9fe04d0b32255bc0d1055afdc9e00abd2d44e.webp?v=1759303667"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755328110691,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-TO57","requires_shipping":true,"taxable":true,"featured_image":{"id":34541889159267,"product_id":7892330676323,"position":8,"created_at":"2025-10-01T15:27:49+08:00","updated_at":"2025-10-01T15:27:51+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47a62538e559f6a479b6f4acc4c4dcc834d17209.webp?v=1759303671","variant_ids":[43755328110691]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 讓星星指引你 - 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-TO57","featured_media":{"alt":null,"id":26111654232163,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47a62538e559f6a479b6f4acc4c4dcc834d17209.webp?v=1759303671"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755328208995,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-TO57","requires_shipping":true,"taxable":true,"featured_image":{"id":34541888667747,"product_id":7892330676323,"position":5,"created_at":"2025-10-01T15:27:47+08:00","updated_at":"2025-10-01T15:27:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/efdd56482fa2f89f69c0617358f1018547a3d9d8.webp?v=1759303668","variant_ids":[43755328208995]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 讓星星指引你 - 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-TO57","featured_media":{"alt":null,"id":26111653740643,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/efdd56482fa2f89f69c0617358f1018547a3d9d8.webp?v=1759303668"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755328241763,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-TO57","requires_shipping":true,"taxable":true,"featured_image":{"id":34541887783011,"product_id":7892330676323,"position":1,"created_at":"2025-10-01T15:27:44+08:00","updated_at":"2025-10-01T15:27:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f245eb7754319282a7c7c02cc4a72d0a74761b3.webp?v=1759303665","variant_ids":[43755328241763]},"available":true,"name":"iPhone 15 Pro Max 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":"NST0129852-TO57","featured_media":{"alt":null,"id":26111652855907,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f245eb7754319282a7c7c02cc4a72d0a74761b3.webp?v=1759303665"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755328307299,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-TO57","requires_shipping":true,"taxable":true,"featured_image":{"id":34541889028195,"product_id":7892330676323,"position":7,"created_at":"2025-10-01T15:27:48+08:00","updated_at":"2025-10-01T15:27:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5023941de5768ddec8426d8d0ae81111dbbd13c5.webp?v=1759303670","variant_ids":[43755328307299]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 讓星星指引你 - 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-TO57","featured_media":{"alt":null,"id":26111654101091,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5023941de5768ddec8426d8d0ae81111dbbd13c5.webp?v=1759303670"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f245eb7754319282a7c7c02cc4a72d0a74761b3.webp?v=1759303665","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dae189cb64e8d1b71efd449c3c5ecffd6642ba5.webp?v=1759303666","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31d9fe04d0b32255bc0d1055afdc9e00abd2d44e.webp?v=1759303667","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/047e628ac1a05b38f9e8bbab1dda1cd6c96e6b45.webp?v=1759303668","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/efdd56482fa2f89f69c0617358f1018547a3d9d8.webp?v=1759303668","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/746ab08856179e4a0b2d067ce85f4fef838a1d6b.webp?v=1759303669","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5023941de5768ddec8426d8d0ae81111dbbd13c5.webp?v=1759303670","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47a62538e559f6a479b6f4acc4c4dcc834d17209.webp?v=1759303671","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0970a8cdb77e3c479358aab31426618e1e01f44e.webp?v=1759303671","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3064a4f8d0798dc1d07956cfcca91b24cdbe222.webp?v=1759303672"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f245eb7754319282a7c7c02cc4a72d0a74761b3.webp?v=1759303665","options":["color"],"media":[{"alt":null,"id":26111652855907,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f245eb7754319282a7c7c02cc4a72d0a74761b3.webp?v=1759303665"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f245eb7754319282a7c7c02cc4a72d0a74761b3.webp?v=1759303665","width":2000},{"alt":null,"id":26111653085283,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dae189cb64e8d1b71efd449c3c5ecffd6642ba5.webp?v=1759303666"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dae189cb64e8d1b71efd449c3c5ecffd6642ba5.webp?v=1759303666","width":2000},{"alt":null,"id":26111653281891,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31d9fe04d0b32255bc0d1055afdc9e00abd2d44e.webp?v=1759303667"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31d9fe04d0b32255bc0d1055afdc9e00abd2d44e.webp?v=1759303667","width":2000},{"alt":null,"id":26111653609571,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/047e628ac1a05b38f9e8bbab1dda1cd6c96e6b45.webp?v=1759303668"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/047e628ac1a05b38f9e8bbab1dda1cd6c96e6b45.webp?v=1759303668","width":2000},{"alt":null,"id":26111653740643,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/efdd56482fa2f89f69c0617358f1018547a3d9d8.webp?v=1759303668"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/efdd56482fa2f89f69c0617358f1018547a3d9d8.webp?v=1759303668","width":2000},{"alt":null,"id":26111653937251,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/746ab08856179e4a0b2d067ce85f4fef838a1d6b.webp?v=1759303669"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/746ab08856179e4a0b2d067ce85f4fef838a1d6b.webp?v=1759303669","width":2000},{"alt":null,"id":26111654101091,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5023941de5768ddec8426d8d0ae81111dbbd13c5.webp?v=1759303670"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5023941de5768ddec8426d8d0ae81111dbbd13c5.webp?v=1759303670","width":2000},{"alt":null,"id":26111654232163,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47a62538e559f6a479b6f4acc4c4dcc834d17209.webp?v=1759303671"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47a62538e559f6a479b6f4acc4c4dcc834d17209.webp?v=1759303671","width":2000},{"alt":null,"id":26111654330467,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0970a8cdb77e3c479358aab31426618e1e01f44e.webp?v=1759303671"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0970a8cdb77e3c479358aab31426618e1e01f44e.webp?v=1759303671","width":2000},{"alt":null,"id":26111654428771,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3064a4f8d0798dc1d07956cfcca91b24cdbe222.webp?v=1759303672"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3064a4f8d0798dc1d07956cfcca91b24cdbe222.webp?v=1759303672","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43755328077923,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-TO57","requires_shipping":true,"taxable":true,"featured_image":{"id":34541888208995,"product_id":7892330676323,"position":3,"created_at":"2025-10-01T15:27:45+08:00","updated_at":"2025-10-01T15:27:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31d9fe04d0b32255bc0d1055afdc9e00abd2d44e.webp?v=1759303667","variant_ids":[43755328077923]},"available":true,"name":"iPhone 15 Pro Max 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":"NST0129853-TO57","featured_media":{"alt":null,"id":26111653281891,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31d9fe04d0b32255bc0d1055afdc9e00abd2d44e.webp?v=1759303667"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755328110691,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-TO57","requires_shipping":true,"taxable":true,"featured_image":{"id":34541889159267,"product_id":7892330676323,"position":8,"created_at":"2025-10-01T15:27:49+08:00","updated_at":"2025-10-01T15:27:51+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47a62538e559f6a479b6f4acc4c4dcc834d17209.webp?v=1759303671","variant_ids":[43755328110691]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 讓星星指引你 - 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-TO57","featured_media":{"alt":null,"id":26111654232163,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47a62538e559f6a479b6f4acc4c4dcc834d17209.webp?v=1759303671"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755328208995,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-TO57","requires_shipping":true,"taxable":true,"featured_image":{"id":34541888667747,"product_id":7892330676323,"position":5,"created_at":"2025-10-01T15:27:47+08:00","updated_at":"2025-10-01T15:27:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/efdd56482fa2f89f69c0617358f1018547a3d9d8.webp?v=1759303668","variant_ids":[43755328208995]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 讓星星指引你 - 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-TO57","featured_media":{"alt":null,"id":26111653740643,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/efdd56482fa2f89f69c0617358f1018547a3d9d8.webp?v=1759303668"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755328241763,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-TO57","requires_shipping":true,"taxable":true,"featured_image":{"id":34541887783011,"product_id":7892330676323,"position":1,"created_at":"2025-10-01T15:27:44+08:00","updated_at":"2025-10-01T15:27:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f245eb7754319282a7c7c02cc4a72d0a74761b3.webp?v=1759303665","variant_ids":[43755328241763]},"available":true,"name":"iPhone 15 Pro Max 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":"NST0129852-TO57","featured_media":{"alt":null,"id":26111652855907,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f245eb7754319282a7c7c02cc4a72d0a74761b3.webp?v=1759303665"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755328307299,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-TO57","requires_shipping":true,"taxable":true,"featured_image":{"id":34541889028195,"product_id":7892330676323,"position":7,"created_at":"2025-10-01T15:27:48+08:00","updated_at":"2025-10-01T15:27:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5023941de5768ddec8426d8d0ae81111dbbd13c5.webp?v=1759303670","variant_ids":[43755328307299]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 讓星星指引你 - 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-TO57","featured_media":{"alt":null,"id":26111654101091,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5023941de5768ddec8426d8d0ae81111dbbd13c5.webp?v=1759303670"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43755328077923,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-TO57","requires_shipping":true,"taxable":true,"featured_image":{"id":34541888208995,"product_id":7892330676323,"position":3,"created_at":"2025-10-01T15:27:45+08:00","updated_at":"2025-10-01T15:27:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31d9fe04d0b32255bc0d1055afdc9e00abd2d44e.webp?v=1759303667","variant_ids":[43755328077923]},"available":true,"name":"iPhone 15 Pro Max 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":"NST0129853-TO57","featured_media":{"alt":null,"id":26111653281891,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31d9fe04d0b32255bc0d1055afdc9e00abd2d44e.webp?v=1759303667"}},"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: "停產" }