Home
›
AirPods 2 AirPods Case Keigo Smiling Sloth
$product = {"id":7873215561827,"title":"AirPods 2 AirPods Case Keigo Smiling Sloth","handle":"airpods-2-airpods-case-kei11","description":null,"published_at":"2025-09-01T11:17:05+08:00","created_at":"2025-09-01T09:25:58+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-keigo","device-Airpods 2","merge","reseller-keigo"],"price":75000,"price_min":75000,"price_max":75000,"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":43658344988771,"title":"Violet","option1":"Violet","option2":null,"option3":null,"sku":"ABT01170P1-KEI11","requires_shipping":true,"taxable":true,"featured_image":{"id":34409702981731,"product_id":7873215561827,"position":7,"created_at":"2025-09-01T09:26:06+08:00","updated_at":"2025-09-01T09:26:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78ff6a71824c8883e9ffd812c8f872ca9411bfd3.webp?v=1756689968","variant_ids":[43658344988771]},"available":true,"name":"AirPods 2 AirPods Case Keigo Smiling Sloth - Violet","public_title":"Violet","options":["Violet"],"price":75000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"ABT01170P1-KEI11","featured_media":{"alt":null,"id":25982017994851,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78ff6a71824c8883e9ffd812c8f872ca9411bfd3.webp?v=1756689968"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658346987619,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"ABT01170O9-KEI11","requires_shipping":true,"taxable":true,"featured_image":{"id":34409702588515,"product_id":7873215561827,"position":5,"created_at":"2025-09-01T09:26:04+08:00","updated_at":"2025-09-01T09:26:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17c931821a4754152d070c3952fbb1800281f20e.webp?v=1756689967","variant_ids":[43658346987619]},"available":true,"name":"AirPods 2 AirPods Case Keigo Smiling Sloth - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":75000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"ABT01170O9-KEI11","featured_media":{"alt":null,"id":25982017601635,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17c931821a4754152d070c3952fbb1800281f20e.webp?v=1756689967"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658347020387,"title":"Transparent","option1":"Transparent","option2":null,"option3":null,"sku":"ABT01170R4-KEI11","requires_shipping":true,"taxable":true,"featured_image":{"id":34409702195299,"product_id":7873215561827,"position":3,"created_at":"2025-09-01T09:26:03+08:00","updated_at":"2025-09-01T09:26:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f05e557478f7f57fdd540611253b87b6c1b5d15b.webp?v=1756689965","variant_ids":[43658347020387]},"available":true,"name":"AirPods 2 AirPods Case Keigo Smiling Sloth - Transparent","public_title":"Transparent","options":["Transparent"],"price":75000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"ABT01170R4-KEI11","featured_media":{"alt":null,"id":25982017208419,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f05e557478f7f57fdd540611253b87b6c1b5d15b.webp?v=1756689965"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658347053155,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"ABT0117052-KEI11","requires_shipping":true,"taxable":true,"featured_image":{"id":34409702359139,"product_id":7873215561827,"position":4,"created_at":"2025-09-01T09:26:04+08:00","updated_at":"2025-09-01T09:26:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/27deebf61eac666356ad8525f1f317073106a34b.webp?v=1756689966","variant_ids":[43658347053155]},"available":true,"name":"AirPods 2 AirPods Case Keigo Smiling Sloth - Black","public_title":"Black","options":["Black"],"price":75000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"ABT0117052-KEI11","featured_media":{"alt":null,"id":25982017372259,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/27deebf61eac666356ad8525f1f317073106a34b.webp?v=1756689966"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658347085923,"title":"Sage Green","option1":"Sage Green","option2":null,"option3":null,"sku":"ABT01170P2-KEI11","requires_shipping":true,"taxable":true,"featured_image":{"id":34409702785123,"product_id":7873215561827,"position":6,"created_at":"2025-09-01T09:26:05+08:00","updated_at":"2025-09-01T09:26:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130f8f36876cf487555fb0bfbf23ac4e6dd49cab.webp?v=1756689967","variant_ids":[43658347085923]},"available":true,"name":"AirPods 2 AirPods Case Keigo Smiling Sloth - Sage Green","public_title":"Sage Green","options":["Sage Green"],"price":75000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"ABT01170P2-KEI11","featured_media":{"alt":null,"id":25982017798243,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130f8f36876cf487555fb0bfbf23ac4e6dd49cab.webp?v=1756689967"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658347151459,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"ABT0117057-KEI11","requires_shipping":true,"taxable":true,"featured_image":{"id":34409701998691,"product_id":7873215561827,"position":2,"created_at":"2025-09-01T09:26:02+08:00","updated_at":"2025-09-01T09:26:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/753ad9adeb4a03b556fb59a104804797fb8d7cde.webp?v=1756689964","variant_ids":[43658347151459]},"available":true,"name":"AirPods 2 AirPods Case Keigo Smiling Sloth - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":75000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"ABT0117057-KEI11","featured_media":{"alt":null,"id":25982017011811,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/753ad9adeb4a03b556fb59a104804797fb8d7cde.webp?v=1756689964"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8374d3ab3ef0004cb8f51e2d67d50af1b25d6c60.webp?v=1756689963","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/753ad9adeb4a03b556fb59a104804797fb8d7cde.webp?v=1756689964","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f05e557478f7f57fdd540611253b87b6c1b5d15b.webp?v=1756689965","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/27deebf61eac666356ad8525f1f317073106a34b.webp?v=1756689966","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17c931821a4754152d070c3952fbb1800281f20e.webp?v=1756689967","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130f8f36876cf487555fb0bfbf23ac4e6dd49cab.webp?v=1756689967","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78ff6a71824c8883e9ffd812c8f872ca9411bfd3.webp?v=1756689968"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8374d3ab3ef0004cb8f51e2d67d50af1b25d6c60.webp?v=1756689963","options":["color"],"media":[{"alt":null,"id":25982016880739,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8374d3ab3ef0004cb8f51e2d67d50af1b25d6c60.webp?v=1756689963"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8374d3ab3ef0004cb8f51e2d67d50af1b25d6c60.webp?v=1756689963","width":2000},{"alt":null,"id":25982017011811,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/753ad9adeb4a03b556fb59a104804797fb8d7cde.webp?v=1756689964"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/753ad9adeb4a03b556fb59a104804797fb8d7cde.webp?v=1756689964","width":2000},{"alt":null,"id":25982017208419,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f05e557478f7f57fdd540611253b87b6c1b5d15b.webp?v=1756689965"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f05e557478f7f57fdd540611253b87b6c1b5d15b.webp?v=1756689965","width":2000},{"alt":null,"id":25982017372259,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/27deebf61eac666356ad8525f1f317073106a34b.webp?v=1756689966"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/27deebf61eac666356ad8525f1f317073106a34b.webp?v=1756689966","width":2000},{"alt":null,"id":25982017601635,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17c931821a4754152d070c3952fbb1800281f20e.webp?v=1756689967"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17c931821a4754152d070c3952fbb1800281f20e.webp?v=1756689967","width":2000},{"alt":null,"id":25982017798243,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130f8f36876cf487555fb0bfbf23ac4e6dd49cab.webp?v=1756689967"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130f8f36876cf487555fb0bfbf23ac4e6dd49cab.webp?v=1756689967","width":2000},{"alt":null,"id":25982017994851,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78ff6a71824c8883e9ffd812c8f872ca9411bfd3.webp?v=1756689968"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78ff6a71824c8883e9ffd812c8f872ca9411bfd3.webp?v=1756689968","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43658344988771,"title":"Violet","option1":"Violet","option2":null,"option3":null,"sku":"ABT01170P1-KEI11","requires_shipping":true,"taxable":true,"featured_image":{"id":34409702981731,"product_id":7873215561827,"position":7,"created_at":"2025-09-01T09:26:06+08:00","updated_at":"2025-09-01T09:26:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78ff6a71824c8883e9ffd812c8f872ca9411bfd3.webp?v=1756689968","variant_ids":[43658344988771]},"available":true,"name":"AirPods 2 AirPods Case Keigo Smiling Sloth - Violet","public_title":"Violet","options":["Violet"],"price":75000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"ABT01170P1-KEI11","featured_media":{"alt":null,"id":25982017994851,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78ff6a71824c8883e9ffd812c8f872ca9411bfd3.webp?v=1756689968"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658346987619,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"ABT01170O9-KEI11","requires_shipping":true,"taxable":true,"featured_image":{"id":34409702588515,"product_id":7873215561827,"position":5,"created_at":"2025-09-01T09:26:04+08:00","updated_at":"2025-09-01T09:26:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17c931821a4754152d070c3952fbb1800281f20e.webp?v=1756689967","variant_ids":[43658346987619]},"available":true,"name":"AirPods 2 AirPods Case Keigo Smiling Sloth - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":75000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"ABT01170O9-KEI11","featured_media":{"alt":null,"id":25982017601635,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17c931821a4754152d070c3952fbb1800281f20e.webp?v=1756689967"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658347020387,"title":"Transparent","option1":"Transparent","option2":null,"option3":null,"sku":"ABT01170R4-KEI11","requires_shipping":true,"taxable":true,"featured_image":{"id":34409702195299,"product_id":7873215561827,"position":3,"created_at":"2025-09-01T09:26:03+08:00","updated_at":"2025-09-01T09:26:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f05e557478f7f57fdd540611253b87b6c1b5d15b.webp?v=1756689965","variant_ids":[43658347020387]},"available":true,"name":"AirPods 2 AirPods Case Keigo Smiling Sloth - Transparent","public_title":"Transparent","options":["Transparent"],"price":75000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"ABT01170R4-KEI11","featured_media":{"alt":null,"id":25982017208419,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f05e557478f7f57fdd540611253b87b6c1b5d15b.webp?v=1756689965"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658347053155,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"ABT0117052-KEI11","requires_shipping":true,"taxable":true,"featured_image":{"id":34409702359139,"product_id":7873215561827,"position":4,"created_at":"2025-09-01T09:26:04+08:00","updated_at":"2025-09-01T09:26:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/27deebf61eac666356ad8525f1f317073106a34b.webp?v=1756689966","variant_ids":[43658347053155]},"available":true,"name":"AirPods 2 AirPods Case Keigo Smiling Sloth - Black","public_title":"Black","options":["Black"],"price":75000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"ABT0117052-KEI11","featured_media":{"alt":null,"id":25982017372259,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/27deebf61eac666356ad8525f1f317073106a34b.webp?v=1756689966"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658347085923,"title":"Sage Green","option1":"Sage Green","option2":null,"option3":null,"sku":"ABT01170P2-KEI11","requires_shipping":true,"taxable":true,"featured_image":{"id":34409702785123,"product_id":7873215561827,"position":6,"created_at":"2025-09-01T09:26:05+08:00","updated_at":"2025-09-01T09:26:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130f8f36876cf487555fb0bfbf23ac4e6dd49cab.webp?v=1756689967","variant_ids":[43658347085923]},"available":true,"name":"AirPods 2 AirPods Case Keigo Smiling Sloth - Sage Green","public_title":"Sage Green","options":["Sage Green"],"price":75000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"ABT01170P2-KEI11","featured_media":{"alt":null,"id":25982017798243,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/130f8f36876cf487555fb0bfbf23ac4e6dd49cab.webp?v=1756689967"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658347151459,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"ABT0117057-KEI11","requires_shipping":true,"taxable":true,"featured_image":{"id":34409701998691,"product_id":7873215561827,"position":2,"created_at":"2025-09-01T09:26:02+08:00","updated_at":"2025-09-01T09:26:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/753ad9adeb4a03b556fb59a104804797fb8d7cde.webp?v=1756689964","variant_ids":[43658347151459]},"available":true,"name":"AirPods 2 AirPods Case Keigo Smiling Sloth - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":75000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"ABT0117057-KEI11","featured_media":{"alt":null,"id":25982017011811,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/753ad9adeb4a03b556fb59a104804797fb8d7cde.webp?v=1756689964"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43658344988771,"title":"Violet","option1":"Violet","option2":null,"option3":null,"sku":"ABT01170P1-KEI11","requires_shipping":true,"taxable":true,"featured_image":{"id":34409702981731,"product_id":7873215561827,"position":7,"created_at":"2025-09-01T09:26:06+08:00","updated_at":"2025-09-01T09:26:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78ff6a71824c8883e9ffd812c8f872ca9411bfd3.webp?v=1756689968","variant_ids":[43658344988771]},"available":true,"name":"AirPods 2 AirPods Case Keigo Smiling Sloth - Violet","public_title":"Violet","options":["Violet"],"price":75000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"ABT01170P1-KEI11","featured_media":{"alt":null,"id":25982017994851,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78ff6a71824c8883e9ffd812c8f872ca9411bfd3.webp?v=1756689968"}},"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: "停產"
}