$product = {"id":7769678872675,"title":"iPhone 14 Pro Mod NX ilovedoodle Mindful Cat - Love Yourself","handle":"iphone-14-pro-mod-nx-printable-xf47","description":null,"published_at":"2025-07-16T17:10:37+08:00","created_at":"2025-04-15T19:21:14+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師MOD NX專區-I Love Doodle","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-ilovedoodle","device-iPhone 14 Pro","merge","reseller-ilovedoodle"],"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":43303482785891,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF47","requires_shipping":true,"taxable":true,"featured_image":{"id":34196930429027,"product_id":7769678872675,"position":13,"created_at":"2025-07-16T14:54:33+08:00","updated_at":"2025-07-16T14:54:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5fb6a98653fb771c35797869c0b42794ea5c75c8_9999d24a-ddb5-4375-bd1b-9c8df23217ba.webp?v=1752648875","variant_ids":[43303482785891]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful Cat - Love Yourself - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126224-XF47","featured_media":{"alt":null,"id":25829622120547,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5fb6a98653fb771c35797869c0b42794ea5c75c8_9999d24a-ddb5-4375-bd1b-9c8df23217ba.webp?v=1752648875"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303487537251,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF47","requires_shipping":true,"taxable":true,"featured_image":{"id":34196929740899,"product_id":7769678872675,"position":12,"created_at":"2025-07-16T14:54:32+08:00","updated_at":"2025-07-16T14:54:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b657e25b602a1c1d6f8def5be5ac31f658436e33_c44e6c11-f2bf-4ac6-9403-7d9b413f13e9.webp?v=1752648874","variant_ids":[43303487537251]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful Cat - Love Yourself - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126204-XF47","featured_media":{"alt":null,"id":25829621891171,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b657e25b602a1c1d6f8def5be5ac31f658436e33_c44e6c11-f2bf-4ac6-9403-7d9b413f13e9.webp?v=1752648874"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303487701091,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF47","requires_shipping":true,"taxable":true,"featured_image":{"id":34196928757859,"product_id":7769678872675,"position":10,"created_at":"2025-07-16T14:54:31+08:00","updated_at":"2025-07-16T14:54:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c4b3799d6c3f7e1735042d9f4cb33722d9a08525_5a9a8b43-a8ef-4b61-9519-3dcf86be8442.webp?v=1752648873","variant_ids":[43303487701091]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful Cat - Love Yourself - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01262J5-XF47","featured_media":{"alt":null,"id":25829621301347,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c4b3799d6c3f7e1735042d9f4cb33722d9a08525_5a9a8b43-a8ef-4b61-9519-3dcf86be8442.webp?v=1752648873"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/185ee535f699f4ed5d67d01ee895c94fd6603f6b.webp?v=1744716081","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c82eea3fe11c831821eebcfc02d3afd4d0eb64b0_0682f4f7-85c0-495f-93ed-98bafc83ed63.webp?v=1752648869","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/df4ac6f5da57ab25654a68e39569b49d465ed593_5a8f3730-9522-4dab-a478-025d4f90d54f.webp?v=1752648869","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6e3042a5ffec47ac1239a859e998b2a2662c81a8_7e816c88-efd8-4fed-9083-aa2e874b69d0.webp?v=1752648870","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81f3c6059ff3bd851789d78f7f80ec3cb2791ddf_563826c0-2b8f-4a89-8e9a-fdd3678c1e8c.webp?v=1752648870","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80ae2f0e4a5b30afdcac2f1a7010d2b5eeec7189_0367b89a-3156-4a52-8e4d-926b73d86f1e.webp?v=1752648871","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5f9a432af1224ada5ad52268e66eca4832f17740_134a6924-1216-4c22-887d-f87920d79296.webp?v=1752648872","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e006d8a4011526774b187f5577f0d1bcb8e17c1e_3d14bd8d-6690-4128-9a58-a4009f5c3e02.webp?v=1752648872","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/edca3bb603edce56558f6a71a73931a49c8ac5d7_ce887fb5-c0b3-4029-b3f4-449b4baa5a49.webp?v=1752648872","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c4b3799d6c3f7e1735042d9f4cb33722d9a08525_5a9a8b43-a8ef-4b61-9519-3dcf86be8442.webp?v=1752648873","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a544543327a5d9c4f00e43d636f3823138ecf462_b59b7506-d1d1-467a-9112-0130047b4a1a.webp?v=1752648873","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b657e25b602a1c1d6f8def5be5ac31f658436e33_c44e6c11-f2bf-4ac6-9403-7d9b413f13e9.webp?v=1752648874","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5fb6a98653fb771c35797869c0b42794ea5c75c8_9999d24a-ddb5-4375-bd1b-9c8df23217ba.webp?v=1752648875"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/185ee535f699f4ed5d67d01ee895c94fd6603f6b.webp?v=1744716081","options":["color"],"media":[{"alt":null,"id":25496101322851,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/185ee535f699f4ed5d67d01ee895c94fd6603f6b.webp?v=1744716081"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/185ee535f699f4ed5d67d01ee895c94fd6603f6b.webp?v=1744716081","width":2000},{"alt":null,"id":25829619597411,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c82eea3fe11c831821eebcfc02d3afd4d0eb64b0_0682f4f7-85c0-495f-93ed-98bafc83ed63.webp?v=1752648869"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c82eea3fe11c831821eebcfc02d3afd4d0eb64b0_0682f4f7-85c0-495f-93ed-98bafc83ed63.webp?v=1752648869","width":2000},{"alt":null,"id":25829619826787,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/df4ac6f5da57ab25654a68e39569b49d465ed593_5a8f3730-9522-4dab-a478-025d4f90d54f.webp?v=1752648869"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/df4ac6f5da57ab25654a68e39569b49d465ed593_5a8f3730-9522-4dab-a478-025d4f90d54f.webp?v=1752648869","width":2000},{"alt":null,"id":25829619990627,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6e3042a5ffec47ac1239a859e998b2a2662c81a8_7e816c88-efd8-4fed-9083-aa2e874b69d0.webp?v=1752648870"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6e3042a5ffec47ac1239a859e998b2a2662c81a8_7e816c88-efd8-4fed-9083-aa2e874b69d0.webp?v=1752648870","width":2000},{"alt":null,"id":25829620285539,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81f3c6059ff3bd851789d78f7f80ec3cb2791ddf_563826c0-2b8f-4a89-8e9a-fdd3678c1e8c.webp?v=1752648870"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81f3c6059ff3bd851789d78f7f80ec3cb2791ddf_563826c0-2b8f-4a89-8e9a-fdd3678c1e8c.webp?v=1752648870","width":2000},{"alt":null,"id":25829620482147,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80ae2f0e4a5b30afdcac2f1a7010d2b5eeec7189_0367b89a-3156-4a52-8e4d-926b73d86f1e.webp?v=1752648871"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80ae2f0e4a5b30afdcac2f1a7010d2b5eeec7189_0367b89a-3156-4a52-8e4d-926b73d86f1e.webp?v=1752648871","width":2000},{"alt":null,"id":25829620711523,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5f9a432af1224ada5ad52268e66eca4832f17740_134a6924-1216-4c22-887d-f87920d79296.webp?v=1752648872"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5f9a432af1224ada5ad52268e66eca4832f17740_134a6924-1216-4c22-887d-f87920d79296.webp?v=1752648872","width":2000},{"alt":null,"id":25829620809827,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e006d8a4011526774b187f5577f0d1bcb8e17c1e_3d14bd8d-6690-4128-9a58-a4009f5c3e02.webp?v=1752648872"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e006d8a4011526774b187f5577f0d1bcb8e17c1e_3d14bd8d-6690-4128-9a58-a4009f5c3e02.webp?v=1752648872","width":2000},{"alt":null,"id":25829621104739,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/edca3bb603edce56558f6a71a73931a49c8ac5d7_ce887fb5-c0b3-4029-b3f4-449b4baa5a49.webp?v=1752648872"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/edca3bb603edce56558f6a71a73931a49c8ac5d7_ce887fb5-c0b3-4029-b3f4-449b4baa5a49.webp?v=1752648872","width":2000},{"alt":null,"id":25829621301347,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c4b3799d6c3f7e1735042d9f4cb33722d9a08525_5a9a8b43-a8ef-4b61-9519-3dcf86be8442.webp?v=1752648873"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c4b3799d6c3f7e1735042d9f4cb33722d9a08525_5a9a8b43-a8ef-4b61-9519-3dcf86be8442.webp?v=1752648873","width":2000},{"alt":null,"id":25829621530723,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a544543327a5d9c4f00e43d636f3823138ecf462_b59b7506-d1d1-467a-9112-0130047b4a1a.webp?v=1752648873"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a544543327a5d9c4f00e43d636f3823138ecf462_b59b7506-d1d1-467a-9112-0130047b4a1a.webp?v=1752648873","width":2000},{"alt":null,"id":25829621891171,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b657e25b602a1c1d6f8def5be5ac31f658436e33_c44e6c11-f2bf-4ac6-9403-7d9b413f13e9.webp?v=1752648874"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b657e25b602a1c1d6f8def5be5ac31f658436e33_c44e6c11-f2bf-4ac6-9403-7d9b413f13e9.webp?v=1752648874","width":2000},{"alt":null,"id":25829622120547,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5fb6a98653fb771c35797869c0b42794ea5c75c8_9999d24a-ddb5-4375-bd1b-9c8df23217ba.webp?v=1752648875"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5fb6a98653fb771c35797869c0b42794ea5c75c8_9999d24a-ddb5-4375-bd1b-9c8df23217ba.webp?v=1752648875","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43303482785891,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF47","requires_shipping":true,"taxable":true,"featured_image":{"id":34196930429027,"product_id":7769678872675,"position":13,"created_at":"2025-07-16T14:54:33+08:00","updated_at":"2025-07-16T14:54:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5fb6a98653fb771c35797869c0b42794ea5c75c8_9999d24a-ddb5-4375-bd1b-9c8df23217ba.webp?v=1752648875","variant_ids":[43303482785891]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful Cat - Love Yourself - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126224-XF47","featured_media":{"alt":null,"id":25829622120547,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5fb6a98653fb771c35797869c0b42794ea5c75c8_9999d24a-ddb5-4375-bd1b-9c8df23217ba.webp?v=1752648875"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303487537251,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF47","requires_shipping":true,"taxable":true,"featured_image":{"id":34196929740899,"product_id":7769678872675,"position":12,"created_at":"2025-07-16T14:54:32+08:00","updated_at":"2025-07-16T14:54:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b657e25b602a1c1d6f8def5be5ac31f658436e33_c44e6c11-f2bf-4ac6-9403-7d9b413f13e9.webp?v=1752648874","variant_ids":[43303487537251]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful Cat - Love Yourself - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126204-XF47","featured_media":{"alt":null,"id":25829621891171,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b657e25b602a1c1d6f8def5be5ac31f658436e33_c44e6c11-f2bf-4ac6-9403-7d9b413f13e9.webp?v=1752648874"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303487701091,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF47","requires_shipping":true,"taxable":true,"featured_image":{"id":34196928757859,"product_id":7769678872675,"position":10,"created_at":"2025-07-16T14:54:31+08:00","updated_at":"2025-07-16T14:54:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c4b3799d6c3f7e1735042d9f4cb33722d9a08525_5a9a8b43-a8ef-4b61-9519-3dcf86be8442.webp?v=1752648873","variant_ids":[43303487701091]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful Cat - Love Yourself - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01262J5-XF47","featured_media":{"alt":null,"id":25829621301347,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c4b3799d6c3f7e1735042d9f4cb33722d9a08525_5a9a8b43-a8ef-4b61-9519-3dcf86be8442.webp?v=1752648873"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43303482785891,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF47","requires_shipping":true,"taxable":true,"featured_image":{"id":34196930429027,"product_id":7769678872675,"position":13,"created_at":"2025-07-16T14:54:33+08:00","updated_at":"2025-07-16T14:54:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5fb6a98653fb771c35797869c0b42794ea5c75c8_9999d24a-ddb5-4375-bd1b-9c8df23217ba.webp?v=1752648875","variant_ids":[43303482785891]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Mindful Cat - Love Yourself - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126224-XF47","featured_media":{"alt":null,"id":25829622120547,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5fb6a98653fb771c35797869c0b42794ea5c75c8_9999d24a-ddb5-4375-bd1b-9c8df23217ba.webp?v=1752648875"}},"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: "停產"
}