$product = {"id":7892614709347,"title":"iPhone 15 Pro Max SolidX Aaron Chang Yin\u0026Yang","handle":"iphone-15-pro-max-solidx-aar04","description":null,"published_at":"2025-10-03T09:51:50+08:00","created_at":"2025-10-02T09:48:57+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":43756497535075,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543544828003,"product_id":7892614709347,"position":7,"created_at":"2025-10-02T09:49:06+08:00","updated_at":"2025-10-02T09:49:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56bf1115d824a6f2c4af87122aa8ee69c470d0a8.webp?v=1759369749","variant_ids":[43756497535075]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113299710051,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56bf1115d824a6f2c4af87122aa8ee69c470d0a8.webp?v=1759369749"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756497600611,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543543451747,"product_id":7892614709347,"position":2,"created_at":"2025-10-02T09:49:03+08:00","updated_at":"2025-10-02T09:49:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/793b3c4ed82c85b0bc38e4b21c539e16d6dc0d5d.webp?v=1759369745","variant_ids":[43756497600611]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113298333795,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/793b3c4ed82c85b0bc38e4b21c539e16d6dc0d5d.webp?v=1759369745"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756497633379,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543544500323,"product_id":7892614709347,"position":6,"created_at":"2025-10-02T09:49:05+08:00","updated_at":"2025-10-02T09:49:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d09b08e64c1c7ba29b2a36e43135677bc15f65a.webp?v=1759369747","variant_ids":[43756497633379]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113299382371,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d09b08e64c1c7ba29b2a36e43135677bc15f65a.webp?v=1759369747"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756497666147,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543545417827,"product_id":7892614709347,"position":9,"created_at":"2025-10-02T09:49:08+08:00","updated_at":"2025-10-02T09:49:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f552d33b2e8bfea46afd1f11078e752b12764d22.webp?v=1759369750","variant_ids":[43756497666147]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113300299875,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f552d33b2e8bfea46afd1f11078e752b12764d22.webp?v=1759369750"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756497698915,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543543189603,"product_id":7892614709347,"position":1,"created_at":"2025-10-02T09:49:02+08:00","updated_at":"2025-10-02T09:49:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3a40734bab1e22b1d6147914bc0192d7343df30d.webp?v=1759369744","variant_ids":[43756497698915]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113298071651,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3a40734bab1e22b1d6147914bc0192d7343df30d.webp?v=1759369744"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3a40734bab1e22b1d6147914bc0192d7343df30d.webp?v=1759369744","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/793b3c4ed82c85b0bc38e4b21c539e16d6dc0d5d.webp?v=1759369745","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c6b051f6f7a752f7774f67d51c59c4f3c8c0ecf.webp?v=1759369746","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/efd48498292edd5e414b5ea78ba5497ea2dafb47.webp?v=1759369746","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0aae6422f601162de82ba94eda21c3d2a371f8c2.webp?v=1759369747","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d09b08e64c1c7ba29b2a36e43135677bc15f65a.webp?v=1759369747","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56bf1115d824a6f2c4af87122aa8ee69c470d0a8.webp?v=1759369749","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c852864e1fc961df3b85e524b7e8582c332efad.webp?v=1759369749","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f552d33b2e8bfea46afd1f11078e752b12764d22.webp?v=1759369750","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9147f84e5e5ac8aa02318018d455b61e35f514b.webp?v=1759369750"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3a40734bab1e22b1d6147914bc0192d7343df30d.webp?v=1759369744","options":["color"],"media":[{"alt":null,"id":26113298071651,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3a40734bab1e22b1d6147914bc0192d7343df30d.webp?v=1759369744"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3a40734bab1e22b1d6147914bc0192d7343df30d.webp?v=1759369744","width":2000},{"alt":null,"id":26113298333795,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/793b3c4ed82c85b0bc38e4b21c539e16d6dc0d5d.webp?v=1759369745"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/793b3c4ed82c85b0bc38e4b21c539e16d6dc0d5d.webp?v=1759369745","width":2000},{"alt":null,"id":26113298661475,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c6b051f6f7a752f7774f67d51c59c4f3c8c0ecf.webp?v=1759369746"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c6b051f6f7a752f7774f67d51c59c4f3c8c0ecf.webp?v=1759369746","width":2000},{"alt":null,"id":26113298890851,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/efd48498292edd5e414b5ea78ba5497ea2dafb47.webp?v=1759369746"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/efd48498292edd5e414b5ea78ba5497ea2dafb47.webp?v=1759369746","width":2000},{"alt":null,"id":26113299120227,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0aae6422f601162de82ba94eda21c3d2a371f8c2.webp?v=1759369747"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0aae6422f601162de82ba94eda21c3d2a371f8c2.webp?v=1759369747","width":2000},{"alt":null,"id":26113299382371,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d09b08e64c1c7ba29b2a36e43135677bc15f65a.webp?v=1759369747"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d09b08e64c1c7ba29b2a36e43135677bc15f65a.webp?v=1759369747","width":2000},{"alt":null,"id":26113299710051,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56bf1115d824a6f2c4af87122aa8ee69c470d0a8.webp?v=1759369749"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56bf1115d824a6f2c4af87122aa8ee69c470d0a8.webp?v=1759369749","width":2000},{"alt":null,"id":26113300168803,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c852864e1fc961df3b85e524b7e8582c332efad.webp?v=1759369749"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c852864e1fc961df3b85e524b7e8582c332efad.webp?v=1759369749","width":2000},{"alt":null,"id":26113300299875,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f552d33b2e8bfea46afd1f11078e752b12764d22.webp?v=1759369750"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f552d33b2e8bfea46afd1f11078e752b12764d22.webp?v=1759369750","width":2000},{"alt":null,"id":26113300463715,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9147f84e5e5ac8aa02318018d455b61e35f514b.webp?v=1759369750"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9147f84e5e5ac8aa02318018d455b61e35f514b.webp?v=1759369750","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43756497535075,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543544828003,"product_id":7892614709347,"position":7,"created_at":"2025-10-02T09:49:06+08:00","updated_at":"2025-10-02T09:49:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56bf1115d824a6f2c4af87122aa8ee69c470d0a8.webp?v=1759369749","variant_ids":[43756497535075]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113299710051,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56bf1115d824a6f2c4af87122aa8ee69c470d0a8.webp?v=1759369749"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756497600611,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543543451747,"product_id":7892614709347,"position":2,"created_at":"2025-10-02T09:49:03+08:00","updated_at":"2025-10-02T09:49:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/793b3c4ed82c85b0bc38e4b21c539e16d6dc0d5d.webp?v=1759369745","variant_ids":[43756497600611]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113298333795,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/793b3c4ed82c85b0bc38e4b21c539e16d6dc0d5d.webp?v=1759369745"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756497633379,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543544500323,"product_id":7892614709347,"position":6,"created_at":"2025-10-02T09:49:05+08:00","updated_at":"2025-10-02T09:49:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d09b08e64c1c7ba29b2a36e43135677bc15f65a.webp?v=1759369747","variant_ids":[43756497633379]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113299382371,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d09b08e64c1c7ba29b2a36e43135677bc15f65a.webp?v=1759369747"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756497666147,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543545417827,"product_id":7892614709347,"position":9,"created_at":"2025-10-02T09:49:08+08:00","updated_at":"2025-10-02T09:49:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f552d33b2e8bfea46afd1f11078e752b12764d22.webp?v=1759369750","variant_ids":[43756497666147]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113300299875,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f552d33b2e8bfea46afd1f11078e752b12764d22.webp?v=1759369750"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756497698915,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543543189603,"product_id":7892614709347,"position":1,"created_at":"2025-10-02T09:49:02+08:00","updated_at":"2025-10-02T09:49:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3a40734bab1e22b1d6147914bc0192d7343df30d.webp?v=1759369744","variant_ids":[43756497698915]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113298071651,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3a40734bab1e22b1d6147914bc0192d7343df30d.webp?v=1759369744"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43756497535075,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543544828003,"product_id":7892614709347,"position":7,"created_at":"2025-10-02T09:49:06+08:00","updated_at":"2025-10-02T09:49:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56bf1115d824a6f2c4af87122aa8ee69c470d0a8.webp?v=1759369749","variant_ids":[43756497535075]},"available":true,"name":"iPhone 15 Pro Max SolidX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113299710051,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56bf1115d824a6f2c4af87122aa8ee69c470d0a8.webp?v=1759369749"}},"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: "停產"
}