$product = {"id":7769991020643,"title":"iPhone 14 Pro Mod NX ilovedoodle Hug One Line - 愛與擁抱","handle":"iphone-14-pro-mod-nx-printable-xf55","description":null,"published_at":"2025-04-16T12:59:13+08:00","created_at":"2025-04-15T23:00:32+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":43304946597987,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34196610646115,"product_id":7769991020643,"position":5,"created_at":"2025-07-16T14:47:16+08:00","updated_at":"2025-07-16T14:47:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aeba46ae9d2a92fedcd9539f03a4a1c982a6476b_d24995b8-7d5b-4c06-b94a-90561f39f855.webp?v=1752648438","variant_ids":[43304946597987]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25829448712291,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aeba46ae9d2a92fedcd9539f03a4a1c982a6476b_d24995b8-7d5b-4c06-b94a-90561f39f855.webp?v=1752648438"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43304951480419,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34196609630307,"product_id":7769991020643,"position":3,"created_at":"2025-07-16T14:47:15+08:00","updated_at":"2025-07-16T14:47:17+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d0c438e62b1a6c71ab2dbb73acc58475fe1dfae_38cfba01-9c68-47e9-908e-21338e95c02b.webp?v=1752648437","variant_ids":[43304951480419]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25829448155235,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d0c438e62b1a6c71ab2dbb73acc58475fe1dfae_38cfba01-9c68-47e9-908e-21338e95c02b.webp?v=1752648437"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43304951644259,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34196612841571,"product_id":7769991020643,"position":9,"created_at":"2025-07-16T14:47:19+08:00","updated_at":"2025-07-16T14:47:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86803e986fc7193dcc4c97fbd79ca2a894f19f94_3bb465fc-a18b-48f9-b2ef-5cc4bc8eed14.webp?v=1752648441","variant_ids":[43304951644259]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25829449793635,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86803e986fc7193dcc4c97fbd79ca2a894f19f94_3bb465fc-a18b-48f9-b2ef-5cc4bc8eed14.webp?v=1752648441"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3af64bf52846b629e7b892a28375a065473d4d5f.webp?v=1744729238","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/542c07eddbce5a027a3c4cfb8ef7bc2d08a60d40_a621feb0-bfbb-4564-94ab-b39e7100b0ae.webp?v=1752648437","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d0c438e62b1a6c71ab2dbb73acc58475fe1dfae_38cfba01-9c68-47e9-908e-21338e95c02b.webp?v=1752648437","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e839798c97e99ac816417794d76cff1ed904aeb_3ff87217-5d1e-4c5b-9879-de1ae35b92e3.webp?v=1752648438","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aeba46ae9d2a92fedcd9539f03a4a1c982a6476b_d24995b8-7d5b-4c06-b94a-90561f39f855.webp?v=1752648438","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17fa3dc817d5afbe7bfb079ba354cfd1825df877_b3695305-4203-4de3-862b-a0eb2908b9c2.webp?v=1752648439","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c55df8079bda8b0827820bf8b15d50d8ee9b8b7_de9cf3f1-4a8e-4a6d-84e5-72a05435896d.webp?v=1752648439","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98771136a2bc13f71c268b60ae426bc7f58eb84f_e2123e88-4b1b-4374-96db-9114ec876578.webp?v=1752648440","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86803e986fc7193dcc4c97fbd79ca2a894f19f94_3bb465fc-a18b-48f9-b2ef-5cc4bc8eed14.webp?v=1752648441","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3108a9ca24a844cb6f3dba2c70aab5a47d56352d_8055b32d-2cdd-4549-a04d-c801221803e0.webp?v=1752648441","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4767becece76f87b859e5028d8f0ee3029e4ef8e_8964bc4e-9943-46e4-b1ba-0ece6d8e10a9.webp?v=1752648442","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c640d74bac11252a1575ab4420ea754a3264a5c9_f2322cd7-ca3b-416f-b883-4575cc5943cb.webp?v=1752648442","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2271227a15ec926e698ea80e268703d908b79c5d_c6f5cf08-8d74-4778-b3d5-5876c86d407a.webp?v=1752648443"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3af64bf52846b629e7b892a28375a065473d4d5f.webp?v=1744729238","options":["color"],"media":[{"alt":null,"id":25496653398115,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3af64bf52846b629e7b892a28375a065473d4d5f.webp?v=1744729238"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3af64bf52846b629e7b892a28375a065473d4d5f.webp?v=1744729238","width":2000},{"alt":null,"id":25829447794787,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/542c07eddbce5a027a3c4cfb8ef7bc2d08a60d40_a621feb0-bfbb-4564-94ab-b39e7100b0ae.webp?v=1752648437"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/542c07eddbce5a027a3c4cfb8ef7bc2d08a60d40_a621feb0-bfbb-4564-94ab-b39e7100b0ae.webp?v=1752648437","width":2000},{"alt":null,"id":25829448155235,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d0c438e62b1a6c71ab2dbb73acc58475fe1dfae_38cfba01-9c68-47e9-908e-21338e95c02b.webp?v=1752648437"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d0c438e62b1a6c71ab2dbb73acc58475fe1dfae_38cfba01-9c68-47e9-908e-21338e95c02b.webp?v=1752648437","width":2000},{"alt":null,"id":25829448417379,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e839798c97e99ac816417794d76cff1ed904aeb_3ff87217-5d1e-4c5b-9879-de1ae35b92e3.webp?v=1752648438"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e839798c97e99ac816417794d76cff1ed904aeb_3ff87217-5d1e-4c5b-9879-de1ae35b92e3.webp?v=1752648438","width":2000},{"alt":null,"id":25829448712291,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aeba46ae9d2a92fedcd9539f03a4a1c982a6476b_d24995b8-7d5b-4c06-b94a-90561f39f855.webp?v=1752648438"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aeba46ae9d2a92fedcd9539f03a4a1c982a6476b_d24995b8-7d5b-4c06-b94a-90561f39f855.webp?v=1752648438","width":2000},{"alt":null,"id":25829449072739,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17fa3dc817d5afbe7bfb079ba354cfd1825df877_b3695305-4203-4de3-862b-a0eb2908b9c2.webp?v=1752648439"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17fa3dc817d5afbe7bfb079ba354cfd1825df877_b3695305-4203-4de3-862b-a0eb2908b9c2.webp?v=1752648439","width":2000},{"alt":null,"id":25829449302115,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c55df8079bda8b0827820bf8b15d50d8ee9b8b7_de9cf3f1-4a8e-4a6d-84e5-72a05435896d.webp?v=1752648439"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c55df8079bda8b0827820bf8b15d50d8ee9b8b7_de9cf3f1-4a8e-4a6d-84e5-72a05435896d.webp?v=1752648439","width":2000},{"alt":null,"id":25829449564259,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98771136a2bc13f71c268b60ae426bc7f58eb84f_e2123e88-4b1b-4374-96db-9114ec876578.webp?v=1752648440"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/98771136a2bc13f71c268b60ae426bc7f58eb84f_e2123e88-4b1b-4374-96db-9114ec876578.webp?v=1752648440","width":2000},{"alt":null,"id":25829449793635,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86803e986fc7193dcc4c97fbd79ca2a894f19f94_3bb465fc-a18b-48f9-b2ef-5cc4bc8eed14.webp?v=1752648441"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86803e986fc7193dcc4c97fbd79ca2a894f19f94_3bb465fc-a18b-48f9-b2ef-5cc4bc8eed14.webp?v=1752648441","width":2000},{"alt":null,"id":25829449990243,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3108a9ca24a844cb6f3dba2c70aab5a47d56352d_8055b32d-2cdd-4549-a04d-c801221803e0.webp?v=1752648441"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3108a9ca24a844cb6f3dba2c70aab5a47d56352d_8055b32d-2cdd-4549-a04d-c801221803e0.webp?v=1752648441","width":2000},{"alt":null,"id":25829450186851,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4767becece76f87b859e5028d8f0ee3029e4ef8e_8964bc4e-9943-46e4-b1ba-0ece6d8e10a9.webp?v=1752648442"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4767becece76f87b859e5028d8f0ee3029e4ef8e_8964bc4e-9943-46e4-b1ba-0ece6d8e10a9.webp?v=1752648442","width":2000},{"alt":null,"id":25829450580067,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c640d74bac11252a1575ab4420ea754a3264a5c9_f2322cd7-ca3b-416f-b883-4575cc5943cb.webp?v=1752648442"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c640d74bac11252a1575ab4420ea754a3264a5c9_f2322cd7-ca3b-416f-b883-4575cc5943cb.webp?v=1752648442","width":2000},{"alt":null,"id":25829450809443,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2271227a15ec926e698ea80e268703d908b79c5d_c6f5cf08-8d74-4778-b3d5-5876c86d407a.webp?v=1752648443"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2271227a15ec926e698ea80e268703d908b79c5d_c6f5cf08-8d74-4778-b3d5-5876c86d407a.webp?v=1752648443","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43304946597987,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34196610646115,"product_id":7769991020643,"position":5,"created_at":"2025-07-16T14:47:16+08:00","updated_at":"2025-07-16T14:47:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aeba46ae9d2a92fedcd9539f03a4a1c982a6476b_d24995b8-7d5b-4c06-b94a-90561f39f855.webp?v=1752648438","variant_ids":[43304946597987]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25829448712291,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aeba46ae9d2a92fedcd9539f03a4a1c982a6476b_d24995b8-7d5b-4c06-b94a-90561f39f855.webp?v=1752648438"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43304951480419,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34196609630307,"product_id":7769991020643,"position":3,"created_at":"2025-07-16T14:47:15+08:00","updated_at":"2025-07-16T14:47:17+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d0c438e62b1a6c71ab2dbb73acc58475fe1dfae_38cfba01-9c68-47e9-908e-21338e95c02b.webp?v=1752648437","variant_ids":[43304951480419]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25829448155235,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d0c438e62b1a6c71ab2dbb73acc58475fe1dfae_38cfba01-9c68-47e9-908e-21338e95c02b.webp?v=1752648437"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43304951644259,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34196612841571,"product_id":7769991020643,"position":9,"created_at":"2025-07-16T14:47:19+08:00","updated_at":"2025-07-16T14:47:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86803e986fc7193dcc4c97fbd79ca2a894f19f94_3bb465fc-a18b-48f9-b2ef-5cc4bc8eed14.webp?v=1752648441","variant_ids":[43304951644259]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25829449793635,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86803e986fc7193dcc4c97fbd79ca2a894f19f94_3bb465fc-a18b-48f9-b2ef-5cc4bc8eed14.webp?v=1752648441"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43304946597987,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34196610646115,"product_id":7769991020643,"position":5,"created_at":"2025-07-16T14:47:16+08:00","updated_at":"2025-07-16T14:47:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aeba46ae9d2a92fedcd9539f03a4a1c982a6476b_d24995b8-7d5b-4c06-b94a-90561f39f855.webp?v=1752648438","variant_ids":[43304946597987]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25829448712291,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aeba46ae9d2a92fedcd9539f03a4a1c982a6476b_d24995b8-7d5b-4c06-b94a-90561f39f855.webp?v=1752648438"}},"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: "停產"
}