$product = {"id":7892622606435,"title":"iPhone 15 Pro Max SolidX Aaron Chang Waiting for","handle":"iphone-15-pro-max-solidx-aar08","description":null,"published_at":"2025-10-03T09:50:30+08:00","created_at":"2025-10-02T09:52:46+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-aaronchang","device-iPhone 15 Pro Max","merge","reseller-aaronchang"],"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":43756529352803,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543577268323,"product_id":7892622606435,"position":6,"created_at":"2025-10-02T09:52:54+08:00","updated_at":"2025-10-02T09:52:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5d243fe25fcaf0b9ecf774f25c72b3f08be4fb0.webp?v=1759369976","variant_ids":[43756529352803]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Waiting for - 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-AAR08","featured_media":{"alt":null,"id":26113332150371,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5d243fe25fcaf0b9ecf774f25c72b3f08be4fb0.webp?v=1759369976"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756529418339,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543577727075,"product_id":7892622606435,"position":8,"created_at":"2025-10-02T09:52:58+08:00","updated_at":"2025-10-02T09:53:00+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/449b5f0c8ad1eb434bd76946f022ffe084cce0c0.webp?v=1759369980","variant_ids":[43756529418339]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Waiting for - 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-AAR08","featured_media":{"alt":null,"id":26113332609123,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/449b5f0c8ad1eb434bd76946f022ffe084cce0c0.webp?v=1759369980"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756529451107,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543576481891,"product_id":7892622606435,"position":1,"created_at":"2025-10-02T09:52:50+08:00","updated_at":"2025-10-02T09:52:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfc72fe8e4c6fc593dc0124e868aefb8cfda9e9b.webp?v=1759369972","variant_ids":[43756529451107]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Waiting for - 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-AAR08","featured_media":{"alt":null,"id":26113331363939,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfc72fe8e4c6fc593dc0124e868aefb8cfda9e9b.webp?v=1759369972"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756529483875,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543576776803,"product_id":7892622606435,"position":3,"created_at":"2025-10-02T09:52:52+08:00","updated_at":"2025-10-02T09:52:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bb06ac59ddb8b43d8a53ab25eacbbccd68795b7.webp?v=1759369973","variant_ids":[43756529483875]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Waiting for - 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-AAR08","featured_media":{"alt":null,"id":26113331658851,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bb06ac59ddb8b43d8a53ab25eacbbccd68795b7.webp?v=1759369973"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756529516643,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543577006179,"product_id":7892622606435,"position":4,"created_at":"2025-10-02T09:52:52+08:00","updated_at":"2025-10-02T09:52:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54614f26c3277e49000726d8a66a038ec06a0696.webp?v=1759369974","variant_ids":[43756529516643]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Waiting for - 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-AAR08","featured_media":{"alt":null,"id":26113331888227,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54614f26c3277e49000726d8a66a038ec06a0696.webp?v=1759369974"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfc72fe8e4c6fc593dc0124e868aefb8cfda9e9b.webp?v=1759369972","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e4ba3e59c15f8b94d8081f76f39564ad199e2861.webp?v=1759369973","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bb06ac59ddb8b43d8a53ab25eacbbccd68795b7.webp?v=1759369973","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54614f26c3277e49000726d8a66a038ec06a0696.webp?v=1759369974","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/315f8cea73f117c331a3b31ca540fdbe13d09d7f.webp?v=1759369975","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5d243fe25fcaf0b9ecf774f25c72b3f08be4fb0.webp?v=1759369976","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98421972aa409a6328ccb32cfd1ba316ff34eca3.webp?v=1759369979","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/449b5f0c8ad1eb434bd76946f022ffe084cce0c0.webp?v=1759369980","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b151cfc8ac7b477f0b9aec3057d76aae63e92ae9.webp?v=1759369981","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/541d72c1d42ce4d07530cd27cc0536722c4218c5.webp?v=1759369981"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfc72fe8e4c6fc593dc0124e868aefb8cfda9e9b.webp?v=1759369972","options":["color"],"media":[{"alt":null,"id":26113331363939,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfc72fe8e4c6fc593dc0124e868aefb8cfda9e9b.webp?v=1759369972"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfc72fe8e4c6fc593dc0124e868aefb8cfda9e9b.webp?v=1759369972","width":2000},{"alt":null,"id":26113331462243,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e4ba3e59c15f8b94d8081f76f39564ad199e2861.webp?v=1759369973"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e4ba3e59c15f8b94d8081f76f39564ad199e2861.webp?v=1759369973","width":2000},{"alt":null,"id":26113331658851,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bb06ac59ddb8b43d8a53ab25eacbbccd68795b7.webp?v=1759369973"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bb06ac59ddb8b43d8a53ab25eacbbccd68795b7.webp?v=1759369973","width":2000},{"alt":null,"id":26113331888227,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54614f26c3277e49000726d8a66a038ec06a0696.webp?v=1759369974"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54614f26c3277e49000726d8a66a038ec06a0696.webp?v=1759369974","width":2000},{"alt":null,"id":26113332052067,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/315f8cea73f117c331a3b31ca540fdbe13d09d7f.webp?v=1759369975"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/315f8cea73f117c331a3b31ca540fdbe13d09d7f.webp?v=1759369975","width":2000},{"alt":null,"id":26113332150371,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5d243fe25fcaf0b9ecf774f25c72b3f08be4fb0.webp?v=1759369976"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5d243fe25fcaf0b9ecf774f25c72b3f08be4fb0.webp?v=1759369976","width":2000},{"alt":null,"id":26113332314211,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98421972aa409a6328ccb32cfd1ba316ff34eca3.webp?v=1759369979"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98421972aa409a6328ccb32cfd1ba316ff34eca3.webp?v=1759369979","width":2000},{"alt":null,"id":26113332609123,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/449b5f0c8ad1eb434bd76946f022ffe084cce0c0.webp?v=1759369980"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/449b5f0c8ad1eb434bd76946f022ffe084cce0c0.webp?v=1759369980","width":2000},{"alt":null,"id":26113332838499,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b151cfc8ac7b477f0b9aec3057d76aae63e92ae9.webp?v=1759369981"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b151cfc8ac7b477f0b9aec3057d76aae63e92ae9.webp?v=1759369981","width":2000},{"alt":null,"id":26113333002339,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/541d72c1d42ce4d07530cd27cc0536722c4218c5.webp?v=1759369981"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/541d72c1d42ce4d07530cd27cc0536722c4218c5.webp?v=1759369981","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43756529352803,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543577268323,"product_id":7892622606435,"position":6,"created_at":"2025-10-02T09:52:54+08:00","updated_at":"2025-10-02T09:52:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5d243fe25fcaf0b9ecf774f25c72b3f08be4fb0.webp?v=1759369976","variant_ids":[43756529352803]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Waiting for - 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-AAR08","featured_media":{"alt":null,"id":26113332150371,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5d243fe25fcaf0b9ecf774f25c72b3f08be4fb0.webp?v=1759369976"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756529418339,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543577727075,"product_id":7892622606435,"position":8,"created_at":"2025-10-02T09:52:58+08:00","updated_at":"2025-10-02T09:53:00+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/449b5f0c8ad1eb434bd76946f022ffe084cce0c0.webp?v=1759369980","variant_ids":[43756529418339]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Waiting for - 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-AAR08","featured_media":{"alt":null,"id":26113332609123,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/449b5f0c8ad1eb434bd76946f022ffe084cce0c0.webp?v=1759369980"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756529451107,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543576481891,"product_id":7892622606435,"position":1,"created_at":"2025-10-02T09:52:50+08:00","updated_at":"2025-10-02T09:52:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfc72fe8e4c6fc593dc0124e868aefb8cfda9e9b.webp?v=1759369972","variant_ids":[43756529451107]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Waiting for - 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-AAR08","featured_media":{"alt":null,"id":26113331363939,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfc72fe8e4c6fc593dc0124e868aefb8cfda9e9b.webp?v=1759369972"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756529483875,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543576776803,"product_id":7892622606435,"position":3,"created_at":"2025-10-02T09:52:52+08:00","updated_at":"2025-10-02T09:52:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bb06ac59ddb8b43d8a53ab25eacbbccd68795b7.webp?v=1759369973","variant_ids":[43756529483875]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Waiting for - 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-AAR08","featured_media":{"alt":null,"id":26113331658851,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bb06ac59ddb8b43d8a53ab25eacbbccd68795b7.webp?v=1759369973"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756529516643,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543577006179,"product_id":7892622606435,"position":4,"created_at":"2025-10-02T09:52:52+08:00","updated_at":"2025-10-02T09:52:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54614f26c3277e49000726d8a66a038ec06a0696.webp?v=1759369974","variant_ids":[43756529516643]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Waiting for - 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-AAR08","featured_media":{"alt":null,"id":26113331888227,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54614f26c3277e49000726d8a66a038ec06a0696.webp?v=1759369974"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43756529352803,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543577268323,"product_id":7892622606435,"position":6,"created_at":"2025-10-02T09:52:54+08:00","updated_at":"2025-10-02T09:52:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5d243fe25fcaf0b9ecf774f25c72b3f08be4fb0.webp?v=1759369976","variant_ids":[43756529352803]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Waiting for - 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-AAR08","featured_media":{"alt":null,"id":26113332150371,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5d243fe25fcaf0b9ecf774f25c72b3f08be4fb0.webp?v=1759369976"}},"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: "停產"
}