$product = {"id":7769562546275,"title":"iPhone 14 Pro Mod NX ilovedoodle Cat Dive - 跳水貓咪","handle":"iphone-14-pro-mod-nx-printable-xf51","description":null,"published_at":"2025-07-16T17:23:30+08:00","created_at":"2025-04-15T17:47:27+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":43302941032547,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF51","requires_shipping":true,"taxable":true,"featured_image":{"id":34197076508771,"product_id":7769562546275,"position":7,"created_at":"2025-07-16T14:58:01+08:00","updated_at":"2025-07-16T14:58:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/712408b6b533e2d0956ab26fa6ed94d7a7f5f797_4e16a1a1-1422-4ae6-9d0f-802f093afef2.webp?v=1752649083","variant_ids":[43302941032547]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Cat Dive - 跳水貓咪 - 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-XF51","featured_media":{"alt":null,"id":25829702041699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/712408b6b533e2d0956ab26fa6ed94d7a7f5f797_4e16a1a1-1422-4ae6-9d0f-802f093afef2.webp?v=1752649083"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43302944440419,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF51","requires_shipping":true,"taxable":true,"featured_image":{"id":34197078311011,"product_id":7769562546275,"position":12,"created_at":"2025-07-16T14:58:04+08:00","updated_at":"2025-07-16T14:58:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/108d67dd336b74162f17c81b2125628768ece4d7_a7ac3f18-3e27-4f0b-b6f0-938a2df51005.webp?v=1752649086","variant_ids":[43302944440419]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Cat Dive - 跳水貓咪 - 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-XF51","featured_media":{"alt":null,"id":25829702991971,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/108d67dd336b74162f17c81b2125628768ece4d7_a7ac3f18-3e27-4f0b-b6f0-938a2df51005.webp?v=1752649086"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43302944604259,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF51","requires_shipping":true,"taxable":true,"featured_image":{"id":34197075165283,"product_id":7769562546275,"position":4,"created_at":"2025-07-16T14:57:59+08:00","updated_at":"2025-07-16T14:58:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc96beed1f3d2208c01c85a3ab7e6723a420e72e_33419d0a-b12d-4c21-ac51-397a783d4935.webp?v=1752649081","variant_ids":[43302944604259]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Cat Dive - 跳水貓咪 - 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-XF51","featured_media":{"alt":null,"id":25829701419107,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc96beed1f3d2208c01c85a3ab7e6723a420e72e_33419d0a-b12d-4c21-ac51-397a783d4935.webp?v=1752649081"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98a2034819b58a978802d544f126b63fb74fc333.webp?v=1744710454","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/574e6dd5f375cc7c1dd9e6c294c211591c8d5ab7_a8e94895-79eb-4704-8a7d-0db91eed265e.webp?v=1752649080","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b53a7ce944823207d819aa780e8ccc8db95e9e3c_02652eef-da6d-4f13-aa5e-985bf39f44c7.webp?v=1752649081","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc96beed1f3d2208c01c85a3ab7e6723a420e72e_33419d0a-b12d-4c21-ac51-397a783d4935.webp?v=1752649081","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf43c5acbb979c5e5f1e25f7e6f10146e6cb2bac_c668d514-3341-4cb8-bfd8-57a4800009f5.webp?v=1752649082","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f2a2fb5165428463a8e647a71cbf2a36e5644497_86b78f16-9e58-45ce-9ba2-e1403aa8ba3e.webp?v=1752649083","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/712408b6b533e2d0956ab26fa6ed94d7a7f5f797_4e16a1a1-1422-4ae6-9d0f-802f093afef2.webp?v=1752649083","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1bb672a7614fefe233acff46ffebd05d55676748_dac24913-11ef-4379-a8f8-0fc4fa4b55d0.webp?v=1752649084","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78aad2d67bbec9547c6d53985b0658fbfcee396f_df942c63-dca7-4660-ad4c-f636dc9f7110.webp?v=1752649084","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b2aa73b5be9abbdcb0437dc4ef15ef5856b96433_252b75f0-ed2d-45aa-98cd-085b9bc17272.webp?v=1752649084","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ea83d3ec2c18a8a44f4bc562c786fae2fbabcd3_fe09094a-8b4a-484c-ba69-803a11e5de70.webp?v=1752649085","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/108d67dd336b74162f17c81b2125628768ece4d7_a7ac3f18-3e27-4f0b-b6f0-938a2df51005.webp?v=1752649086","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/522e8155331f139d3be4cf8a7dcdb35883f1bc61_472c28f2-27d2-4b39-b886-39fbfe80b679.webp?v=1752649086"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98a2034819b58a978802d544f126b63fb74fc333.webp?v=1744710454","options":["color"],"media":[{"alt":null,"id":25495814668387,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98a2034819b58a978802d544f126b63fb74fc333.webp?v=1744710454"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98a2034819b58a978802d544f126b63fb74fc333.webp?v=1744710454","width":2000},{"alt":null,"id":25829700862051,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/574e6dd5f375cc7c1dd9e6c294c211591c8d5ab7_a8e94895-79eb-4704-8a7d-0db91eed265e.webp?v=1752649080"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/574e6dd5f375cc7c1dd9e6c294c211591c8d5ab7_a8e94895-79eb-4704-8a7d-0db91eed265e.webp?v=1752649080","width":2000},{"alt":null,"id":25829701058659,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b53a7ce944823207d819aa780e8ccc8db95e9e3c_02652eef-da6d-4f13-aa5e-985bf39f44c7.webp?v=1752649081"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b53a7ce944823207d819aa780e8ccc8db95e9e3c_02652eef-da6d-4f13-aa5e-985bf39f44c7.webp?v=1752649081","width":2000},{"alt":null,"id":25829701419107,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc96beed1f3d2208c01c85a3ab7e6723a420e72e_33419d0a-b12d-4c21-ac51-397a783d4935.webp?v=1752649081"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc96beed1f3d2208c01c85a3ab7e6723a420e72e_33419d0a-b12d-4c21-ac51-397a783d4935.webp?v=1752649081","width":2000},{"alt":null,"id":25829701550179,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf43c5acbb979c5e5f1e25f7e6f10146e6cb2bac_c668d514-3341-4cb8-bfd8-57a4800009f5.webp?v=1752649082"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf43c5acbb979c5e5f1e25f7e6f10146e6cb2bac_c668d514-3341-4cb8-bfd8-57a4800009f5.webp?v=1752649082","width":2000},{"alt":null,"id":25829701845091,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f2a2fb5165428463a8e647a71cbf2a36e5644497_86b78f16-9e58-45ce-9ba2-e1403aa8ba3e.webp?v=1752649083"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f2a2fb5165428463a8e647a71cbf2a36e5644497_86b78f16-9e58-45ce-9ba2-e1403aa8ba3e.webp?v=1752649083","width":2000},{"alt":null,"id":25829702041699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/712408b6b533e2d0956ab26fa6ed94d7a7f5f797_4e16a1a1-1422-4ae6-9d0f-802f093afef2.webp?v=1752649083"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/712408b6b533e2d0956ab26fa6ed94d7a7f5f797_4e16a1a1-1422-4ae6-9d0f-802f093afef2.webp?v=1752649083","width":2000},{"alt":null,"id":25829702140003,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1bb672a7614fefe233acff46ffebd05d55676748_dac24913-11ef-4379-a8f8-0fc4fa4b55d0.webp?v=1752649084"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1bb672a7614fefe233acff46ffebd05d55676748_dac24913-11ef-4379-a8f8-0fc4fa4b55d0.webp?v=1752649084","width":2000},{"alt":null,"id":25829702238307,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78aad2d67bbec9547c6d53985b0658fbfcee396f_df942c63-dca7-4660-ad4c-f636dc9f7110.webp?v=1752649084"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78aad2d67bbec9547c6d53985b0658fbfcee396f_df942c63-dca7-4660-ad4c-f636dc9f7110.webp?v=1752649084","width":2000},{"alt":null,"id":25829702631523,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b2aa73b5be9abbdcb0437dc4ef15ef5856b96433_252b75f0-ed2d-45aa-98cd-085b9bc17272.webp?v=1752649084"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b2aa73b5be9abbdcb0437dc4ef15ef5856b96433_252b75f0-ed2d-45aa-98cd-085b9bc17272.webp?v=1752649084","width":2000},{"alt":null,"id":25829702762595,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ea83d3ec2c18a8a44f4bc562c786fae2fbabcd3_fe09094a-8b4a-484c-ba69-803a11e5de70.webp?v=1752649085"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ea83d3ec2c18a8a44f4bc562c786fae2fbabcd3_fe09094a-8b4a-484c-ba69-803a11e5de70.webp?v=1752649085","width":2000},{"alt":null,"id":25829702991971,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/108d67dd336b74162f17c81b2125628768ece4d7_a7ac3f18-3e27-4f0b-b6f0-938a2df51005.webp?v=1752649086"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/108d67dd336b74162f17c81b2125628768ece4d7_a7ac3f18-3e27-4f0b-b6f0-938a2df51005.webp?v=1752649086","width":2000},{"alt":null,"id":25829703450723,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/522e8155331f139d3be4cf8a7dcdb35883f1bc61_472c28f2-27d2-4b39-b886-39fbfe80b679.webp?v=1752649086"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/522e8155331f139d3be4cf8a7dcdb35883f1bc61_472c28f2-27d2-4b39-b886-39fbfe80b679.webp?v=1752649086","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43302941032547,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF51","requires_shipping":true,"taxable":true,"featured_image":{"id":34197076508771,"product_id":7769562546275,"position":7,"created_at":"2025-07-16T14:58:01+08:00","updated_at":"2025-07-16T14:58:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/712408b6b533e2d0956ab26fa6ed94d7a7f5f797_4e16a1a1-1422-4ae6-9d0f-802f093afef2.webp?v=1752649083","variant_ids":[43302941032547]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Cat Dive - 跳水貓咪 - 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-XF51","featured_media":{"alt":null,"id":25829702041699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/712408b6b533e2d0956ab26fa6ed94d7a7f5f797_4e16a1a1-1422-4ae6-9d0f-802f093afef2.webp?v=1752649083"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43302944440419,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF51","requires_shipping":true,"taxable":true,"featured_image":{"id":34197078311011,"product_id":7769562546275,"position":12,"created_at":"2025-07-16T14:58:04+08:00","updated_at":"2025-07-16T14:58:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/108d67dd336b74162f17c81b2125628768ece4d7_a7ac3f18-3e27-4f0b-b6f0-938a2df51005.webp?v=1752649086","variant_ids":[43302944440419]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Cat Dive - 跳水貓咪 - 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-XF51","featured_media":{"alt":null,"id":25829702991971,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/108d67dd336b74162f17c81b2125628768ece4d7_a7ac3f18-3e27-4f0b-b6f0-938a2df51005.webp?v=1752649086"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43302944604259,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF51","requires_shipping":true,"taxable":true,"featured_image":{"id":34197075165283,"product_id":7769562546275,"position":4,"created_at":"2025-07-16T14:57:59+08:00","updated_at":"2025-07-16T14:58:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc96beed1f3d2208c01c85a3ab7e6723a420e72e_33419d0a-b12d-4c21-ac51-397a783d4935.webp?v=1752649081","variant_ids":[43302944604259]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Cat Dive - 跳水貓咪 - 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-XF51","featured_media":{"alt":null,"id":25829701419107,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc96beed1f3d2208c01c85a3ab7e6723a420e72e_33419d0a-b12d-4c21-ac51-397a783d4935.webp?v=1752649081"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43302941032547,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF51","requires_shipping":true,"taxable":true,"featured_image":{"id":34197076508771,"product_id":7769562546275,"position":7,"created_at":"2025-07-16T14:58:01+08:00","updated_at":"2025-07-16T14:58:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/712408b6b533e2d0956ab26fa6ed94d7a7f5f797_4e16a1a1-1422-4ae6-9d0f-802f093afef2.webp?v=1752649083","variant_ids":[43302941032547]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Cat Dive - 跳水貓咪 - 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-XF51","featured_media":{"alt":null,"id":25829702041699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/712408b6b533e2d0956ab26fa6ed94d7a7f5f797_4e16a1a1-1422-4ae6-9d0f-802f093afef2.webp?v=1752649083"}},"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: "停產"
}