$product = {"id":7769653674083,"title":"iPhone 14 Pro Mod NX ilovedoodle Stay Curious - 保持好奇心","handle":"iphone-14-pro-mod-nx-printable-xf57","description":null,"published_at":"2025-07-16T17:13:33+08:00","created_at":"2025-04-15T18:59:30+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":43303359152227,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF57","requires_shipping":true,"taxable":true,"featured_image":{"id":34196857946211,"product_id":7769653674083,"position":12,"created_at":"2025-07-16T14:52:55+08:00","updated_at":"2025-07-16T14:52:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3245c82ebcd857cdd1a1c6a44f05efd7fdbf018_57e6175b-f7c0-4e77-86b1-f7b98c63edc1.webp?v=1752648777","variant_ids":[43303359152227]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Stay Curious - 保持好奇心 - 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-XF57","featured_media":{"alt":null,"id":25829582798947,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3245c82ebcd857cdd1a1c6a44f05efd7fdbf018_57e6175b-f7c0-4e77-86b1-f7b98c63edc1.webp?v=1752648777"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303363477603,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF57","requires_shipping":true,"taxable":true,"featured_image":{"id":34196855455843,"product_id":7769653674083,"position":7,"created_at":"2025-07-16T14:52:52+08:00","updated_at":"2025-07-16T14:52:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19d54d19465af15baca382d77cf76116f50fb8f1_4363c245-5ad0-40c8-aba5-32bc5b89b4bd.webp?v=1752648774","variant_ids":[43303363477603]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Stay Curious - 保持好奇心 - 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-XF57","featured_media":{"alt":null,"id":25829581848675,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19d54d19465af15baca382d77cf76116f50fb8f1_4363c245-5ad0-40c8-aba5-32bc5b89b4bd.webp?v=1752648774"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303363641443,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF57","requires_shipping":true,"taxable":true,"featured_image":{"id":34196855423075,"product_id":7769653674083,"position":6,"created_at":"2025-07-16T14:52:52+08:00","updated_at":"2025-07-16T14:52:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dcad9153d13b7d38aa49deb62c917be9b43207e_712ff63b-0026-4297-9a76-7701dfa5c6fb.webp?v=1752648774","variant_ids":[43303363641443]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Stay Curious - 保持好奇心 - 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-XF57","featured_media":{"alt":null,"id":25829581750371,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dcad9153d13b7d38aa49deb62c917be9b43207e_712ff63b-0026-4297-9a76-7701dfa5c6fb.webp?v=1752648774"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/679fb6b22bc507a1ab6bf8ce2c10622906c81234.webp?v=1744714777","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4c5662eeffd974cad87b87af2d6c318bc8808cd_236a8c23-65c9-4f15-b2dd-9f91ffd1ed48.webp?v=1752648771","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38b429e6f9f23fb3e3eb64853f67116c64b43fb5_b7dbb293-b24e-4fd9-b4d8-7225ee7ead86.webp?v=1752648772","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fdf01aa92a2cb5256e893aad13637e2407af38f2_1002cffd-3111-4b82-ae37-b86e3758afce.webp?v=1752648772","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e26f93d13adf2be911a88906c7dceb59484f3a6_753921cb-3c2b-4c1f-a3cd-58b84711f861.webp?v=1752648773","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dcad9153d13b7d38aa49deb62c917be9b43207e_712ff63b-0026-4297-9a76-7701dfa5c6fb.webp?v=1752648774","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19d54d19465af15baca382d77cf76116f50fb8f1_4363c245-5ad0-40c8-aba5-32bc5b89b4bd.webp?v=1752648774","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21a4c01c45839530a2743a227e0aa61bb7f616ee_d6e298d9-c4b5-4e28-afcb-ff984dd3fc13.webp?v=1752648774","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b3c7a1df181e14351b4966475f57b8e654f77fcc_27509638-e5f4-473d-9503-b92b48377127.webp?v=1752648775","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69f22ceb881b21f58e1b7e95d21bf1ba042e8376_ad730c2c-d112-40cf-a9e6-cc36dbb8b6b4.webp?v=1752648775","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/caca4e16e1261d8c60a24f1deee02874dfba722d_96bb11c2-95fc-4e90-ae5d-3d9b719dc69f.webp?v=1752648776","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3245c82ebcd857cdd1a1c6a44f05efd7fdbf018_57e6175b-f7c0-4e77-86b1-f7b98c63edc1.webp?v=1752648777","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/749026888332b1f4004252f7e915f7b4e5951905_7b156aff-5d13-4171-afc7-77e73e59249a.webp?v=1752648777"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/679fb6b22bc507a1ab6bf8ce2c10622906c81234.webp?v=1744714777","options":["color"],"media":[{"alt":null,"id":25496061050979,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/679fb6b22bc507a1ab6bf8ce2c10622906c81234.webp?v=1744714777"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/679fb6b22bc507a1ab6bf8ce2c10622906c81234.webp?v=1744714777","width":2000},{"alt":null,"id":25829580963939,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4c5662eeffd974cad87b87af2d6c318bc8808cd_236a8c23-65c9-4f15-b2dd-9f91ffd1ed48.webp?v=1752648771"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4c5662eeffd974cad87b87af2d6c318bc8808cd_236a8c23-65c9-4f15-b2dd-9f91ffd1ed48.webp?v=1752648771","width":2000},{"alt":null,"id":25829581226083,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38b429e6f9f23fb3e3eb64853f67116c64b43fb5_b7dbb293-b24e-4fd9-b4d8-7225ee7ead86.webp?v=1752648772"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38b429e6f9f23fb3e3eb64853f67116c64b43fb5_b7dbb293-b24e-4fd9-b4d8-7225ee7ead86.webp?v=1752648772","width":2000},{"alt":null,"id":25829581422691,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fdf01aa92a2cb5256e893aad13637e2407af38f2_1002cffd-3111-4b82-ae37-b86e3758afce.webp?v=1752648772"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fdf01aa92a2cb5256e893aad13637e2407af38f2_1002cffd-3111-4b82-ae37-b86e3758afce.webp?v=1752648772","width":2000},{"alt":null,"id":25829581586531,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e26f93d13adf2be911a88906c7dceb59484f3a6_753921cb-3c2b-4c1f-a3cd-58b84711f861.webp?v=1752648773"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e26f93d13adf2be911a88906c7dceb59484f3a6_753921cb-3c2b-4c1f-a3cd-58b84711f861.webp?v=1752648773","width":2000},{"alt":null,"id":25829581750371,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dcad9153d13b7d38aa49deb62c917be9b43207e_712ff63b-0026-4297-9a76-7701dfa5c6fb.webp?v=1752648774"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dcad9153d13b7d38aa49deb62c917be9b43207e_712ff63b-0026-4297-9a76-7701dfa5c6fb.webp?v=1752648774","width":2000},{"alt":null,"id":25829581848675,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19d54d19465af15baca382d77cf76116f50fb8f1_4363c245-5ad0-40c8-aba5-32bc5b89b4bd.webp?v=1752648774"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19d54d19465af15baca382d77cf76116f50fb8f1_4363c245-5ad0-40c8-aba5-32bc5b89b4bd.webp?v=1752648774","width":2000},{"alt":null,"id":25829582078051,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21a4c01c45839530a2743a227e0aa61bb7f616ee_d6e298d9-c4b5-4e28-afcb-ff984dd3fc13.webp?v=1752648774"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21a4c01c45839530a2743a227e0aa61bb7f616ee_d6e298d9-c4b5-4e28-afcb-ff984dd3fc13.webp?v=1752648774","width":2000},{"alt":null,"id":25829582209123,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b3c7a1df181e14351b4966475f57b8e654f77fcc_27509638-e5f4-473d-9503-b92b48377127.webp?v=1752648775"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b3c7a1df181e14351b4966475f57b8e654f77fcc_27509638-e5f4-473d-9503-b92b48377127.webp?v=1752648775","width":2000},{"alt":null,"id":25829582438499,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69f22ceb881b21f58e1b7e95d21bf1ba042e8376_ad730c2c-d112-40cf-a9e6-cc36dbb8b6b4.webp?v=1752648775"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69f22ceb881b21f58e1b7e95d21bf1ba042e8376_ad730c2c-d112-40cf-a9e6-cc36dbb8b6b4.webp?v=1752648775","width":2000},{"alt":null,"id":25829582635107,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/caca4e16e1261d8c60a24f1deee02874dfba722d_96bb11c2-95fc-4e90-ae5d-3d9b719dc69f.webp?v=1752648776"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/caca4e16e1261d8c60a24f1deee02874dfba722d_96bb11c2-95fc-4e90-ae5d-3d9b719dc69f.webp?v=1752648776","width":2000},{"alt":null,"id":25829582798947,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3245c82ebcd857cdd1a1c6a44f05efd7fdbf018_57e6175b-f7c0-4e77-86b1-f7b98c63edc1.webp?v=1752648777"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3245c82ebcd857cdd1a1c6a44f05efd7fdbf018_57e6175b-f7c0-4e77-86b1-f7b98c63edc1.webp?v=1752648777","width":2000},{"alt":null,"id":25829583519843,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/749026888332b1f4004252f7e915f7b4e5951905_7b156aff-5d13-4171-afc7-77e73e59249a.webp?v=1752648777"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/749026888332b1f4004252f7e915f7b4e5951905_7b156aff-5d13-4171-afc7-77e73e59249a.webp?v=1752648777","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43303359152227,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF57","requires_shipping":true,"taxable":true,"featured_image":{"id":34196857946211,"product_id":7769653674083,"position":12,"created_at":"2025-07-16T14:52:55+08:00","updated_at":"2025-07-16T14:52:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3245c82ebcd857cdd1a1c6a44f05efd7fdbf018_57e6175b-f7c0-4e77-86b1-f7b98c63edc1.webp?v=1752648777","variant_ids":[43303359152227]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Stay Curious - 保持好奇心 - 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-XF57","featured_media":{"alt":null,"id":25829582798947,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3245c82ebcd857cdd1a1c6a44f05efd7fdbf018_57e6175b-f7c0-4e77-86b1-f7b98c63edc1.webp?v=1752648777"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303363477603,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF57","requires_shipping":true,"taxable":true,"featured_image":{"id":34196855455843,"product_id":7769653674083,"position":7,"created_at":"2025-07-16T14:52:52+08:00","updated_at":"2025-07-16T14:52:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19d54d19465af15baca382d77cf76116f50fb8f1_4363c245-5ad0-40c8-aba5-32bc5b89b4bd.webp?v=1752648774","variant_ids":[43303363477603]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Stay Curious - 保持好奇心 - 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-XF57","featured_media":{"alt":null,"id":25829581848675,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19d54d19465af15baca382d77cf76116f50fb8f1_4363c245-5ad0-40c8-aba5-32bc5b89b4bd.webp?v=1752648774"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303363641443,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF57","requires_shipping":true,"taxable":true,"featured_image":{"id":34196855423075,"product_id":7769653674083,"position":6,"created_at":"2025-07-16T14:52:52+08:00","updated_at":"2025-07-16T14:52:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dcad9153d13b7d38aa49deb62c917be9b43207e_712ff63b-0026-4297-9a76-7701dfa5c6fb.webp?v=1752648774","variant_ids":[43303363641443]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Stay Curious - 保持好奇心 - 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-XF57","featured_media":{"alt":null,"id":25829581750371,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dcad9153d13b7d38aa49deb62c917be9b43207e_712ff63b-0026-4297-9a76-7701dfa5c6fb.webp?v=1752648774"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43303359152227,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF57","requires_shipping":true,"taxable":true,"featured_image":{"id":34196857946211,"product_id":7769653674083,"position":12,"created_at":"2025-07-16T14:52:55+08:00","updated_at":"2025-07-16T14:52:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3245c82ebcd857cdd1a1c6a44f05efd7fdbf018_57e6175b-f7c0-4e77-86b1-f7b98c63edc1.webp?v=1752648777","variant_ids":[43303359152227]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Stay Curious - 保持好奇心 - 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-XF57","featured_media":{"alt":null,"id":25829582798947,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3245c82ebcd857cdd1a1c6a44f05efd7fdbf018_57e6175b-f7c0-4e77-86b1-f7b98c63edc1.webp?v=1752648777"}},"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: "停產"
}