$product = {"id":7407980904547,"title":"犀牛盾Mod NX手機殼 - iPhone 14 Pro - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 爪哇族2-塗鴉藝術","handle":"iphone-14-pro-mod-nx-printable-pb40","description":null,"published_at":"2024-06-11T16:28:14+08:00","created_at":"2024-05-03T11:27:58+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師MOD NX專區-迪士尼-星際大戰 Star Wars","tags":["20%","25%","30%","35%","40%","45%","50%","b2b","brand-Apple","designer","designer-starwars","device-iPhone 14 Pro","merge","mod-nx-printable","new-modnx-sku","reseller-modnx-star-wars","Top50","type-Mod NX Printable"],"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":41881338347619,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0126224-PB40","requires_shipping":true,"taxable":true,"featured_image":{"id":31470867021923,"product_id":7407980904547,"position":9,"created_at":"2024-05-03T11:28:20+08:00","updated_at":"2024-05-03T11:28:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e750843188a62fe7e85d6bdddc1873bf593a86c_7abf6760-ed4f-41af-af4a-1ef432aec1ef.webp?v=1714706900","variant_ids":[41881338347619]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone 14 Pro - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 爪哇族2-塗鴉藝術 - Mod NX-黑色邊框","public_title":"Mod NX-黑色邊框","options":["Mod NX-黑色邊框"],"price":90000,"weight":980,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126224-PB40","featured_media":{"alt":null,"id":23875771629667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e750843188a62fe7e85d6bdddc1873bf593a86c_7abf6760-ed4f-41af-af4a-1ef432aec1ef.webp?v=1714706900"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41881338413155,"title":"Mod NX-白色邊框","option1":"Mod NX-白色邊框","option2":null,"option3":null,"sku":"NPB0126204-PB40","requires_shipping":true,"taxable":true,"featured_image":{"id":31470866071651,"product_id":7407980904547,"position":7,"created_at":"2024-05-03T11:28:15+08:00","updated_at":"2024-05-03T11:28:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42c2b1b28c6dd64d2b59a16b35466f7fd9ee8510_dabb77de-bf48-49e9-a1de-b263d01dd601.webp?v=1714706895","variant_ids":[41881338413155]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone 14 Pro - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 爪哇族2-塗鴉藝術 - Mod NX-白色邊框","public_title":"Mod NX-白色邊框","options":["Mod NX-白色邊框"],"price":90000,"weight":980,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126204-PB40","featured_media":{"alt":null,"id":23875770679395,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42c2b1b28c6dd64d2b59a16b35466f7fd9ee8510_dabb77de-bf48-49e9-a1de-b263d01dd601.webp?v=1714706895"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41881338642531,"title":"Mod NX-海軍藍邊框","option1":"Mod NX-海軍藍邊框","option2":null,"option3":null,"sku":"NPB01262J5-PB40","requires_shipping":true,"taxable":true,"featured_image":{"id":31470864564323,"product_id":7407980904547,"position":4,"created_at":"2024-05-03T11:28:08+08:00","updated_at":"2024-05-03T11:28:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d5b2ad9e6f52d7327bb4427e7b06ee15155f1fa4_f49df54b-d470-4f07-893e-fe8f343fdb5c.webp?v=1714706888","variant_ids":[41881338642531]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone 14 Pro - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 爪哇族2-塗鴉藝術 - Mod NX-海軍藍邊框","public_title":"Mod NX-海軍藍邊框","options":["Mod NX-海軍藍邊框"],"price":90000,"weight":980,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01262J5-PB40","featured_media":{"alt":null,"id":23875769172067,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d5b2ad9e6f52d7327bb4427e7b06ee15155f1fa4_f49df54b-d470-4f07-893e-fe8f343fdb5c.webp?v=1714706888"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff46d4af6d5dd2bd1fb658e377be0d8647bcd019_311f0494-fcba-440e-8e4e-85f424dbb9f6.webp?v=1714706881","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eea42ae7abbd5efff51e76393e6996d61e12d904_86160723-f3ab-49f3-83bb-5ba7e244e2c1.webp?v=1714706883","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2af0c71643d0eac66d8317c3a195853174a6260_3024b8c9-3278-4541-8f2d-5876efa45cea.webp?v=1714706886","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d5b2ad9e6f52d7327bb4427e7b06ee15155f1fa4_f49df54b-d470-4f07-893e-fe8f343fdb5c.webp?v=1714706888","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51681fdb39aab2663fac139848d16870bdad236e_c67fddab-37cd-4a3a-87f4-dd8ba0479519.webp?v=1714706890","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e7aa1e52bcfc1c0b45b51f0b0b73c2fea4b0203_ff196837-3b89-4a88-b16c-9fe09e6617d2.webp?v=1714706892","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42c2b1b28c6dd64d2b59a16b35466f7fd9ee8510_dabb77de-bf48-49e9-a1de-b263d01dd601.webp?v=1714706895","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afced56f1e3c933ec29c25a00ba9fd7468c9fe1a_2828f7c5-0718-4dac-8eec-faa7e2d6a334.webp?v=1714706897","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e750843188a62fe7e85d6bdddc1873bf593a86c_7abf6760-ed4f-41af-af4a-1ef432aec1ef.webp?v=1714706900","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7baadb94c13d5759bb43e9cde5773e18a999b90c_d82e7f2e-d7c1-47f6-bbed-0d86098abe55.webp?v=1714706902"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff46d4af6d5dd2bd1fb658e377be0d8647bcd019_311f0494-fcba-440e-8e4e-85f424dbb9f6.webp?v=1714706881","options":["color"],"media":[{"alt":null,"id":23875767926883,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff46d4af6d5dd2bd1fb658e377be0d8647bcd019_311f0494-fcba-440e-8e4e-85f424dbb9f6.webp?v=1714706881"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff46d4af6d5dd2bd1fb658e377be0d8647bcd019_311f0494-fcba-440e-8e4e-85f424dbb9f6.webp?v=1714706881","width":2000},{"alt":null,"id":23875768287331,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eea42ae7abbd5efff51e76393e6996d61e12d904_86160723-f3ab-49f3-83bb-5ba7e244e2c1.webp?v=1714706883"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eea42ae7abbd5efff51e76393e6996d61e12d904_86160723-f3ab-49f3-83bb-5ba7e244e2c1.webp?v=1714706883","width":2000},{"alt":null,"id":23875768713315,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2af0c71643d0eac66d8317c3a195853174a6260_3024b8c9-3278-4541-8f2d-5876efa45cea.webp?v=1714706886"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2af0c71643d0eac66d8317c3a195853174a6260_3024b8c9-3278-4541-8f2d-5876efa45cea.webp?v=1714706886","width":2000},{"alt":null,"id":23875769172067,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d5b2ad9e6f52d7327bb4427e7b06ee15155f1fa4_f49df54b-d470-4f07-893e-fe8f343fdb5c.webp?v=1714706888"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d5b2ad9e6f52d7327bb4427e7b06ee15155f1fa4_f49df54b-d470-4f07-893e-fe8f343fdb5c.webp?v=1714706888","width":2000},{"alt":null,"id":23875769663587,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51681fdb39aab2663fac139848d16870bdad236e_c67fddab-37cd-4a3a-87f4-dd8ba0479519.webp?v=1714706890"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51681fdb39aab2663fac139848d16870bdad236e_c67fddab-37cd-4a3a-87f4-dd8ba0479519.webp?v=1714706890","width":2000},{"alt":null,"id":23875770187875,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e7aa1e52bcfc1c0b45b51f0b0b73c2fea4b0203_ff196837-3b89-4a88-b16c-9fe09e6617d2.webp?v=1714706892"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e7aa1e52bcfc1c0b45b51f0b0b73c2fea4b0203_ff196837-3b89-4a88-b16c-9fe09e6617d2.webp?v=1714706892","width":2000},{"alt":null,"id":23875770679395,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42c2b1b28c6dd64d2b59a16b35466f7fd9ee8510_dabb77de-bf48-49e9-a1de-b263d01dd601.webp?v=1714706895"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42c2b1b28c6dd64d2b59a16b35466f7fd9ee8510_dabb77de-bf48-49e9-a1de-b263d01dd601.webp?v=1714706895","width":2000},{"alt":null,"id":23875771072611,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afced56f1e3c933ec29c25a00ba9fd7468c9fe1a_2828f7c5-0718-4dac-8eec-faa7e2d6a334.webp?v=1714706897"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afced56f1e3c933ec29c25a00ba9fd7468c9fe1a_2828f7c5-0718-4dac-8eec-faa7e2d6a334.webp?v=1714706897","width":2000},{"alt":null,"id":23875771629667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e750843188a62fe7e85d6bdddc1873bf593a86c_7abf6760-ed4f-41af-af4a-1ef432aec1ef.webp?v=1714706900"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e750843188a62fe7e85d6bdddc1873bf593a86c_7abf6760-ed4f-41af-af4a-1ef432aec1ef.webp?v=1714706900","width":2000},{"alt":null,"id":23875772022883,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7baadb94c13d5759bb43e9cde5773e18a999b90c_d82e7f2e-d7c1-47f6-bbed-0d86098abe55.webp?v=1714706902"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7baadb94c13d5759bb43e9cde5773e18a999b90c_d82e7f2e-d7c1-47f6-bbed-0d86098abe55.webp?v=1714706902","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$bumper = null;
$variants = [{"id":41881338347619,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0126224-PB40","requires_shipping":true,"taxable":true,"featured_image":{"id":31470867021923,"product_id":7407980904547,"position":9,"created_at":"2024-05-03T11:28:20+08:00","updated_at":"2024-05-03T11:28:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e750843188a62fe7e85d6bdddc1873bf593a86c_7abf6760-ed4f-41af-af4a-1ef432aec1ef.webp?v=1714706900","variant_ids":[41881338347619]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone 14 Pro - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 爪哇族2-塗鴉藝術 - Mod NX-黑色邊框","public_title":"Mod NX-黑色邊框","options":["Mod NX-黑色邊框"],"price":90000,"weight":980,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126224-PB40","featured_media":{"alt":null,"id":23875771629667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e750843188a62fe7e85d6bdddc1873bf593a86c_7abf6760-ed4f-41af-af4a-1ef432aec1ef.webp?v=1714706900"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41881338413155,"title":"Mod NX-白色邊框","option1":"Mod NX-白色邊框","option2":null,"option3":null,"sku":"NPB0126204-PB40","requires_shipping":true,"taxable":true,"featured_image":{"id":31470866071651,"product_id":7407980904547,"position":7,"created_at":"2024-05-03T11:28:15+08:00","updated_at":"2024-05-03T11:28:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42c2b1b28c6dd64d2b59a16b35466f7fd9ee8510_dabb77de-bf48-49e9-a1de-b263d01dd601.webp?v=1714706895","variant_ids":[41881338413155]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone 14 Pro - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 爪哇族2-塗鴉藝術 - Mod NX-白色邊框","public_title":"Mod NX-白色邊框","options":["Mod NX-白色邊框"],"price":90000,"weight":980,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126204-PB40","featured_media":{"alt":null,"id":23875770679395,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42c2b1b28c6dd64d2b59a16b35466f7fd9ee8510_dabb77de-bf48-49e9-a1de-b263d01dd601.webp?v=1714706895"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41881338642531,"title":"Mod NX-海軍藍邊框","option1":"Mod NX-海軍藍邊框","option2":null,"option3":null,"sku":"NPB01262J5-PB40","requires_shipping":true,"taxable":true,"featured_image":{"id":31470864564323,"product_id":7407980904547,"position":4,"created_at":"2024-05-03T11:28:08+08:00","updated_at":"2024-05-03T11:28:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d5b2ad9e6f52d7327bb4427e7b06ee15155f1fa4_f49df54b-d470-4f07-893e-fe8f343fdb5c.webp?v=1714706888","variant_ids":[41881338642531]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone 14 Pro - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 爪哇族2-塗鴉藝術 - Mod NX-海軍藍邊框","public_title":"Mod NX-海軍藍邊框","options":["Mod NX-海軍藍邊框"],"price":90000,"weight":980,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01262J5-PB40","featured_media":{"alt":null,"id":23875769172067,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d5b2ad9e6f52d7327bb4427e7b06ee15155f1fa4_f49df54b-d470-4f07-893e-fe8f343fdb5c.webp?v=1714706888"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":41881338347619,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0126224-PB40","requires_shipping":true,"taxable":true,"featured_image":{"id":31470867021923,"product_id":7407980904547,"position":9,"created_at":"2024-05-03T11:28:20+08:00","updated_at":"2024-05-03T11:28:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e750843188a62fe7e85d6bdddc1873bf593a86c_7abf6760-ed4f-41af-af4a-1ef432aec1ef.webp?v=1714706900","variant_ids":[41881338347619]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone 14 Pro - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 爪哇族2-塗鴉藝術 - Mod NX-黑色邊框","public_title":"Mod NX-黑色邊框","options":["Mod NX-黑色邊框"],"price":90000,"weight":980,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126224-PB40","featured_media":{"alt":null,"id":23875771629667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e750843188a62fe7e85d6bdddc1873bf593a86c_7abf6760-ed4f-41af-af4a-1ef432aec1ef.webp?v=1714706900"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}};
$device_handle = null
var sellingStatus
if ($bumper) {
$(document).ready(function() {
var productImg = $product.images[0]
var bumperVariants = $bumper.variants;
var bumperColors = new Object();
var currentVariant = '';
var productType = '';
bumperVariants.forEach(variant => {
bumperColors[`${variant.title.split(' (')[0].toLowerCase()}`] = variant.featured_image.src;
});
if (productType === 'mod-nx-backplate' || productType === 'mod-backplate') {
mergeImages(
[productImg, bumperColors[currentVariant]],
{ crossOrigin: 'anonymous' }
).then(mergedImg => {
$('.merged-img').attr('src', mergedImg);
});
} else {
mergeImages(
[bumperColors[currentVariant], productImg],
{ crossOrigin: 'anonymous' }
).then(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: "停產"
}