$product = {"id":7769466634339,"title":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Cat People - 貓派","handle":"iphone-14-pro-mod-nx-magsafe-printable-xf54","description":null,"published_at":"2025-07-16T17:33:18+08:00","created_at":"2025-04-15T16:30:13+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":43302483722339,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-XF54","requires_shipping":true,"taxable":true,"featured_image":{"id":34197784330339,"product_id":7769466634339,"position":9,"created_at":"2025-07-16T15:22:32+08:00","updated_at":"2025-07-16T15:22:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ece9f0ca117f971725b1bfc868f4a0e1be8a676_bb534e64-aaf7-4160-b49f-46c214a3d430.webp?v=1752650553","variant_ids":[43302483722339]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Cat People - 貓派 - 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-XF54","featured_media":{"alt":null,"id":25830100500579,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ece9f0ca117f971725b1bfc868f4a0e1be8a676_bb534e64-aaf7-4160-b49f-46c214a3d430.webp?v=1752650553"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43302488735843,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-XF54","requires_shipping":true,"taxable":true,"featured_image":{"id":34197779513443,"product_id":7769466634339,"position":2,"created_at":"2025-07-16T15:22:28+08:00","updated_at":"2025-07-16T15:22:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fa5c25062f1d23bcb7069d9164f14192f547f40_2e5217a6-1a23-45c0-ad1b-c644b4eb04ad.webp?v=1752650550","variant_ids":[43302488735843]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Cat People - 貓派 - 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-XF54","featured_media":{"alt":null,"id":25830097780835,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fa5c25062f1d23bcb7069d9164f14192f547f40_2e5217a6-1a23-45c0-ad1b-c644b4eb04ad.webp?v=1752650550"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43302488899683,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-XF54","requires_shipping":true,"taxable":true,"featured_image":{"id":34197783380067,"product_id":7769466634339,"position":8,"created_at":"2025-07-16T15:22:31+08:00","updated_at":"2025-07-16T15:22:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e055c5087f55ef094e5f772a12437256707e11c_2dc5a3d3-e763-4389-a7ba-a935b927a7b3.webp?v=1752650553","variant_ids":[43302488899683]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Cat People - 貓派 - 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-XF54","featured_media":{"alt":null,"id":25830100172899,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e055c5087f55ef094e5f772a12437256707e11c_2dc5a3d3-e763-4389-a7ba-a935b927a7b3.webp?v=1752650553"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/072f4f0efa54a5189a5d932af920da31b1aa7aae.webp?v=1744705820","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fa5c25062f1d23bcb7069d9164f14192f547f40_2e5217a6-1a23-45c0-ad1b-c644b4eb04ad.webp?v=1752650550","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de3e403a9991bd4be247502e5f45d6543b32aaaf_3fc1a83d-d249-4c3f-8e83-5be246628870.webp?v=1752650550","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4babca57e5908db484257bae76d587085090886e_147829c9-7cb4-4451-8c00-cb46c0971c54.webp?v=1752650551","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95baefb79cd2ce33f97e9365faa0092a46e741d1_1223fbc5-e3a4-438d-8bf4-d6839cfe6158.webp?v=1752650551","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e26b8f02c24d42d2b5a145ba5c94da28653b5b0_9fed7eba-10fe-4a55-842f-0e9a333c8972.webp?v=1752650552","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1923ed15c868bdb9d0a738a09336f46c23f3408d_2ebab5df-f3c3-48e2-a17a-2051a67a712d.webp?v=1752650552","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e055c5087f55ef094e5f772a12437256707e11c_2dc5a3d3-e763-4389-a7ba-a935b927a7b3.webp?v=1752650553","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ece9f0ca117f971725b1bfc868f4a0e1be8a676_bb534e64-aaf7-4160-b49f-46c214a3d430.webp?v=1752650553","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da0348a461e931b2ffdd8a59cc04be30da5a55a7_c2d114e7-e358-4042-bc94-3a040f6c1beb.webp?v=1752650554","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7380eda57e1dd5adbec09f491337adc58fa4ee06_12ca4ee8-8f4b-44b0-91ec-cbbb223a7350.webp?v=1752650554","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/168d451a89bfb65c9eecc79167a3f0daab205af2_75dbb6f4-7b0b-40b3-99e0-51702e88d72e.webp?v=1752650555","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4780f86663c3f457384bef2c23a9d7f9e2ba718a_e6280477-d9b8-43fc-9263-433b28adc38a.webp?v=1752650556"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/072f4f0efa54a5189a5d932af920da31b1aa7aae.webp?v=1744705820","options":["color"],"media":[{"alt":null,"id":25495520411747,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/072f4f0efa54a5189a5d932af920da31b1aa7aae.webp?v=1744705820"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/072f4f0efa54a5189a5d932af920da31b1aa7aae.webp?v=1744705820","width":2000},{"alt":null,"id":25830097780835,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fa5c25062f1d23bcb7069d9164f14192f547f40_2e5217a6-1a23-45c0-ad1b-c644b4eb04ad.webp?v=1752650550"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fa5c25062f1d23bcb7069d9164f14192f547f40_2e5217a6-1a23-45c0-ad1b-c644b4eb04ad.webp?v=1752650550","width":2000},{"alt":null,"id":25830098436195,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de3e403a9991bd4be247502e5f45d6543b32aaaf_3fc1a83d-d249-4c3f-8e83-5be246628870.webp?v=1752650550"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de3e403a9991bd4be247502e5f45d6543b32aaaf_3fc1a83d-d249-4c3f-8e83-5be246628870.webp?v=1752650550","width":2000},{"alt":null,"id":25830098731107,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4babca57e5908db484257bae76d587085090886e_147829c9-7cb4-4451-8c00-cb46c0971c54.webp?v=1752650551"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4babca57e5908db484257bae76d587085090886e_147829c9-7cb4-4451-8c00-cb46c0971c54.webp?v=1752650551","width":2000},{"alt":null,"id":25830099058787,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95baefb79cd2ce33f97e9365faa0092a46e741d1_1223fbc5-e3a4-438d-8bf4-d6839cfe6158.webp?v=1752650551"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95baefb79cd2ce33f97e9365faa0092a46e741d1_1223fbc5-e3a4-438d-8bf4-d6839cfe6158.webp?v=1752650551","width":2000},{"alt":null,"id":25830099320931,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e26b8f02c24d42d2b5a145ba5c94da28653b5b0_9fed7eba-10fe-4a55-842f-0e9a333c8972.webp?v=1752650552"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e26b8f02c24d42d2b5a145ba5c94da28653b5b0_9fed7eba-10fe-4a55-842f-0e9a333c8972.webp?v=1752650552","width":2000},{"alt":null,"id":25830099615843,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1923ed15c868bdb9d0a738a09336f46c23f3408d_2ebab5df-f3c3-48e2-a17a-2051a67a712d.webp?v=1752650552"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1923ed15c868bdb9d0a738a09336f46c23f3408d_2ebab5df-f3c3-48e2-a17a-2051a67a712d.webp?v=1752650552","width":2000},{"alt":null,"id":25830100172899,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e055c5087f55ef094e5f772a12437256707e11c_2dc5a3d3-e763-4389-a7ba-a935b927a7b3.webp?v=1752650553"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e055c5087f55ef094e5f772a12437256707e11c_2dc5a3d3-e763-4389-a7ba-a935b927a7b3.webp?v=1752650553","width":2000},{"alt":null,"id":25830100500579,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ece9f0ca117f971725b1bfc868f4a0e1be8a676_bb534e64-aaf7-4160-b49f-46c214a3d430.webp?v=1752650553"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ece9f0ca117f971725b1bfc868f4a0e1be8a676_bb534e64-aaf7-4160-b49f-46c214a3d430.webp?v=1752650553","width":2000},{"alt":null,"id":25830100861027,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da0348a461e931b2ffdd8a59cc04be30da5a55a7_c2d114e7-e358-4042-bc94-3a040f6c1beb.webp?v=1752650554"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da0348a461e931b2ffdd8a59cc04be30da5a55a7_c2d114e7-e358-4042-bc94-3a040f6c1beb.webp?v=1752650554","width":2000},{"alt":null,"id":25830101123171,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7380eda57e1dd5adbec09f491337adc58fa4ee06_12ca4ee8-8f4b-44b0-91ec-cbbb223a7350.webp?v=1752650554"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7380eda57e1dd5adbec09f491337adc58fa4ee06_12ca4ee8-8f4b-44b0-91ec-cbbb223a7350.webp?v=1752650554","width":2000},{"alt":null,"id":25830101418083,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/168d451a89bfb65c9eecc79167a3f0daab205af2_75dbb6f4-7b0b-40b3-99e0-51702e88d72e.webp?v=1752650555"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/168d451a89bfb65c9eecc79167a3f0daab205af2_75dbb6f4-7b0b-40b3-99e0-51702e88d72e.webp?v=1752650555","width":2000},{"alt":null,"id":25830101745763,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4780f86663c3f457384bef2c23a9d7f9e2ba718a_e6280477-d9b8-43fc-9263-433b28adc38a.webp?v=1752650556"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4780f86663c3f457384bef2c23a9d7f9e2ba718a_e6280477-d9b8-43fc-9263-433b28adc38a.webp?v=1752650556","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43302483722339,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-XF54","requires_shipping":true,"taxable":true,"featured_image":{"id":34197784330339,"product_id":7769466634339,"position":9,"created_at":"2025-07-16T15:22:32+08:00","updated_at":"2025-07-16T15:22:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ece9f0ca117f971725b1bfc868f4a0e1be8a676_bb534e64-aaf7-4160-b49f-46c214a3d430.webp?v=1752650553","variant_ids":[43302483722339]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Cat People - 貓派 - 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-XF54","featured_media":{"alt":null,"id":25830100500579,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ece9f0ca117f971725b1bfc868f4a0e1be8a676_bb534e64-aaf7-4160-b49f-46c214a3d430.webp?v=1752650553"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43302488735843,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-XF54","requires_shipping":true,"taxable":true,"featured_image":{"id":34197779513443,"product_id":7769466634339,"position":2,"created_at":"2025-07-16T15:22:28+08:00","updated_at":"2025-07-16T15:22:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fa5c25062f1d23bcb7069d9164f14192f547f40_2e5217a6-1a23-45c0-ad1b-c644b4eb04ad.webp?v=1752650550","variant_ids":[43302488735843]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Cat People - 貓派 - 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-XF54","featured_media":{"alt":null,"id":25830097780835,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fa5c25062f1d23bcb7069d9164f14192f547f40_2e5217a6-1a23-45c0-ad1b-c644b4eb04ad.webp?v=1752650550"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43302488899683,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-XF54","requires_shipping":true,"taxable":true,"featured_image":{"id":34197783380067,"product_id":7769466634339,"position":8,"created_at":"2025-07-16T15:22:31+08:00","updated_at":"2025-07-16T15:22:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e055c5087f55ef094e5f772a12437256707e11c_2dc5a3d3-e763-4389-a7ba-a935b927a7b3.webp?v=1752650553","variant_ids":[43302488899683]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Cat People - 貓派 - 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-XF54","featured_media":{"alt":null,"id":25830100172899,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e055c5087f55ef094e5f772a12437256707e11c_2dc5a3d3-e763-4389-a7ba-a935b927a7b3.webp?v=1752650553"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43302483722339,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-XF54","requires_shipping":true,"taxable":true,"featured_image":{"id":34197784330339,"product_id":7769466634339,"position":9,"created_at":"2025-07-16T15:22:32+08:00","updated_at":"2025-07-16T15:22:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ece9f0ca117f971725b1bfc868f4a0e1be8a676_bb534e64-aaf7-4160-b49f-46c214a3d430.webp?v=1752650553","variant_ids":[43302483722339]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Cat People - 貓派 - 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-XF54","featured_media":{"alt":null,"id":25830100500579,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ece9f0ca117f971725b1bfc868f4a0e1be8a676_bb534e64-aaf7-4160-b49f-46c214a3d430.webp?v=1752650553"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}};
$device_handle = null;
$type = "";
var sellingStatus
if ($isMerge) {
$(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: "停產"
}