$product = {"id":7892715241571,"title":"iPhone 11 Mod NX Aaron Chang Waiting for","handle":"iphone-11-mod-nx-printable-aar08","description":null,"published_at":"2025-10-03T09:35:15+08:00","created_at":"2025-10-02T10:18:38+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-aaronchang","device-iPhone 11","merge","reseller-aaronchang"],"price":90000,"price_min":90000,"price_max":90000,"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":43756875350115,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01148C1-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543932211299,"product_id":7892715241571,"position":6,"created_at":"2025-10-02T10:18:42+08:00","updated_at":"2025-10-02T10:18:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bad758e1d96d62ee44482af5bf27244bcb9740b7.webp?v=1759371524","variant_ids":[43756875350115]},"available":true,"name":"iPhone 11 Mod NX Aaron Chang Waiting for - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01148C1-AAR08","featured_media":{"alt":null,"id":26113687093347,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bad758e1d96d62ee44482af5bf27244bcb9740b7.webp?v=1759371524"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756879970403,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0114804-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543933030499,"product_id":7892715241571,"position":9,"created_at":"2025-10-02T10:18:44+08:00","updated_at":"2025-10-02T10:18:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec55bcea64604a49f74b3b2376190686e54f6e43.webp?v=1759371526","variant_ids":[43756879970403]},"available":true,"name":"iPhone 11 Mod NX Aaron Chang Waiting for - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114804-AAR08","featured_media":{"alt":null,"id":26113687879779,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec55bcea64604a49f74b3b2376190686e54f6e43.webp?v=1759371526"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756880101475,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0114857-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543931949155,"product_id":7892715241571,"position":5,"created_at":"2025-10-02T10:18:42+08:00","updated_at":"2025-10-02T10:18:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/110c82d214bc8fa96aaa5dfdae89facd4f5b3ad5.webp?v=1759371524","variant_ids":[43756880101475]},"available":true,"name":"iPhone 11 Mod NX Aaron Chang Waiting for - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114857-AAR08","featured_media":{"alt":null,"id":26113686831203,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/110c82d214bc8fa96aaa5dfdae89facd4f5b3ad5.webp?v=1759371524"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756880167011,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0114824-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543930900579,"product_id":7892715241571,"position":1,"created_at":"2025-10-02T10:18:39+08:00","updated_at":"2025-10-02T10:18:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed262007b8cd3424b1b69a2fb3b5109082a51243.webp?v=1759371521","variant_ids":[43756880167011]},"available":true,"name":"iPhone 11 Mod NX Aaron Chang Waiting for - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114824-AAR08","featured_media":{"alt":null,"id":26113685782627,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed262007b8cd3424b1b69a2fb3b5109082a51243.webp?v=1759371521"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756880199779,"title":"Camo Green","option1":"Camo Green","option2":null,"option3":null,"sku":"NPB0114815-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543932473443,"product_id":7892715241571,"position":7,"created_at":"2025-10-02T10:18:43+08:00","updated_at":"2025-10-02T10:18:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/013a9f8165b91c92400e4fcabe796b66c52d6269.webp?v=1759371525","variant_ids":[43756880199779]},"available":true,"name":"iPhone 11 Mod NX Aaron Chang Waiting for - Camo Green","public_title":"Camo Green","options":["Camo Green"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114815-AAR08","featured_media":{"alt":null,"id":26113687355491,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/013a9f8165b91c92400e4fcabe796b66c52d6269.webp?v=1759371525"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed262007b8cd3424b1b69a2fb3b5109082a51243.webp?v=1759371521","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e8b5d13d101ac82efa44fdd1716abfc593684d5.webp?v=1759371521","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0c834cdc72f893ddcc754eb92777a4ae56f25e97.webp?v=1759371522","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/918cdfb3fbf740a6e6a20a283ddf23e251893744.webp?v=1759371523","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/110c82d214bc8fa96aaa5dfdae89facd4f5b3ad5.webp?v=1759371524","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bad758e1d96d62ee44482af5bf27244bcb9740b7.webp?v=1759371524","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/013a9f8165b91c92400e4fcabe796b66c52d6269.webp?v=1759371525","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/471a69460c67c872d643b87b1069b3f2a5028722.webp?v=1759371526","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec55bcea64604a49f74b3b2376190686e54f6e43.webp?v=1759371526","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f1eec9e0a1095c294fa506dbf157bdb34838d16.webp?v=1759371527","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/abb5a5eab43d93757fb3048c24d218511fc8d0b7.webp?v=1759371528"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed262007b8cd3424b1b69a2fb3b5109082a51243.webp?v=1759371521","options":["color"],"media":[{"alt":null,"id":26113685782627,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed262007b8cd3424b1b69a2fb3b5109082a51243.webp?v=1759371521"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed262007b8cd3424b1b69a2fb3b5109082a51243.webp?v=1759371521","width":2000},{"alt":null,"id":26113686044771,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e8b5d13d101ac82efa44fdd1716abfc593684d5.webp?v=1759371521"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e8b5d13d101ac82efa44fdd1716abfc593684d5.webp?v=1759371521","width":2000},{"alt":null,"id":26113686372451,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0c834cdc72f893ddcc754eb92777a4ae56f25e97.webp?v=1759371522"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0c834cdc72f893ddcc754eb92777a4ae56f25e97.webp?v=1759371522","width":2000},{"alt":null,"id":26113686601827,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/918cdfb3fbf740a6e6a20a283ddf23e251893744.webp?v=1759371523"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/918cdfb3fbf740a6e6a20a283ddf23e251893744.webp?v=1759371523","width":2000},{"alt":null,"id":26113686831203,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/110c82d214bc8fa96aaa5dfdae89facd4f5b3ad5.webp?v=1759371524"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/110c82d214bc8fa96aaa5dfdae89facd4f5b3ad5.webp?v=1759371524","width":2000},{"alt":null,"id":26113687093347,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bad758e1d96d62ee44482af5bf27244bcb9740b7.webp?v=1759371524"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bad758e1d96d62ee44482af5bf27244bcb9740b7.webp?v=1759371524","width":2000},{"alt":null,"id":26113687355491,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/013a9f8165b91c92400e4fcabe796b66c52d6269.webp?v=1759371525"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/013a9f8165b91c92400e4fcabe796b66c52d6269.webp?v=1759371525","width":2000},{"alt":null,"id":26113687683171,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/471a69460c67c872d643b87b1069b3f2a5028722.webp?v=1759371526"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/471a69460c67c872d643b87b1069b3f2a5028722.webp?v=1759371526","width":2000},{"alt":null,"id":26113687879779,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec55bcea64604a49f74b3b2376190686e54f6e43.webp?v=1759371526"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec55bcea64604a49f74b3b2376190686e54f6e43.webp?v=1759371526","width":2000},{"alt":null,"id":26113688043619,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f1eec9e0a1095c294fa506dbf157bdb34838d16.webp?v=1759371527"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1f1eec9e0a1095c294fa506dbf157bdb34838d16.webp?v=1759371527","width":2000},{"alt":null,"id":26113688371299,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/abb5a5eab43d93757fb3048c24d218511fc8d0b7.webp?v=1759371528"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/abb5a5eab43d93757fb3048c24d218511fc8d0b7.webp?v=1759371528","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43756875350115,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01148C1-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543932211299,"product_id":7892715241571,"position":6,"created_at":"2025-10-02T10:18:42+08:00","updated_at":"2025-10-02T10:18:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bad758e1d96d62ee44482af5bf27244bcb9740b7.webp?v=1759371524","variant_ids":[43756875350115]},"available":true,"name":"iPhone 11 Mod NX Aaron Chang Waiting for - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01148C1-AAR08","featured_media":{"alt":null,"id":26113687093347,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bad758e1d96d62ee44482af5bf27244bcb9740b7.webp?v=1759371524"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756879970403,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0114804-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543933030499,"product_id":7892715241571,"position":9,"created_at":"2025-10-02T10:18:44+08:00","updated_at":"2025-10-02T10:18:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec55bcea64604a49f74b3b2376190686e54f6e43.webp?v=1759371526","variant_ids":[43756879970403]},"available":true,"name":"iPhone 11 Mod NX Aaron Chang Waiting for - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114804-AAR08","featured_media":{"alt":null,"id":26113687879779,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec55bcea64604a49f74b3b2376190686e54f6e43.webp?v=1759371526"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756880101475,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0114857-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543931949155,"product_id":7892715241571,"position":5,"created_at":"2025-10-02T10:18:42+08:00","updated_at":"2025-10-02T10:18:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/110c82d214bc8fa96aaa5dfdae89facd4f5b3ad5.webp?v=1759371524","variant_ids":[43756880101475]},"available":true,"name":"iPhone 11 Mod NX Aaron Chang Waiting for - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114857-AAR08","featured_media":{"alt":null,"id":26113686831203,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/110c82d214bc8fa96aaa5dfdae89facd4f5b3ad5.webp?v=1759371524"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756880167011,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0114824-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543930900579,"product_id":7892715241571,"position":1,"created_at":"2025-10-02T10:18:39+08:00","updated_at":"2025-10-02T10:18:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed262007b8cd3424b1b69a2fb3b5109082a51243.webp?v=1759371521","variant_ids":[43756880167011]},"available":true,"name":"iPhone 11 Mod NX Aaron Chang Waiting for - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114824-AAR08","featured_media":{"alt":null,"id":26113685782627,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ed262007b8cd3424b1b69a2fb3b5109082a51243.webp?v=1759371521"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756880199779,"title":"Camo Green","option1":"Camo Green","option2":null,"option3":null,"sku":"NPB0114815-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543932473443,"product_id":7892715241571,"position":7,"created_at":"2025-10-02T10:18:43+08:00","updated_at":"2025-10-02T10:18:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/013a9f8165b91c92400e4fcabe796b66c52d6269.webp?v=1759371525","variant_ids":[43756880199779]},"available":true,"name":"iPhone 11 Mod NX Aaron Chang Waiting for - Camo Green","public_title":"Camo Green","options":["Camo Green"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0114815-AAR08","featured_media":{"alt":null,"id":26113687355491,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/013a9f8165b91c92400e4fcabe796b66c52d6269.webp?v=1759371525"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43756875350115,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01148C1-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543932211299,"product_id":7892715241571,"position":6,"created_at":"2025-10-02T10:18:42+08:00","updated_at":"2025-10-02T10:18:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bad758e1d96d62ee44482af5bf27244bcb9740b7.webp?v=1759371524","variant_ids":[43756875350115]},"available":true,"name":"iPhone 11 Mod NX Aaron Chang Waiting for - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01148C1-AAR08","featured_media":{"alt":null,"id":26113687093347,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bad758e1d96d62ee44482af5bf27244bcb9740b7.webp?v=1759371524"}},"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: "停產"
}