$product = {"id":7938007302243,"title":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan Q版角色大集合","handle":"iphone-12-mini-solidsuit-classic-xw01","description":null,"published_at":"2025-12-12T10:14:58+08:00","created_at":"2025-12-11T16:40:57+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-attack-on-titan","device-iPhone 12 Mini","merge","reseller-attack-on-titan"],"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":43884746440803,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"SST011840B-XW01","requires_shipping":true,"taxable":true,"featured_image":{"id":36226918744163,"product_id":7938007302243,"position":11,"created_at":"2026-07-09T11:21:44+08:00","updated_at":"2026-07-09T11:21:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e0420ce9feb57ddf41dff7010eb6215bdd8af81_f4e231b7-7492-49b0-84ea-a9baa808767d.webp?v=1783567307","variant_ids":[43884746440803]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan Q版角色大集合 - 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-XW01","featured_media":{"alt":null,"id":27731703562339,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e0420ce9feb57ddf41dff7010eb6215bdd8af81_f4e231b7-7492-49b0-84ea-a9baa808767d.webp?v=1783567307"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884746473571,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"SST01184O9-XW01","requires_shipping":true,"taxable":true,"featured_image":{"id":36226919661667,"product_id":7938007302243,"position":12,"created_at":"2026-07-09T11:21:45+08:00","updated_at":"2026-07-09T11:21:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d124ed3dd757fdcf81525305fef28275c3630b1_ed3e3c6f-68df-4acf-8f74-3ffa91485264.webp?v=1783567308","variant_ids":[43884746473571]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan Q版角色大集合 - 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-XW01","featured_media":{"alt":null,"id":27731704512611,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d124ed3dd757fdcf81525305fef28275c3630b1_ed3e3c6f-68df-4acf-8f74-3ffa91485264.webp?v=1783567308"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884746571875,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-XW01","requires_shipping":true,"taxable":true,"featured_image":{"id":36226921136227,"product_id":7938007302243,"position":14,"created_at":"2026-07-09T11:21:47+08:00","updated_at":"2026-07-09T11:21:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a68c3fe128846f136443446f43e8de68b63ef6f_2652c3f5-12a6-491d-84db-6f252b1ae083.webp?v=1783567309","variant_ids":[43884746571875]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan Q版角色大集合 - 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-XW01","featured_media":{"alt":null,"id":27731705954403,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a68c3fe128846f136443446f43e8de68b63ef6f_2652c3f5-12a6-491d-84db-6f252b1ae083.webp?v=1783567309"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/caa8aeffdafd952bf7384df0f79a2e20deb8b160.webp?v=1765442464","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/133136f3487a48a39d7b7a029da9f820451fbbf5.webp?v=1765442465","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f23666fa8a76b57fa9b1f7df36352646da4b73e9.webp?v=1765442465","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d124ed3dd757fdcf81525305fef28275c3630b1.webp?v=1765442465","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2714617fa2aa909f5b7f4884bf7f88a7ad13a3df.webp?v=1765442466","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a68c3fe128846f136443446f43e8de68b63ef6f.webp?v=1765442467","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/641d5222598b2a6eb75c46e5ff767b73ef5cabb5.webp?v=1765442467","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66e3d7d507e0e559972f2697fb564585b3472244.webp?v=1765442467","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e0420ce9feb57ddf41dff7010eb6215bdd8af81.webp?v=1765442468","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2714617fa2aa909f5b7f4884bf7f88a7ad13a3df_1b71de5c-6914-41c0-b2f8-0db752fb68b4.webp?v=1783567305","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e0420ce9feb57ddf41dff7010eb6215bdd8af81_f4e231b7-7492-49b0-84ea-a9baa808767d.webp?v=1783567307","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d124ed3dd757fdcf81525305fef28275c3630b1_ed3e3c6f-68df-4acf-8f74-3ffa91485264.webp?v=1783567308","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/641d5222598b2a6eb75c46e5ff767b73ef5cabb5_c71ca87b-d719-46a4-bade-70cbbe21fbb6.webp?v=1783567308","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a68c3fe128846f136443446f43e8de68b63ef6f_2652c3f5-12a6-491d-84db-6f252b1ae083.webp?v=1783567309","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/caa8aeffdafd952bf7384df0f79a2e20deb8b160_d6c5a708-0bb1-4d71-9ef2-26135f26d97e.webp?v=1783567310"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/caa8aeffdafd952bf7384df0f79a2e20deb8b160.webp?v=1765442464","options":["color"],"media":[{"alt":null,"id":26495841042531,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/caa8aeffdafd952bf7384df0f79a2e20deb8b160.webp?v=1765442464"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/caa8aeffdafd952bf7384df0f79a2e20deb8b160.webp?v=1765442464","width":2000},{"alt":null,"id":26495841304675,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/133136f3487a48a39d7b7a029da9f820451fbbf5.webp?v=1765442465"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/133136f3487a48a39d7b7a029da9f820451fbbf5.webp?v=1765442465","width":2000},{"alt":null,"id":26495841599587,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f23666fa8a76b57fa9b1f7df36352646da4b73e9.webp?v=1765442465"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f23666fa8a76b57fa9b1f7df36352646da4b73e9.webp?v=1765442465","width":2000},{"alt":null,"id":26495841861731,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d124ed3dd757fdcf81525305fef28275c3630b1.webp?v=1765442465"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d124ed3dd757fdcf81525305fef28275c3630b1.webp?v=1765442465","width":2000},{"alt":null,"id":26495842156643,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2714617fa2aa909f5b7f4884bf7f88a7ad13a3df.webp?v=1765442466"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2714617fa2aa909f5b7f4884bf7f88a7ad13a3df.webp?v=1765442466","width":2000},{"alt":null,"id":26495842451555,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a68c3fe128846f136443446f43e8de68b63ef6f.webp?v=1765442467"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a68c3fe128846f136443446f43e8de68b63ef6f.webp?v=1765442467","width":2000},{"alt":null,"id":26495842680931,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/641d5222598b2a6eb75c46e5ff767b73ef5cabb5.webp?v=1765442467"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/641d5222598b2a6eb75c46e5ff767b73ef5cabb5.webp?v=1765442467","width":2000},{"alt":null,"id":26495842943075,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66e3d7d507e0e559972f2697fb564585b3472244.webp?v=1765442467"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66e3d7d507e0e559972f2697fb564585b3472244.webp?v=1765442467","width":2000},{"alt":null,"id":26495843106915,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e0420ce9feb57ddf41dff7010eb6215bdd8af81.webp?v=1765442468"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e0420ce9feb57ddf41dff7010eb6215bdd8af81.webp?v=1765442468","width":2000},{"alt":null,"id":27731703136355,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2714617fa2aa909f5b7f4884bf7f88a7ad13a3df_1b71de5c-6914-41c0-b2f8-0db752fb68b4.webp?v=1783567305"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2714617fa2aa909f5b7f4884bf7f88a7ad13a3df_1b71de5c-6914-41c0-b2f8-0db752fb68b4.webp?v=1783567305","width":2000},{"alt":null,"id":27731703562339,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e0420ce9feb57ddf41dff7010eb6215bdd8af81_f4e231b7-7492-49b0-84ea-a9baa808767d.webp?v=1783567307"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e0420ce9feb57ddf41dff7010eb6215bdd8af81_f4e231b7-7492-49b0-84ea-a9baa808767d.webp?v=1783567307","width":2000},{"alt":null,"id":27731704512611,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d124ed3dd757fdcf81525305fef28275c3630b1_ed3e3c6f-68df-4acf-8f74-3ffa91485264.webp?v=1783567308"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d124ed3dd757fdcf81525305fef28275c3630b1_ed3e3c6f-68df-4acf-8f74-3ffa91485264.webp?v=1783567308","width":2000},{"alt":null,"id":27731705364579,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/641d5222598b2a6eb75c46e5ff767b73ef5cabb5_c71ca87b-d719-46a4-bade-70cbbe21fbb6.webp?v=1783567308"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/641d5222598b2a6eb75c46e5ff767b73ef5cabb5_c71ca87b-d719-46a4-bade-70cbbe21fbb6.webp?v=1783567308","width":2000},{"alt":null,"id":27731705954403,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a68c3fe128846f136443446f43e8de68b63ef6f_2652c3f5-12a6-491d-84db-6f252b1ae083.webp?v=1783567309"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a68c3fe128846f136443446f43e8de68b63ef6f_2652c3f5-12a6-491d-84db-6f252b1ae083.webp?v=1783567309","width":2000},{"alt":null,"id":27731706708067,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/caa8aeffdafd952bf7384df0f79a2e20deb8b160_d6c5a708-0bb1-4d71-9ef2-26135f26d97e.webp?v=1783567310"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/caa8aeffdafd952bf7384df0f79a2e20deb8b160_d6c5a708-0bb1-4d71-9ef2-26135f26d97e.webp?v=1783567310","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43884746440803,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"SST011840B-XW01","requires_shipping":true,"taxable":true,"featured_image":{"id":36226918744163,"product_id":7938007302243,"position":11,"created_at":"2026-07-09T11:21:44+08:00","updated_at":"2026-07-09T11:21:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e0420ce9feb57ddf41dff7010eb6215bdd8af81_f4e231b7-7492-49b0-84ea-a9baa808767d.webp?v=1783567307","variant_ids":[43884746440803]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan Q版角色大集合 - 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-XW01","featured_media":{"alt":null,"id":27731703562339,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e0420ce9feb57ddf41dff7010eb6215bdd8af81_f4e231b7-7492-49b0-84ea-a9baa808767d.webp?v=1783567307"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884746473571,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"SST01184O9-XW01","requires_shipping":true,"taxable":true,"featured_image":{"id":36226919661667,"product_id":7938007302243,"position":12,"created_at":"2026-07-09T11:21:45+08:00","updated_at":"2026-07-09T11:21:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d124ed3dd757fdcf81525305fef28275c3630b1_ed3e3c6f-68df-4acf-8f74-3ffa91485264.webp?v=1783567308","variant_ids":[43884746473571]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan Q版角色大集合 - 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-XW01","featured_media":{"alt":null,"id":27731704512611,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d124ed3dd757fdcf81525305fef28275c3630b1_ed3e3c6f-68df-4acf-8f74-3ffa91485264.webp?v=1783567308"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884746571875,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-XW01","requires_shipping":true,"taxable":true,"featured_image":{"id":36226921136227,"product_id":7938007302243,"position":14,"created_at":"2026-07-09T11:21:47+08:00","updated_at":"2026-07-09T11:21:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a68c3fe128846f136443446f43e8de68b63ef6f_2652c3f5-12a6-491d-84db-6f252b1ae083.webp?v=1783567309","variant_ids":[43884746571875]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan Q版角色大集合 - 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-XW01","featured_media":{"alt":null,"id":27731705954403,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a68c3fe128846f136443446f43e8de68b63ef6f_2652c3f5-12a6-491d-84db-6f252b1ae083.webp?v=1783567309"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43884746440803,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"SST011840B-XW01","requires_shipping":true,"taxable":true,"featured_image":{"id":36226918744163,"product_id":7938007302243,"position":11,"created_at":"2026-07-09T11:21:44+08:00","updated_at":"2026-07-09T11:21:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e0420ce9feb57ddf41dff7010eb6215bdd8af81_f4e231b7-7492-49b0-84ea-a9baa808767d.webp?v=1783567307","variant_ids":[43884746440803]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan Q版角色大集合 - 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-XW01","featured_media":{"alt":null,"id":27731703562339,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7e0420ce9feb57ddf41dff7010eb6215bdd8af81_f4e231b7-7492-49b0-84ea-a9baa808767d.webp?v=1783567307"}},"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: "停產"
}