$product = {"id":7823784968291,"title":"iPhone 15 Pro Max SolidX 貓貓蟲咖波 咖波漂浮星球","handle":"iphone-15-pro-max-solidx-fa35","description":null,"published_at":"2025-07-01T19:16:52+08:00","created_at":"2025-06-20T10:25:09+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-bugcat-capoo","device-iPhone 15 Pro Max","merge","reseller-bugcat-capoo"],"price":125000,"price_min":125000,"price_max":125000,"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":43473004593251,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-FA35","requires_shipping":true,"taxable":true,"featured_image":{"id":35581779017827,"product_id":7823784968291,"position":11,"created_at":"2026-04-02T15:17:52+08:00","updated_at":"2026-04-02T15:17:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8d32a8bd9a715c2be0f8b8e1e6d53a8bf910ac6.webp?v=1775114274","variant_ids":[43473004593251]},"available":true,"name":"iPhone 15 Pro Max SolidX 貓貓蟲咖波 咖波漂浮星球 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-FA35","featured_media":{"alt":null,"id":27114399006819,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8d32a8bd9a715c2be0f8b8e1e6d53a8bf910ac6.webp?v=1775114274"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473007673443,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-FA35","requires_shipping":true,"taxable":true,"featured_image":{"id":35581777641571,"product_id":7823784968291,"position":4,"created_at":"2026-04-02T15:17:48+08:00","updated_at":"2026-04-02T15:17:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca9d2ef0e6da5bb06d7046cb4d4983ce7d5beb45.webp?v=1775114270","variant_ids":[43473007673443]},"available":true,"name":"iPhone 15 Pro Max SolidX 貓貓蟲咖波 咖波漂浮星球 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129853-FA35","featured_media":{"alt":null,"id":27114397565027,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca9d2ef0e6da5bb06d7046cb4d4983ce7d5beb45.webp?v=1775114270"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473007771747,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-FA35","requires_shipping":true,"taxable":true,"featured_image":{"id":35581777772643,"product_id":7823784968291,"position":5,"created_at":"2026-04-02T15:17:49+08:00","updated_at":"2026-04-02T15:17:51+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3bcb8bc7822481b7f00ba422487c59ad43cb250e.webp?v=1775114271","variant_ids":[43473007771747]},"available":true,"name":"iPhone 15 Pro Max SolidX 貓貓蟲咖波 咖波漂浮星球 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298O8-FA35","featured_media":{"alt":null,"id":27114397696099,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3bcb8bc7822481b7f00ba422487c59ad43cb250e.webp?v=1775114271"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473007804515,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-FA35","requires_shipping":true,"taxable":true,"featured_image":{"id":35581778329699,"product_id":7823784968291,"position":8,"created_at":"2026-04-02T15:17:50+08:00","updated_at":"2026-04-02T15:17:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d8422f4c1a4e74fc5894848c92536c9323ec5f8.webp?v=1775114273","variant_ids":[43473007804515]},"available":true,"name":"iPhone 15 Pro Max SolidX 貓貓蟲咖波 咖波漂浮星球 - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-FA35","featured_media":{"alt":null,"id":27114398318691,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d8422f4c1a4e74fc5894848c92536c9323ec5f8.webp?v=1775114273"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43494109610083,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-FA35","requires_shipping":true,"taxable":true,"featured_image":{"id":35581778591843,"product_id":7823784968291,"position":9,"created_at":"2026-04-02T15:17:51+08:00","updated_at":"2026-04-02T15:17:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a3f7ec4115d0eb2a1f19cb5b2319aa77ec11c1e.webp?v=1775114273","variant_ids":[43494109610083]},"available":true,"name":"iPhone 15 Pro Max SolidX 貓貓蟲咖波 咖波漂浮星球 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129857-FA35","featured_media":{"alt":null,"id":27114398548067,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a3f7ec4115d0eb2a1f19cb5b2319aa77ec11c1e.webp?v=1775114273"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-FA35.png?v=1750386312","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-FA35_e126a50a-a751-4eaa-ac99-bc748f9dbaaa.png?v=1750831594","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad008841b1d880ae66647d5ce894fc87ee189a97.webp?v=1775114270","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca9d2ef0e6da5bb06d7046cb4d4983ce7d5beb45.webp?v=1775114270","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3bcb8bc7822481b7f00ba422487c59ad43cb250e.webp?v=1775114271","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ed693f6288d4995f48e4f99bd2077ba88d7d76.webp?v=1775114271","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/829754de325bd1b06c436a50b23e8402ff7aeb8f.webp?v=1775114272","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d8422f4c1a4e74fc5894848c92536c9323ec5f8.webp?v=1775114273","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a3f7ec4115d0eb2a1f19cb5b2319aa77ec11c1e.webp?v=1775114273","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53aa28380fe98817050cbf33768d9379abfa75bc.webp?v=1775114274","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8d32a8bd9a715c2be0f8b8e1e6d53a8bf910ac6.webp?v=1775114274"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-FA35.png?v=1750386312","options":["color"],"media":[{"alt":null,"id":25720343658595,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-FA35.png?v=1750386312"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-FA35.png?v=1750386312","width":2000},{"alt":null,"id":25736219787363,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-FA35_e126a50a-a751-4eaa-ac99-bc748f9dbaaa.png?v=1750831594"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-FA35_e126a50a-a751-4eaa-ac99-bc748f9dbaaa.png?v=1750831594","width":2000},{"alt":null,"id":27114397335651,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad008841b1d880ae66647d5ce894fc87ee189a97.webp?v=1775114270"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad008841b1d880ae66647d5ce894fc87ee189a97.webp?v=1775114270","width":2000},{"alt":null,"id":27114397565027,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca9d2ef0e6da5bb06d7046cb4d4983ce7d5beb45.webp?v=1775114270"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca9d2ef0e6da5bb06d7046cb4d4983ce7d5beb45.webp?v=1775114270","width":2000},{"alt":null,"id":27114397696099,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3bcb8bc7822481b7f00ba422487c59ad43cb250e.webp?v=1775114271"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3bcb8bc7822481b7f00ba422487c59ad43cb250e.webp?v=1775114271","width":2000},{"alt":null,"id":27114397958243,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ed693f6288d4995f48e4f99bd2077ba88d7d76.webp?v=1775114271"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ed693f6288d4995f48e4f99bd2077ba88d7d76.webp?v=1775114271","width":2000},{"alt":null,"id":27114398154851,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/829754de325bd1b06c436a50b23e8402ff7aeb8f.webp?v=1775114272"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/829754de325bd1b06c436a50b23e8402ff7aeb8f.webp?v=1775114272","width":2000},{"alt":null,"id":27114398318691,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d8422f4c1a4e74fc5894848c92536c9323ec5f8.webp?v=1775114273"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d8422f4c1a4e74fc5894848c92536c9323ec5f8.webp?v=1775114273","width":2000},{"alt":null,"id":27114398548067,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a3f7ec4115d0eb2a1f19cb5b2319aa77ec11c1e.webp?v=1775114273"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a3f7ec4115d0eb2a1f19cb5b2319aa77ec11c1e.webp?v=1775114273","width":2000},{"alt":null,"id":27114398711907,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53aa28380fe98817050cbf33768d9379abfa75bc.webp?v=1775114274"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53aa28380fe98817050cbf33768d9379abfa75bc.webp?v=1775114274","width":2000},{"alt":null,"id":27114399006819,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8d32a8bd9a715c2be0f8b8e1e6d53a8bf910ac6.webp?v=1775114274"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8d32a8bd9a715c2be0f8b8e1e6d53a8bf910ac6.webp?v=1775114274","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43473004593251,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-FA35","requires_shipping":true,"taxable":true,"featured_image":{"id":35581779017827,"product_id":7823784968291,"position":11,"created_at":"2026-04-02T15:17:52+08:00","updated_at":"2026-04-02T15:17:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8d32a8bd9a715c2be0f8b8e1e6d53a8bf910ac6.webp?v=1775114274","variant_ids":[43473004593251]},"available":true,"name":"iPhone 15 Pro Max SolidX 貓貓蟲咖波 咖波漂浮星球 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-FA35","featured_media":{"alt":null,"id":27114399006819,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8d32a8bd9a715c2be0f8b8e1e6d53a8bf910ac6.webp?v=1775114274"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473007673443,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-FA35","requires_shipping":true,"taxable":true,"featured_image":{"id":35581777641571,"product_id":7823784968291,"position":4,"created_at":"2026-04-02T15:17:48+08:00","updated_at":"2026-04-02T15:17:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca9d2ef0e6da5bb06d7046cb4d4983ce7d5beb45.webp?v=1775114270","variant_ids":[43473007673443]},"available":true,"name":"iPhone 15 Pro Max SolidX 貓貓蟲咖波 咖波漂浮星球 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129853-FA35","featured_media":{"alt":null,"id":27114397565027,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ca9d2ef0e6da5bb06d7046cb4d4983ce7d5beb45.webp?v=1775114270"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473007771747,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-FA35","requires_shipping":true,"taxable":true,"featured_image":{"id":35581777772643,"product_id":7823784968291,"position":5,"created_at":"2026-04-02T15:17:49+08:00","updated_at":"2026-04-02T15:17:51+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3bcb8bc7822481b7f00ba422487c59ad43cb250e.webp?v=1775114271","variant_ids":[43473007771747]},"available":true,"name":"iPhone 15 Pro Max SolidX 貓貓蟲咖波 咖波漂浮星球 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298O8-FA35","featured_media":{"alt":null,"id":27114397696099,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3bcb8bc7822481b7f00ba422487c59ad43cb250e.webp?v=1775114271"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473007804515,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-FA35","requires_shipping":true,"taxable":true,"featured_image":{"id":35581778329699,"product_id":7823784968291,"position":8,"created_at":"2026-04-02T15:17:50+08:00","updated_at":"2026-04-02T15:17:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d8422f4c1a4e74fc5894848c92536c9323ec5f8.webp?v=1775114273","variant_ids":[43473007804515]},"available":true,"name":"iPhone 15 Pro Max SolidX 貓貓蟲咖波 咖波漂浮星球 - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-FA35","featured_media":{"alt":null,"id":27114398318691,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d8422f4c1a4e74fc5894848c92536c9323ec5f8.webp?v=1775114273"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43494109610083,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-FA35","requires_shipping":true,"taxable":true,"featured_image":{"id":35581778591843,"product_id":7823784968291,"position":9,"created_at":"2026-04-02T15:17:51+08:00","updated_at":"2026-04-02T15:17:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a3f7ec4115d0eb2a1f19cb5b2319aa77ec11c1e.webp?v=1775114273","variant_ids":[43494109610083]},"available":true,"name":"iPhone 15 Pro Max SolidX 貓貓蟲咖波 咖波漂浮星球 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129857-FA35","featured_media":{"alt":null,"id":27114398548067,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a3f7ec4115d0eb2a1f19cb5b2319aa77ec11c1e.webp?v=1775114273"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43473004593251,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-FA35","requires_shipping":true,"taxable":true,"featured_image":{"id":35581779017827,"product_id":7823784968291,"position":11,"created_at":"2026-04-02T15:17:52+08:00","updated_at":"2026-04-02T15:17:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8d32a8bd9a715c2be0f8b8e1e6d53a8bf910ac6.webp?v=1775114274","variant_ids":[43473004593251]},"available":true,"name":"iPhone 15 Pro Max SolidX 貓貓蟲咖波 咖波漂浮星球 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-FA35","featured_media":{"alt":null,"id":27114399006819,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c8d32a8bd9a715c2be0f8b8e1e6d53a8bf910ac6.webp?v=1775114274"}},"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: "停產"
}