$product = {"id":7884309463139,"title":"iPhone 15 Pro SolidX 坂本日常 傳說級殺手 坂本太郎","handle":"iphone-15-pro-solidx-ifc17","description":null,"published_at":"2025-09-19T09:33:53+08:00","created_at":"2025-09-16T12:41:50+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-sakamoto-days","device-iPhone 15 Pro","merge","reseller-sakamoto-days"],"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":43697687298147,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-IFC17","requires_shipping":true,"taxable":true,"featured_image":{"id":34475388043363,"product_id":7884309463139,"position":2,"created_at":"2025-09-16T12:41:55+08:00","updated_at":"2025-09-16T12:41:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/124784add3258828a07cd7a617045f431ed49332.webp?v=1757997717","variant_ids":[43697687298147]},"available":true,"name":"iPhone 15 Pro 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":"NST0129753-IFC17","featured_media":{"alt":null,"id":26046993629283,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/124784add3258828a07cd7a617045f431ed49332.webp?v=1757997717"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697691197539,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-IFC17","requires_shipping":true,"taxable":true,"featured_image":{"id":34475389485155,"product_id":7884309463139,"position":10,"created_at":"2025-09-16T12:41:59+08:00","updated_at":"2025-09-16T12:42:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae021e0ff57e437089ea5ceecaf971ab5f71ac0c.webp?v=1757997721","variant_ids":[43697691197539]},"available":true,"name":"iPhone 15 Pro SolidX 坂本日常 傳說級殺手 坂本太郎 - 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-IFC17","featured_media":{"alt":null,"id":26046995071075,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae021e0ff57e437089ea5ceecaf971ab5f71ac0c.webp?v=1757997721"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697691230307,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-IFC17","requires_shipping":true,"taxable":true,"featured_image":{"id":34475387682915,"product_id":7884309463139,"position":1,"created_at":"2025-09-16T12:41:54+08:00","updated_at":"2025-09-16T12:41:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d241d543202b74f0b1aab3ba5d0efd510c90381.webp?v=1757997716","variant_ids":[43697691230307]},"available":true,"name":"iPhone 15 Pro 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":"NST0129752-IFC17","featured_media":{"alt":null,"id":26046993268835,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d241d543202b74f0b1aab3ba5d0efd510c90381.webp?v=1757997716"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697691263075,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-IFC17","requires_shipping":true,"taxable":true,"featured_image":{"id":34475388633187,"product_id":7884309463139,"position":5,"created_at":"2025-09-16T12:41:57+08:00","updated_at":"2025-09-16T12:41:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/20267d2ba662e0a8aea23c8f71cea240e22cdcdf.webp?v=1757997719","variant_ids":[43697691263075]},"available":true,"name":"iPhone 15 Pro SolidX 坂本日常 傳說級殺手 坂本太郎 - 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-IFC17","featured_media":{"alt":null,"id":26046994120803,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/20267d2ba662e0a8aea23c8f71cea240e22cdcdf.webp?v=1757997719"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697691361379,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-IFC17","requires_shipping":true,"taxable":true,"featured_image":{"id":34475388207203,"product_id":7884309463139,"position":3,"created_at":"2025-09-16T12:41:56+08:00","updated_at":"2025-09-16T12:41:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9f6cf9115c075c91786c2d203fb227be2be2145c.webp?v=1757997718","variant_ids":[43697691361379]},"available":true,"name":"iPhone 15 Pro SolidX 坂本日常 傳說級殺手 坂本太郎 - 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-IFC17","featured_media":{"alt":null,"id":26046993793123,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9f6cf9115c075c91786c2d203fb227be2be2145c.webp?v=1757997718"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d241d543202b74f0b1aab3ba5d0efd510c90381.webp?v=1757997716","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/124784add3258828a07cd7a617045f431ed49332.webp?v=1757997717","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9f6cf9115c075c91786c2d203fb227be2be2145c.webp?v=1757997718","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/839f41e009bca67563b6dc44a7fba253d4e81778.webp?v=1757997718","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/20267d2ba662e0a8aea23c8f71cea240e22cdcdf.webp?v=1757997719","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73fe39accec1372e5cb182fb6f004daf0aa06c21.webp?v=1757997719","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb266f71345afa072a4e8cb5fa043015f67414a8.webp?v=1757997720","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c82c08e57334bc0625a6d3030d992f6a2d62ed7b.webp?v=1757997720","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40ea84a01ff59eda32f2224c76ad37bf95bab913.webp?v=1757997721","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae021e0ff57e437089ea5ceecaf971ab5f71ac0c.webp?v=1757997721"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d241d543202b74f0b1aab3ba5d0efd510c90381.webp?v=1757997716","options":["color"],"media":[{"alt":null,"id":26046993268835,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d241d543202b74f0b1aab3ba5d0efd510c90381.webp?v=1757997716"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d241d543202b74f0b1aab3ba5d0efd510c90381.webp?v=1757997716","width":2000},{"alt":null,"id":26046993629283,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/124784add3258828a07cd7a617045f431ed49332.webp?v=1757997717"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/124784add3258828a07cd7a617045f431ed49332.webp?v=1757997717","width":2000},{"alt":null,"id":26046993793123,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9f6cf9115c075c91786c2d203fb227be2be2145c.webp?v=1757997718"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9f6cf9115c075c91786c2d203fb227be2be2145c.webp?v=1757997718","width":2000},{"alt":null,"id":26046993891427,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/839f41e009bca67563b6dc44a7fba253d4e81778.webp?v=1757997718"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/839f41e009bca67563b6dc44a7fba253d4e81778.webp?v=1757997718","width":2000},{"alt":null,"id":26046994120803,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/20267d2ba662e0a8aea23c8f71cea240e22cdcdf.webp?v=1757997719"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/20267d2ba662e0a8aea23c8f71cea240e22cdcdf.webp?v=1757997719","width":2000},{"alt":null,"id":26046994382947,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73fe39accec1372e5cb182fb6f004daf0aa06c21.webp?v=1757997719"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73fe39accec1372e5cb182fb6f004daf0aa06c21.webp?v=1757997719","width":2000},{"alt":null,"id":26046994579555,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb266f71345afa072a4e8cb5fa043015f67414a8.webp?v=1757997720"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb266f71345afa072a4e8cb5fa043015f67414a8.webp?v=1757997720","width":2000},{"alt":null,"id":26046994645091,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c82c08e57334bc0625a6d3030d992f6a2d62ed7b.webp?v=1757997720"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c82c08e57334bc0625a6d3030d992f6a2d62ed7b.webp?v=1757997720","width":2000},{"alt":null,"id":26046994940003,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40ea84a01ff59eda32f2224c76ad37bf95bab913.webp?v=1757997721"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40ea84a01ff59eda32f2224c76ad37bf95bab913.webp?v=1757997721","width":2000},{"alt":null,"id":26046995071075,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae021e0ff57e437089ea5ceecaf971ab5f71ac0c.webp?v=1757997721"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae021e0ff57e437089ea5ceecaf971ab5f71ac0c.webp?v=1757997721","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43697687298147,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-IFC17","requires_shipping":true,"taxable":true,"featured_image":{"id":34475388043363,"product_id":7884309463139,"position":2,"created_at":"2025-09-16T12:41:55+08:00","updated_at":"2025-09-16T12:41:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/124784add3258828a07cd7a617045f431ed49332.webp?v=1757997717","variant_ids":[43697687298147]},"available":true,"name":"iPhone 15 Pro 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":"NST0129753-IFC17","featured_media":{"alt":null,"id":26046993629283,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/124784add3258828a07cd7a617045f431ed49332.webp?v=1757997717"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697691197539,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-IFC17","requires_shipping":true,"taxable":true,"featured_image":{"id":34475389485155,"product_id":7884309463139,"position":10,"created_at":"2025-09-16T12:41:59+08:00","updated_at":"2025-09-16T12:42:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae021e0ff57e437089ea5ceecaf971ab5f71ac0c.webp?v=1757997721","variant_ids":[43697691197539]},"available":true,"name":"iPhone 15 Pro SolidX 坂本日常 傳說級殺手 坂本太郎 - 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-IFC17","featured_media":{"alt":null,"id":26046995071075,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ae021e0ff57e437089ea5ceecaf971ab5f71ac0c.webp?v=1757997721"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697691230307,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-IFC17","requires_shipping":true,"taxable":true,"featured_image":{"id":34475387682915,"product_id":7884309463139,"position":1,"created_at":"2025-09-16T12:41:54+08:00","updated_at":"2025-09-16T12:41:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d241d543202b74f0b1aab3ba5d0efd510c90381.webp?v=1757997716","variant_ids":[43697691230307]},"available":true,"name":"iPhone 15 Pro 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":"NST0129752-IFC17","featured_media":{"alt":null,"id":26046993268835,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d241d543202b74f0b1aab3ba5d0efd510c90381.webp?v=1757997716"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697691263075,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-IFC17","requires_shipping":true,"taxable":true,"featured_image":{"id":34475388633187,"product_id":7884309463139,"position":5,"created_at":"2025-09-16T12:41:57+08:00","updated_at":"2025-09-16T12:41:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/20267d2ba662e0a8aea23c8f71cea240e22cdcdf.webp?v=1757997719","variant_ids":[43697691263075]},"available":true,"name":"iPhone 15 Pro SolidX 坂本日常 傳說級殺手 坂本太郎 - 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-IFC17","featured_media":{"alt":null,"id":26046994120803,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/20267d2ba662e0a8aea23c8f71cea240e22cdcdf.webp?v=1757997719"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697691361379,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-IFC17","requires_shipping":true,"taxable":true,"featured_image":{"id":34475388207203,"product_id":7884309463139,"position":3,"created_at":"2025-09-16T12:41:56+08:00","updated_at":"2025-09-16T12:41:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9f6cf9115c075c91786c2d203fb227be2be2145c.webp?v=1757997718","variant_ids":[43697691361379]},"available":true,"name":"iPhone 15 Pro SolidX 坂本日常 傳說級殺手 坂本太郎 - 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-IFC17","featured_media":{"alt":null,"id":26046993793123,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9f6cf9115c075c91786c2d203fb227be2be2145c.webp?v=1757997718"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43697687298147,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-IFC17","requires_shipping":true,"taxable":true,"featured_image":{"id":34475388043363,"product_id":7884309463139,"position":2,"created_at":"2025-09-16T12:41:55+08:00","updated_at":"2025-09-16T12:41:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/124784add3258828a07cd7a617045f431ed49332.webp?v=1757997717","variant_ids":[43697687298147]},"available":true,"name":"iPhone 15 Pro 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":"NST0129753-IFC17","featured_media":{"alt":null,"id":26046993629283,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/124784add3258828a07cd7a617045f431ed49332.webp?v=1757997717"}},"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: "停產" }