$product = {"id":7911169228899,"title":"iPhone 12 mini SolidSuit PosterLad BE YOU","handle":"iphone-12-mini-solidsuit-classic-pos11","description":null,"published_at":"2025-11-05T10:53:07+08:00","created_at":"2025-11-04T10:26:56+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-posterlad","device-iPhone 12 Mini","merge","reseller-posterlad"],"price":83000,"price_min":83000,"price_max":83000,"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":43811848749155,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-POS11","requires_shipping":true,"taxable":true,"featured_image":{"id":36403568115811,"product_id":7911169228899,"position":13,"created_at":"2026-07-27T16:37:15+08:00","updated_at":"2026-07-27T16:37:17+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fda417062252aef945543caf62b55c870af70ff0_dde27aae-383a-419e-a406-061bdd4179ae.webp?v=1785141437","variant_ids":[43811848749155]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad BE YOU - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118452-POS11","featured_media":{"alt":null,"id":27907176071267,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fda417062252aef945543caf62b55c870af70ff0_dde27aae-383a-419e-a406-061bdd4179ae.webp?v=1785141437"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811848814691,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"SST011840B-POS11","requires_shipping":true,"taxable":true,"featured_image":{"id":36403567755363,"product_id":7911169228899,"position":12,"created_at":"2026-07-27T16:37:12+08:00","updated_at":"2026-07-27T16:37:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eadc1fd6def959ef1a9996ea8fc9a66a4c107e3_39691acf-e794-42ce-b5d5-b9b668b09246.webp?v=1785141434","variant_ids":[43811848814691]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad BE YOU - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST011840B-POS11","featured_media":{"alt":null,"id":27907175809123,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eadc1fd6def959ef1a9996ea8fc9a66a4c107e3_39691acf-e794-42ce-b5d5-b9b668b09246.webp?v=1785141434"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811848912995,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"SST01184O9-POS11","requires_shipping":true,"taxable":true,"featured_image":{"id":36403568476259,"product_id":7911169228899,"position":14,"created_at":"2026-07-27T16:37:19+08:00","updated_at":"2026-07-27T16:37:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/176f15ffd0168957bd26facf5f9137c5589d8a8c_451b56ea-b911-432d-affa-2baf703dbc9e.webp?v=1785141440","variant_ids":[43811848912995]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad BE YOU - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01184O9-POS11","featured_media":{"alt":null,"id":27907176497251,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/176f15ffd0168957bd26facf5f9137c5589d8a8c_451b56ea-b911-432d-affa-2baf703dbc9e.webp?v=1785141440"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/176f15ffd0168957bd26facf5f9137c5589d8a8c.webp?v=1762223220","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2b5d6334f708e6f4f6ca72fdd7649aae0798036.webp?v=1762223222","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e95c4c37484b6a7b4d66a370caa0adb495f9b28.webp?v=1762223222","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fda417062252aef945543caf62b55c870af70ff0.webp?v=1762223223","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76edef032a522779ab7401ed50b43e34719006c0.webp?v=1762223224","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1cdd8f23ecf3eda0865e71fe41a3758effea79f.webp?v=1762223224","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48eba77d3a40770b4814d464a534599baeffb202.webp?v=1762223226","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90515216ef1e8292f650f3aa5c96c0d43f4358b3.webp?v=1762223228","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eadc1fd6def959ef1a9996ea8fc9a66a4c107e3.webp?v=1762223229","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76edef032a522779ab7401ed50b43e34719006c0_a192c0ba-aa80-4f7f-b138-f16c76517dd4.webp?v=1785141429","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90515216ef1e8292f650f3aa5c96c0d43f4358b3_fe020b51-4b2b-4a2b-95d1-80e38ba024dc.webp?v=1785141431","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eadc1fd6def959ef1a9996ea8fc9a66a4c107e3_39691acf-e794-42ce-b5d5-b9b668b09246.webp?v=1785141434","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fda417062252aef945543caf62b55c870af70ff0_dde27aae-383a-419e-a406-061bdd4179ae.webp?v=1785141437","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/176f15ffd0168957bd26facf5f9137c5589d8a8c_451b56ea-b911-432d-affa-2baf703dbc9e.webp?v=1785141440","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48eba77d3a40770b4814d464a534599baeffb202_84ead9d5-0214-4cf8-8163-b74c09a1785f.webp?v=1785141442"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/176f15ffd0168957bd26facf5f9137c5589d8a8c.webp?v=1762223220","options":["color"],"media":[{"alt":null,"id":26296840061027,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/176f15ffd0168957bd26facf5f9137c5589d8a8c.webp?v=1762223220"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/176f15ffd0168957bd26facf5f9137c5589d8a8c.webp?v=1762223220","width":2000},{"alt":null,"id":26296840454243,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2b5d6334f708e6f4f6ca72fdd7649aae0798036.webp?v=1762223222"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2b5d6334f708e6f4f6ca72fdd7649aae0798036.webp?v=1762223222","width":2000},{"alt":null,"id":26296840847459,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e95c4c37484b6a7b4d66a370caa0adb495f9b28.webp?v=1762223222"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e95c4c37484b6a7b4d66a370caa0adb495f9b28.webp?v=1762223222","width":2000},{"alt":null,"id":26296841175139,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fda417062252aef945543caf62b55c870af70ff0.webp?v=1762223223"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fda417062252aef945543caf62b55c870af70ff0.webp?v=1762223223","width":2000},{"alt":null,"id":26296841470051,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76edef032a522779ab7401ed50b43e34719006c0.webp?v=1762223224"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76edef032a522779ab7401ed50b43e34719006c0.webp?v=1762223224","width":2000},{"alt":null,"id":26296841896035,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1cdd8f23ecf3eda0865e71fe41a3758effea79f.webp?v=1762223224"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1cdd8f23ecf3eda0865e71fe41a3758effea79f.webp?v=1762223224","width":2000},{"alt":null,"id":26296842125411,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48eba77d3a40770b4814d464a534599baeffb202.webp?v=1762223226"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48eba77d3a40770b4814d464a534599baeffb202.webp?v=1762223226","width":2000},{"alt":null,"id":26296842387555,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90515216ef1e8292f650f3aa5c96c0d43f4358b3.webp?v=1762223228"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90515216ef1e8292f650f3aa5c96c0d43f4358b3.webp?v=1762223228","width":2000},{"alt":null,"id":26296842584163,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eadc1fd6def959ef1a9996ea8fc9a66a4c107e3.webp?v=1762223229"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eadc1fd6def959ef1a9996ea8fc9a66a4c107e3.webp?v=1762223229","width":2000},{"alt":null,"id":27907174695011,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76edef032a522779ab7401ed50b43e34719006c0_a192c0ba-aa80-4f7f-b138-f16c76517dd4.webp?v=1785141429"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76edef032a522779ab7401ed50b43e34719006c0_a192c0ba-aa80-4f7f-b138-f16c76517dd4.webp?v=1785141429","width":2000},{"alt":null,"id":27907175317603,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90515216ef1e8292f650f3aa5c96c0d43f4358b3_fe020b51-4b2b-4a2b-95d1-80e38ba024dc.webp?v=1785141431"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90515216ef1e8292f650f3aa5c96c0d43f4358b3_fe020b51-4b2b-4a2b-95d1-80e38ba024dc.webp?v=1785141431","width":2000},{"alt":null,"id":27907175809123,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eadc1fd6def959ef1a9996ea8fc9a66a4c107e3_39691acf-e794-42ce-b5d5-b9b668b09246.webp?v=1785141434"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eadc1fd6def959ef1a9996ea8fc9a66a4c107e3_39691acf-e794-42ce-b5d5-b9b668b09246.webp?v=1785141434","width":2000},{"alt":null,"id":27907176071267,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fda417062252aef945543caf62b55c870af70ff0_dde27aae-383a-419e-a406-061bdd4179ae.webp?v=1785141437"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fda417062252aef945543caf62b55c870af70ff0_dde27aae-383a-419e-a406-061bdd4179ae.webp?v=1785141437","width":2000},{"alt":null,"id":27907176497251,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/176f15ffd0168957bd26facf5f9137c5589d8a8c_451b56ea-b911-432d-affa-2baf703dbc9e.webp?v=1785141440"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/176f15ffd0168957bd26facf5f9137c5589d8a8c_451b56ea-b911-432d-affa-2baf703dbc9e.webp?v=1785141440","width":2000},{"alt":null,"id":27907176759395,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48eba77d3a40770b4814d464a534599baeffb202_84ead9d5-0214-4cf8-8163-b74c09a1785f.webp?v=1785141442"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48eba77d3a40770b4814d464a534599baeffb202_84ead9d5-0214-4cf8-8163-b74c09a1785f.webp?v=1785141442","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43811848749155,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-POS11","requires_shipping":true,"taxable":true,"featured_image":{"id":36403568115811,"product_id":7911169228899,"position":13,"created_at":"2026-07-27T16:37:15+08:00","updated_at":"2026-07-27T16:37:17+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fda417062252aef945543caf62b55c870af70ff0_dde27aae-383a-419e-a406-061bdd4179ae.webp?v=1785141437","variant_ids":[43811848749155]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad BE YOU - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118452-POS11","featured_media":{"alt":null,"id":27907176071267,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fda417062252aef945543caf62b55c870af70ff0_dde27aae-383a-419e-a406-061bdd4179ae.webp?v=1785141437"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811848814691,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"SST011840B-POS11","requires_shipping":true,"taxable":true,"featured_image":{"id":36403567755363,"product_id":7911169228899,"position":12,"created_at":"2026-07-27T16:37:12+08:00","updated_at":"2026-07-27T16:37:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eadc1fd6def959ef1a9996ea8fc9a66a4c107e3_39691acf-e794-42ce-b5d5-b9b668b09246.webp?v=1785141434","variant_ids":[43811848814691]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad BE YOU - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST011840B-POS11","featured_media":{"alt":null,"id":27907175809123,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6eadc1fd6def959ef1a9996ea8fc9a66a4c107e3_39691acf-e794-42ce-b5d5-b9b668b09246.webp?v=1785141434"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811848912995,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"SST01184O9-POS11","requires_shipping":true,"taxable":true,"featured_image":{"id":36403568476259,"product_id":7911169228899,"position":14,"created_at":"2026-07-27T16:37:19+08:00","updated_at":"2026-07-27T16:37:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/176f15ffd0168957bd26facf5f9137c5589d8a8c_451b56ea-b911-432d-affa-2baf703dbc9e.webp?v=1785141440","variant_ids":[43811848912995]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad BE YOU - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01184O9-POS11","featured_media":{"alt":null,"id":27907176497251,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/176f15ffd0168957bd26facf5f9137c5589d8a8c_451b56ea-b911-432d-affa-2baf703dbc9e.webp?v=1785141440"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43811848749155,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-POS11","requires_shipping":true,"taxable":true,"featured_image":{"id":36403568115811,"product_id":7911169228899,"position":13,"created_at":"2026-07-27T16:37:15+08:00","updated_at":"2026-07-27T16:37:17+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fda417062252aef945543caf62b55c870af70ff0_dde27aae-383a-419e-a406-061bdd4179ae.webp?v=1785141437","variant_ids":[43811848749155]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad BE YOU - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118452-POS11","featured_media":{"alt":null,"id":27907176071267,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fda417062252aef945543caf62b55c870af70ff0_dde27aae-383a-419e-a406-061bdd4179ae.webp?v=1785141437"}},"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: "停產"
}