$product = {"id":7769647513699,"title":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Peek A Paw - 躲貓貓","handle":"iphone-14-pro-mod-nx-magsafe-printable-xf48","description":null,"published_at":"2025-07-16T17:14:10+08:00","created_at":"2025-04-15T18:54:19+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師MOD NX MagSafe專區I Love Doodle","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-ilovedoodle","device-iPhone 14 Pro","merge","reseller-ilovedoodle"],"price":110000,"price_min":110000,"price_max":110000,"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":43303328317539,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-XF48","requires_shipping":true,"taxable":true,"featured_image":{"id":34197736063075,"product_id":7769647513699,"position":5,"created_at":"2025-07-16T15:21:48+08:00","updated_at":"2025-07-16T15:21:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d60c946f72e7d572cf8b30a7e72bc23d4e179a6_77812dff-2798-4448-96a7-1bc3e558826b.webp?v=1752650510","variant_ids":[43303328317539]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Peek A Paw - 躲貓貓 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126224-XF48","featured_media":{"alt":null,"id":25830075400291,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d60c946f72e7d572cf8b30a7e72bc23d4e179a6_77812dff-2798-4448-96a7-1bc3e558826b.webp?v=1752650510"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303332577379,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-XF48","requires_shipping":true,"taxable":true,"featured_image":{"id":34197734916195,"product_id":7769647513699,"position":3,"created_at":"2025-07-16T15:21:47+08:00","updated_at":"2025-07-16T15:21:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebadc163a586b4e7505ad915b7fb576602895121_6f93b78f-0bdf-44f2-a4be-b0e22f52a842.webp?v=1752650509","variant_ids":[43303332577379]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Peek A Paw - 躲貓貓 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126204-XF48","featured_media":{"alt":null,"id":25830074646627,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebadc163a586b4e7505ad915b7fb576602895121_6f93b78f-0bdf-44f2-a4be-b0e22f52a842.webp?v=1752650509"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303332741219,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-XF48","requires_shipping":true,"taxable":true,"featured_image":{"id":34197735637091,"product_id":7769647513699,"position":4,"created_at":"2025-07-16T15:21:48+08:00","updated_at":"2025-07-16T15:21:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c22baab38406f1564628f791d39f99e0d0652135_3b0c538d-a53a-4929-865c-41810316b540.webp?v=1752650510","variant_ids":[43303332741219]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Peek A Paw - 躲貓貓 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01262J5-XF48","featured_media":{"alt":null,"id":25830075072611,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c22baab38406f1564628f791d39f99e0d0652135_3b0c538d-a53a-4929-865c-41810316b540.webp?v=1752650510"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c88792cf81dfdf04ea340093e4a32401ffa4afe.webp?v=1744714466","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b082154f7746e3993a834eba5e9f7bc87a5d64e_93e70362-e118-48c1-b5ab-4ddf034800b1.webp?v=1752650509","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebadc163a586b4e7505ad915b7fb576602895121_6f93b78f-0bdf-44f2-a4be-b0e22f52a842.webp?v=1752650509","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c22baab38406f1564628f791d39f99e0d0652135_3b0c538d-a53a-4929-865c-41810316b540.webp?v=1752650510","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d60c946f72e7d572cf8b30a7e72bc23d4e179a6_77812dff-2798-4448-96a7-1bc3e558826b.webp?v=1752650510","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4785ae66f9be7119afe1e5a2808b986060264cd5_83c60bab-7da0-45da-b009-1e1cf4c5e609.webp?v=1752650511","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3cdc4faf9f4a9d90e52eaa46a7a65c08951f1d1_94e2f837-f939-4210-bbcf-ed97d8fba0a1.webp?v=1752650511","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a838f09a1f534638204b9b7d620665b625764291_134b25e1-cc4a-43b9-8c9a-70c961d9e3d9.webp?v=1752650513","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb999907ed51ec71cbe1dda2eaf9d5d8e5015d5b_381c88f5-a040-4d4e-8eb9-36f66d1d6121.webp?v=1752650513","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b18bc2275270704b59854a5115ed91bc003f4d0e_e6d314e2-381a-4a70-97c7-c5f295122e77.webp?v=1752650514","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2e5b6e057047e6467f53c61d725cb9bf3c3078e_c90906dc-ae65-44a0-adb1-a69a2e46625a.webp?v=1752650515","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06052164d6912655c73494bc0e96342b835e0750_2152ba1c-942f-44fe-b35a-9142ed1f9b0d.webp?v=1752650515","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f92eb1cf7b4ec16938b3dcbace2aaf10505e9040_9ec994c6-e362-4575-9569-d03324fa619d.webp?v=1752650516"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c88792cf81dfdf04ea340093e4a32401ffa4afe.webp?v=1744714466","options":["color"],"media":[{"alt":null,"id":25496048664675,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c88792cf81dfdf04ea340093e4a32401ffa4afe.webp?v=1744714466"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c88792cf81dfdf04ea340093e4a32401ffa4afe.webp?v=1744714466","width":2000},{"alt":null,"id":25830074089571,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b082154f7746e3993a834eba5e9f7bc87a5d64e_93e70362-e118-48c1-b5ab-4ddf034800b1.webp?v=1752650509"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b082154f7746e3993a834eba5e9f7bc87a5d64e_93e70362-e118-48c1-b5ab-4ddf034800b1.webp?v=1752650509","width":2000},{"alt":null,"id":25830074646627,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebadc163a586b4e7505ad915b7fb576602895121_6f93b78f-0bdf-44f2-a4be-b0e22f52a842.webp?v=1752650509"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebadc163a586b4e7505ad915b7fb576602895121_6f93b78f-0bdf-44f2-a4be-b0e22f52a842.webp?v=1752650509","width":2000},{"alt":null,"id":25830075072611,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c22baab38406f1564628f791d39f99e0d0652135_3b0c538d-a53a-4929-865c-41810316b540.webp?v=1752650510"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c22baab38406f1564628f791d39f99e0d0652135_3b0c538d-a53a-4929-865c-41810316b540.webp?v=1752650510","width":2000},{"alt":null,"id":25830075400291,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d60c946f72e7d572cf8b30a7e72bc23d4e179a6_77812dff-2798-4448-96a7-1bc3e558826b.webp?v=1752650510"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d60c946f72e7d572cf8b30a7e72bc23d4e179a6_77812dff-2798-4448-96a7-1bc3e558826b.webp?v=1752650510","width":2000},{"alt":null,"id":25830075760739,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4785ae66f9be7119afe1e5a2808b986060264cd5_83c60bab-7da0-45da-b009-1e1cf4c5e609.webp?v=1752650511"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4785ae66f9be7119afe1e5a2808b986060264cd5_83c60bab-7da0-45da-b009-1e1cf4c5e609.webp?v=1752650511","width":2000},{"alt":null,"id":25830075990115,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3cdc4faf9f4a9d90e52eaa46a7a65c08951f1d1_94e2f837-f939-4210-bbcf-ed97d8fba0a1.webp?v=1752650511"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3cdc4faf9f4a9d90e52eaa46a7a65c08951f1d1_94e2f837-f939-4210-bbcf-ed97d8fba0a1.webp?v=1752650511","width":2000},{"alt":null,"id":25830076776547,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a838f09a1f534638204b9b7d620665b625764291_134b25e1-cc4a-43b9-8c9a-70c961d9e3d9.webp?v=1752650513"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a838f09a1f534638204b9b7d620665b625764291_134b25e1-cc4a-43b9-8c9a-70c961d9e3d9.webp?v=1752650513","width":2000},{"alt":null,"id":25830077071459,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb999907ed51ec71cbe1dda2eaf9d5d8e5015d5b_381c88f5-a040-4d4e-8eb9-36f66d1d6121.webp?v=1752650513"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb999907ed51ec71cbe1dda2eaf9d5d8e5015d5b_381c88f5-a040-4d4e-8eb9-36f66d1d6121.webp?v=1752650513","width":2000},{"alt":null,"id":25830077497443,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b18bc2275270704b59854a5115ed91bc003f4d0e_e6d314e2-381a-4a70-97c7-c5f295122e77.webp?v=1752650514"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b18bc2275270704b59854a5115ed91bc003f4d0e_e6d314e2-381a-4a70-97c7-c5f295122e77.webp?v=1752650514","width":2000},{"alt":null,"id":25830077694051,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2e5b6e057047e6467f53c61d725cb9bf3c3078e_c90906dc-ae65-44a0-adb1-a69a2e46625a.webp?v=1752650515"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2e5b6e057047e6467f53c61d725cb9bf3c3078e_c90906dc-ae65-44a0-adb1-a69a2e46625a.webp?v=1752650515","width":2000},{"alt":null,"id":25830077988963,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06052164d6912655c73494bc0e96342b835e0750_2152ba1c-942f-44fe-b35a-9142ed1f9b0d.webp?v=1752650515"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06052164d6912655c73494bc0e96342b835e0750_2152ba1c-942f-44fe-b35a-9142ed1f9b0d.webp?v=1752650515","width":2000},{"alt":null,"id":25830078251107,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f92eb1cf7b4ec16938b3dcbace2aaf10505e9040_9ec994c6-e362-4575-9569-d03324fa619d.webp?v=1752650516"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f92eb1cf7b4ec16938b3dcbace2aaf10505e9040_9ec994c6-e362-4575-9569-d03324fa619d.webp?v=1752650516","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43303328317539,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-XF48","requires_shipping":true,"taxable":true,"featured_image":{"id":34197736063075,"product_id":7769647513699,"position":5,"created_at":"2025-07-16T15:21:48+08:00","updated_at":"2025-07-16T15:21:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d60c946f72e7d572cf8b30a7e72bc23d4e179a6_77812dff-2798-4448-96a7-1bc3e558826b.webp?v=1752650510","variant_ids":[43303328317539]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Peek A Paw - 躲貓貓 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126224-XF48","featured_media":{"alt":null,"id":25830075400291,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d60c946f72e7d572cf8b30a7e72bc23d4e179a6_77812dff-2798-4448-96a7-1bc3e558826b.webp?v=1752650510"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303332577379,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-XF48","requires_shipping":true,"taxable":true,"featured_image":{"id":34197734916195,"product_id":7769647513699,"position":3,"created_at":"2025-07-16T15:21:47+08:00","updated_at":"2025-07-16T15:21:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebadc163a586b4e7505ad915b7fb576602895121_6f93b78f-0bdf-44f2-a4be-b0e22f52a842.webp?v=1752650509","variant_ids":[43303332577379]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Peek A Paw - 躲貓貓 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126204-XF48","featured_media":{"alt":null,"id":25830074646627,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ebadc163a586b4e7505ad915b7fb576602895121_6f93b78f-0bdf-44f2-a4be-b0e22f52a842.webp?v=1752650509"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303332741219,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-XF48","requires_shipping":true,"taxable":true,"featured_image":{"id":34197735637091,"product_id":7769647513699,"position":4,"created_at":"2025-07-16T15:21:48+08:00","updated_at":"2025-07-16T15:21:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c22baab38406f1564628f791d39f99e0d0652135_3b0c538d-a53a-4929-865c-41810316b540.webp?v=1752650510","variant_ids":[43303332741219]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Peek A Paw - 躲貓貓 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01262J5-XF48","featured_media":{"alt":null,"id":25830075072611,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c22baab38406f1564628f791d39f99e0d0652135_3b0c538d-a53a-4929-865c-41810316b540.webp?v=1752650510"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43303328317539,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-XF48","requires_shipping":true,"taxable":true,"featured_image":{"id":34197736063075,"product_id":7769647513699,"position":5,"created_at":"2025-07-16T15:21:48+08:00","updated_at":"2025-07-16T15:21:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d60c946f72e7d572cf8b30a7e72bc23d4e179a6_77812dff-2798-4448-96a7-1bc3e558826b.webp?v=1752650510","variant_ids":[43303328317539]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Peek A Paw - 躲貓貓 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126224-XF48","featured_media":{"alt":null,"id":25830075400291,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d60c946f72e7d572cf8b30a7e72bc23d4e179a6_77812dff-2798-4448-96a7-1bc3e558826b.webp?v=1752650510"}},"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: "停產"
}