$product = {"id":7942269010019,"title":"iPhone 13 mini Mod NX (MagSafe 兼容) Seungyoun Kim 黑衣小狗 Pingu Kim","handle":"iphone-13-mini-mod-nx-magsafe-seu08","description":null,"published_at":"2025-12-23T09:33:10+08:00","created_at":"2025-12-22T17:44:18+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-seungyounkim","device-iPhone 13 Mini","merge","reseller-seungyounkim"],"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":43904441385059,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01228J5-SEU08","requires_shipping":true,"taxable":true,"featured_image":{"id":36341139406947,"product_id":7942269010019,"position":15,"created_at":"2026-07-22T02:56:54+08:00","updated_at":"2026-07-22T02:56:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff_f854cfdf-991d-4468-8c29-23a3014b26f9.webp?v=1784660216","variant_ids":[43904441385059]},"available":true,"name":"iPhone 13 mini Mod NX (MagSafe 兼容) Seungyoun Kim 黑衣小狗 Pingu Kim - 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":"MPB01228J5-SEU08","featured_media":{"alt":null,"id":27845011964003,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff_f854cfdf-991d-4468-8c29-23a3014b26f9.webp?v=1784660216"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43904441974883,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0122824-SEU08","requires_shipping":true,"taxable":true,"featured_image":{"id":36341138522211,"product_id":7942269010019,"position":13,"created_at":"2026-07-22T02:56:51+08:00","updated_at":"2026-07-22T02:56:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/877d23fc178bd33f750b9dd70247a45b738360dc_e21d268e-1ef9-4fff-830e-ec49927e39f2.webp?v=1784660213","variant_ids":[43904441974883]},"available":true,"name":"iPhone 13 mini Mod NX (MagSafe 兼容) Seungyoun Kim 黑衣小狗 Pingu Kim - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0122824-SEU08","featured_media":{"alt":null,"id":27845011112035,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/877d23fc178bd33f750b9dd70247a45b738360dc_e21d268e-1ef9-4fff-830e-ec49927e39f2.webp?v=1784660213"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43904444530787,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0122804-SEU08","requires_shipping":true,"taxable":true,"featured_image":{"id":36341139013731,"product_id":7942269010019,"position":14,"created_at":"2026-07-22T02:56:52+08:00","updated_at":"2026-07-22T02:56:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e3bc7bef4b2023e7342ddabdf0ba02fb7aa6e15_2368501f-749a-4443-87a3-2fce14bdcff5.webp?v=1784660214","variant_ids":[43904444530787]},"available":true,"name":"iPhone 13 mini Mod NX (MagSafe 兼容) Seungyoun Kim 黑衣小狗 Pingu Kim - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0122804-SEU08","featured_media":{"alt":null,"id":27845011570787,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e3bc7bef4b2023e7342ddabdf0ba02fb7aa6e15_2368501f-749a-4443-87a3-2fce14bdcff5.webp?v=1784660214"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/877d23fc178bd33f750b9dd70247a45b738360dc.webp?v=1766396696","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40c3e628e12ec020bedccc3dc2492484c7093d6d.webp?v=1766396696","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47bda5b63293796187f19515175d2760724dfc0b.webp?v=1766396696","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c579e7511dcd64b33111200103ea4e23d3a3f0cf.webp?v=1766396697","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5181c3b9c10617bb9023e32418a99430fe82386b.webp?v=1766396697","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff.webp?v=1766396698","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40fc30f64e3824e7ec4b9c3ded471cdb629e9f64.webp?v=1766396698","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e3bc7bef4b2023e7342ddabdf0ba02fb7aa6e15.webp?v=1766396698","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8781126cd87874d363598991a7c203cd98b41f1e.webp?v=1766396699","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2169976cbd82a92f7cc9b3c577d0d8897870f360.webp?v=1766396700","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e3bc7bef4b2023e7342ddabdf0ba02fb7aa6e15_a9403e33-d7c8-4116-b09c-5b7b5d46b696.webp?v=1784631838","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff_d1d0ff68-fa85-49f2-b0d7-69ceac35f4c9.webp?v=1784631842","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/877d23fc178bd33f750b9dd70247a45b738360dc_e21d268e-1ef9-4fff-830e-ec49927e39f2.webp?v=1784660213","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e3bc7bef4b2023e7342ddabdf0ba02fb7aa6e15_2368501f-749a-4443-87a3-2fce14bdcff5.webp?v=1784660214","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff_f854cfdf-991d-4468-8c29-23a3014b26f9.webp?v=1784660216"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/877d23fc178bd33f750b9dd70247a45b738360dc.webp?v=1766396696","options":["color"],"media":[{"alt":null,"id":26548632617059,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/877d23fc178bd33f750b9dd70247a45b738360dc.webp?v=1766396696"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/877d23fc178bd33f750b9dd70247a45b738360dc.webp?v=1766396696","width":2000},{"alt":null,"id":26548633075811,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40c3e628e12ec020bedccc3dc2492484c7093d6d.webp?v=1766396696"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40c3e628e12ec020bedccc3dc2492484c7093d6d.webp?v=1766396696","width":2000},{"alt":null,"id":26548633600099,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47bda5b63293796187f19515175d2760724dfc0b.webp?v=1766396696"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47bda5b63293796187f19515175d2760724dfc0b.webp?v=1766396696","width":2000},{"alt":null,"id":26548634189923,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c579e7511dcd64b33111200103ea4e23d3a3f0cf.webp?v=1766396697"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c579e7511dcd64b33111200103ea4e23d3a3f0cf.webp?v=1766396697","width":2000},{"alt":null,"id":26548634779747,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5181c3b9c10617bb9023e32418a99430fe82386b.webp?v=1766396697"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5181c3b9c10617bb9023e32418a99430fe82386b.webp?v=1766396697","width":2000},{"alt":null,"id":26548635304035,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff.webp?v=1766396698"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff.webp?v=1766396698","width":2000},{"alt":null,"id":26548635861091,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40fc30f64e3824e7ec4b9c3ded471cdb629e9f64.webp?v=1766396698"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40fc30f64e3824e7ec4b9c3ded471cdb629e9f64.webp?v=1766396698","width":2000},{"alt":null,"id":26548636319843,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e3bc7bef4b2023e7342ddabdf0ba02fb7aa6e15.webp?v=1766396698"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e3bc7bef4b2023e7342ddabdf0ba02fb7aa6e15.webp?v=1766396698","width":2000},{"alt":null,"id":26548636942435,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8781126cd87874d363598991a7c203cd98b41f1e.webp?v=1766396699"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8781126cd87874d363598991a7c203cd98b41f1e.webp?v=1766396699","width":2000},{"alt":null,"id":26548637466723,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2169976cbd82a92f7cc9b3c577d0d8897870f360.webp?v=1766396700"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2169976cbd82a92f7cc9b3c577d0d8897870f360.webp?v=1766396700","width":2000},{"alt":null,"id":27837424599139,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e3bc7bef4b2023e7342ddabdf0ba02fb7aa6e15_a9403e33-d7c8-4116-b09c-5b7b5d46b696.webp?v=1784631838"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e3bc7bef4b2023e7342ddabdf0ba02fb7aa6e15_a9403e33-d7c8-4116-b09c-5b7b5d46b696.webp?v=1784631838","width":2000},{"alt":null,"id":27837425975395,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff_d1d0ff68-fa85-49f2-b0d7-69ceac35f4c9.webp?v=1784631842"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff_d1d0ff68-fa85-49f2-b0d7-69ceac35f4c9.webp?v=1784631842","width":2000},{"alt":null,"id":27845011112035,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/877d23fc178bd33f750b9dd70247a45b738360dc_e21d268e-1ef9-4fff-830e-ec49927e39f2.webp?v=1784660213"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/877d23fc178bd33f750b9dd70247a45b738360dc_e21d268e-1ef9-4fff-830e-ec49927e39f2.webp?v=1784660213","width":2000},{"alt":null,"id":27845011570787,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e3bc7bef4b2023e7342ddabdf0ba02fb7aa6e15_2368501f-749a-4443-87a3-2fce14bdcff5.webp?v=1784660214"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e3bc7bef4b2023e7342ddabdf0ba02fb7aa6e15_2368501f-749a-4443-87a3-2fce14bdcff5.webp?v=1784660214","width":2000},{"alt":null,"id":27845011964003,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff_f854cfdf-991d-4468-8c29-23a3014b26f9.webp?v=1784660216"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff_f854cfdf-991d-4468-8c29-23a3014b26f9.webp?v=1784660216","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43904441385059,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01228J5-SEU08","requires_shipping":true,"taxable":true,"featured_image":{"id":36341139406947,"product_id":7942269010019,"position":15,"created_at":"2026-07-22T02:56:54+08:00","updated_at":"2026-07-22T02:56:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff_f854cfdf-991d-4468-8c29-23a3014b26f9.webp?v=1784660216","variant_ids":[43904441385059]},"available":true,"name":"iPhone 13 mini Mod NX (MagSafe 兼容) Seungyoun Kim 黑衣小狗 Pingu Kim - 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":"MPB01228J5-SEU08","featured_media":{"alt":null,"id":27845011964003,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff_f854cfdf-991d-4468-8c29-23a3014b26f9.webp?v=1784660216"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43904441974883,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0122824-SEU08","requires_shipping":true,"taxable":true,"featured_image":{"id":36341138522211,"product_id":7942269010019,"position":13,"created_at":"2026-07-22T02:56:51+08:00","updated_at":"2026-07-22T02:56:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/877d23fc178bd33f750b9dd70247a45b738360dc_e21d268e-1ef9-4fff-830e-ec49927e39f2.webp?v=1784660213","variant_ids":[43904441974883]},"available":true,"name":"iPhone 13 mini Mod NX (MagSafe 兼容) Seungyoun Kim 黑衣小狗 Pingu Kim - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0122824-SEU08","featured_media":{"alt":null,"id":27845011112035,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/877d23fc178bd33f750b9dd70247a45b738360dc_e21d268e-1ef9-4fff-830e-ec49927e39f2.webp?v=1784660213"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43904444530787,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0122804-SEU08","requires_shipping":true,"taxable":true,"featured_image":{"id":36341139013731,"product_id":7942269010019,"position":14,"created_at":"2026-07-22T02:56:52+08:00","updated_at":"2026-07-22T02:56:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e3bc7bef4b2023e7342ddabdf0ba02fb7aa6e15_2368501f-749a-4443-87a3-2fce14bdcff5.webp?v=1784660214","variant_ids":[43904444530787]},"available":true,"name":"iPhone 13 mini Mod NX (MagSafe 兼容) Seungyoun Kim 黑衣小狗 Pingu Kim - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0122804-SEU08","featured_media":{"alt":null,"id":27845011570787,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e3bc7bef4b2023e7342ddabdf0ba02fb7aa6e15_2368501f-749a-4443-87a3-2fce14bdcff5.webp?v=1784660214"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43904441385059,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01228J5-SEU08","requires_shipping":true,"taxable":true,"featured_image":{"id":36341139406947,"product_id":7942269010019,"position":15,"created_at":"2026-07-22T02:56:54+08:00","updated_at":"2026-07-22T02:56:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff_f854cfdf-991d-4468-8c29-23a3014b26f9.webp?v=1784660216","variant_ids":[43904441385059]},"available":true,"name":"iPhone 13 mini Mod NX (MagSafe 兼容) Seungyoun Kim 黑衣小狗 Pingu Kim - 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":"MPB01228J5-SEU08","featured_media":{"alt":null,"id":27845011964003,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/264d5d24fb5fc1fee0872e07b62cefe83fea60ff_f854cfdf-991d-4468-8c29-23a3014b26f9.webp?v=1784660216"}},"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: "停產"
}