$product = {"id":7770000261219,"title":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Hug One Line - 愛與擁抱","handle":"iphone-14-pro-mod-nx-magsafe-printable-xf55","description":null,"published_at":"2025-04-16T12:54:55+08:00","created_at":"2025-04-15T23:07:57+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":43304989327459,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34197849964643,"product_id":7770000261219,"position":4,"created_at":"2025-07-16T15:23:31+08:00","updated_at":"2025-07-16T15:23:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b0bd388068218f7008d3158547926661df62bda_bd098952-3384-4145-b93f-825745d43cdf.webp?v=1752650613","variant_ids":[43304989327459]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25830135267427,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b0bd388068218f7008d3158547926661df62bda_bd098952-3384-4145-b93f-825745d43cdf.webp?v=1752650613"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43304994734179,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34197851504739,"product_id":7770000261219,"position":7,"created_at":"2025-07-16T15:23:32+08:00","updated_at":"2025-07-16T15:23:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbfc02a726e1cbb52053d26984a599ae02c7b012_3a5e8a7f-9574-46af-b0cc-22133fde049b.webp?v=1752650614","variant_ids":[43304994734179]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25830135922787,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbfc02a726e1cbb52053d26984a599ae02c7b012_3a5e8a7f-9574-46af-b0cc-22133fde049b.webp?v=1752650614"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43304994898019,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34197850718307,"product_id":7770000261219,"position":6,"created_at":"2025-07-16T15:23:32+08:00","updated_at":"2025-07-16T15:23:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3ae60e20b1593025b05569cfac0cfdd9a2f42f2_53de7c42-c8f0-410f-925f-6500136b5204.webp?v=1752650613","variant_ids":[43304994898019]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25830135693411,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3ae60e20b1593025b05569cfac0cfdd9a2f42f2_53de7c42-c8f0-410f-925f-6500136b5204.webp?v=1752650613"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3af64bf52846b629e7b892a28375a065473d4d5f_6e3e2c5c-5b86-4e5f-b425-1ca15f8ea108.webp?v=1744729684","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb404bc486048c06deb3a33ff5991595a20a2ce_547b984b-afbb-4156-b9e8-605f22fe0c00.webp?v=1752650611","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/57da1e78ba0c3e35185788c41d5df41f7360cf73_d3be2cf7-2532-4b08-bc4b-8424e5f10fd5.webp?v=1752650612","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b0bd388068218f7008d3158547926661df62bda_bd098952-3384-4145-b93f-825745d43cdf.webp?v=1752650613","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78bf190e41878ebce720c8f890f7991d16cb6137_cc9e1e56-3fad-4d6e-ab75-b13d8e3e7569.webp?v=1752650613","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3ae60e20b1593025b05569cfac0cfdd9a2f42f2_53de7c42-c8f0-410f-925f-6500136b5204.webp?v=1752650613","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbfc02a726e1cbb52053d26984a599ae02c7b012_3a5e8a7f-9574-46af-b0cc-22133fde049b.webp?v=1752650614","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eaa7551a1fd82f0df184f0de894e5524fb25adfb_870b2bed-0730-4312-ab46-2cb8adc2b3b5.webp?v=1752650615","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d3c61a0cc006371da52074099dcfdea751ef26_658fe1a6-7f14-4770-ab75-33cc19030409.webp?v=1752650615","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a706ba91d074d369787bb2670b2e8255c4f43806_3fc6189b-c4a0-45d2-ac00-d85e1018aeda.webp?v=1752650616","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9c343e766e8d41e77ed3acbeabbf9b774c677ef_7a412c5f-1917-4d3f-8bfa-6f9d40e284db.webp?v=1752650616","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bc3edbcaf7307d72963512967e9e8875f35f4dad_49b089af-08fc-4e55-a1be-dfde7f90b217.webp?v=1752650617","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0ee1ad695137e3aabeb39e6502f831066c12ab2d_55e12608-da1b-4f96-b969-ae9cb90d497d.webp?v=1752650618"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3af64bf52846b629e7b892a28375a065473d4d5f_6e3e2c5c-5b86-4e5f-b425-1ca15f8ea108.webp?v=1744729684","options":["color"],"media":[{"alt":null,"id":25496668078179,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3af64bf52846b629e7b892a28375a065473d4d5f_6e3e2c5c-5b86-4e5f-b425-1ca15f8ea108.webp?v=1744729684"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3af64bf52846b629e7b892a28375a065473d4d5f_6e3e2c5c-5b86-4e5f-b425-1ca15f8ea108.webp?v=1744729684","width":2000},{"alt":null,"id":25830134644835,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb404bc486048c06deb3a33ff5991595a20a2ce_547b984b-afbb-4156-b9e8-605f22fe0c00.webp?v=1752650611"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb404bc486048c06deb3a33ff5991595a20a2ce_547b984b-afbb-4156-b9e8-605f22fe0c00.webp?v=1752650611","width":2000},{"alt":null,"id":25830134972515,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/57da1e78ba0c3e35185788c41d5df41f7360cf73_d3be2cf7-2532-4b08-bc4b-8424e5f10fd5.webp?v=1752650612"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/57da1e78ba0c3e35185788c41d5df41f7360cf73_d3be2cf7-2532-4b08-bc4b-8424e5f10fd5.webp?v=1752650612","width":2000},{"alt":null,"id":25830135267427,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b0bd388068218f7008d3158547926661df62bda_bd098952-3384-4145-b93f-825745d43cdf.webp?v=1752650613"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b0bd388068218f7008d3158547926661df62bda_bd098952-3384-4145-b93f-825745d43cdf.webp?v=1752650613","width":2000},{"alt":null,"id":25830135496803,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78bf190e41878ebce720c8f890f7991d16cb6137_cc9e1e56-3fad-4d6e-ab75-b13d8e3e7569.webp?v=1752650613"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78bf190e41878ebce720c8f890f7991d16cb6137_cc9e1e56-3fad-4d6e-ab75-b13d8e3e7569.webp?v=1752650613","width":2000},{"alt":null,"id":25830135693411,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3ae60e20b1593025b05569cfac0cfdd9a2f42f2_53de7c42-c8f0-410f-925f-6500136b5204.webp?v=1752650613"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3ae60e20b1593025b05569cfac0cfdd9a2f42f2_53de7c42-c8f0-410f-925f-6500136b5204.webp?v=1752650613","width":2000},{"alt":null,"id":25830135922787,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbfc02a726e1cbb52053d26984a599ae02c7b012_3a5e8a7f-9574-46af-b0cc-22133fde049b.webp?v=1752650614"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbfc02a726e1cbb52053d26984a599ae02c7b012_3a5e8a7f-9574-46af-b0cc-22133fde049b.webp?v=1752650614","width":2000},{"alt":null,"id":25830136250467,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eaa7551a1fd82f0df184f0de894e5524fb25adfb_870b2bed-0730-4312-ab46-2cb8adc2b3b5.webp?v=1752650615"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eaa7551a1fd82f0df184f0de894e5524fb25adfb_870b2bed-0730-4312-ab46-2cb8adc2b3b5.webp?v=1752650615","width":2000},{"alt":null,"id":25830136610915,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d3c61a0cc006371da52074099dcfdea751ef26_658fe1a6-7f14-4770-ab75-33cc19030409.webp?v=1752650615"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d3c61a0cc006371da52074099dcfdea751ef26_658fe1a6-7f14-4770-ab75-33cc19030409.webp?v=1752650615","width":2000},{"alt":null,"id":25830136905827,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a706ba91d074d369787bb2670b2e8255c4f43806_3fc6189b-c4a0-45d2-ac00-d85e1018aeda.webp?v=1752650616"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a706ba91d074d369787bb2670b2e8255c4f43806_3fc6189b-c4a0-45d2-ac00-d85e1018aeda.webp?v=1752650616","width":2000},{"alt":null,"id":25830137233507,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9c343e766e8d41e77ed3acbeabbf9b774c677ef_7a412c5f-1917-4d3f-8bfa-6f9d40e284db.webp?v=1752650616"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9c343e766e8d41e77ed3acbeabbf9b774c677ef_7a412c5f-1917-4d3f-8bfa-6f9d40e284db.webp?v=1752650616","width":2000},{"alt":null,"id":25830137593955,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bc3edbcaf7307d72963512967e9e8875f35f4dad_49b089af-08fc-4e55-a1be-dfde7f90b217.webp?v=1752650617"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bc3edbcaf7307d72963512967e9e8875f35f4dad_49b089af-08fc-4e55-a1be-dfde7f90b217.webp?v=1752650617","width":2000},{"alt":null,"id":25830138642531,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0ee1ad695137e3aabeb39e6502f831066c12ab2d_55e12608-da1b-4f96-b969-ae9cb90d497d.webp?v=1752650618"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0ee1ad695137e3aabeb39e6502f831066c12ab2d_55e12608-da1b-4f96-b969-ae9cb90d497d.webp?v=1752650618","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43304989327459,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34197849964643,"product_id":7770000261219,"position":4,"created_at":"2025-07-16T15:23:31+08:00","updated_at":"2025-07-16T15:23:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b0bd388068218f7008d3158547926661df62bda_bd098952-3384-4145-b93f-825745d43cdf.webp?v=1752650613","variant_ids":[43304989327459]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25830135267427,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b0bd388068218f7008d3158547926661df62bda_bd098952-3384-4145-b93f-825745d43cdf.webp?v=1752650613"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43304994734179,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34197851504739,"product_id":7770000261219,"position":7,"created_at":"2025-07-16T15:23:32+08:00","updated_at":"2025-07-16T15:23:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbfc02a726e1cbb52053d26984a599ae02c7b012_3a5e8a7f-9574-46af-b0cc-22133fde049b.webp?v=1752650614","variant_ids":[43304994734179]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25830135922787,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbfc02a726e1cbb52053d26984a599ae02c7b012_3a5e8a7f-9574-46af-b0cc-22133fde049b.webp?v=1752650614"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43304994898019,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34197850718307,"product_id":7770000261219,"position":6,"created_at":"2025-07-16T15:23:32+08:00","updated_at":"2025-07-16T15:23:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3ae60e20b1593025b05569cfac0cfdd9a2f42f2_53de7c42-c8f0-410f-925f-6500136b5204.webp?v=1752650613","variant_ids":[43304994898019]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25830135693411,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3ae60e20b1593025b05569cfac0cfdd9a2f42f2_53de7c42-c8f0-410f-925f-6500136b5204.webp?v=1752650613"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43304989327459,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-XF55","requires_shipping":true,"taxable":true,"featured_image":{"id":34197849964643,"product_id":7770000261219,"position":4,"created_at":"2025-07-16T15:23:31+08:00","updated_at":"2025-07-16T15:23:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b0bd388068218f7008d3158547926661df62bda_bd098952-3384-4145-b93f-825745d43cdf.webp?v=1752650613","variant_ids":[43304989327459]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) ilovedoodle Hug One Line - 愛與擁抱 - 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-XF55","featured_media":{"alt":null,"id":25830135267427,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b0bd388068218f7008d3158547926661df62bda_bd098952-3384-4145-b93f-825745d43cdf.webp?v=1752650613"}},"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: "停產"
}