$product = {"id":8004430987363,"title":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者","handle":"iphone-14-plus-solidsuit-classic-magsafe-pb161","description":null,"published_at":"2026-04-28T16:42:54+08:00","created_at":"2026-04-28T15:28:33+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-star-wars","device-iPhone 14 Plus","merge","reseller-star-wars"],"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":44146002264163,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012610F-PB161","requires_shipping":true,"taxable":true,"featured_image":{"id":35722957455459,"product_id":8004430987363,"position":1,"created_at":"2026-04-28T15:28:59+08:00","updated_at":"2026-04-28T15:29:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fd67ac27c98265cdbd1ce78375790a8300cfe2e.webp?v=1777361341","variant_ids":[44146002264163]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者 - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610F-PB161","featured_media":{"alt":null,"id":27249772068963,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fd67ac27c98265cdbd1ce78375790a8300cfe2e.webp?v=1777361341"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44146010423395,"title":"Bordeaux Red","option1":"Bordeaux Red","option2":null,"option3":null,"sku":"MST012610D-PB161","requires_shipping":true,"taxable":true,"featured_image":{"id":35722958274659,"product_id":8004430987363,"position":3,"created_at":"2026-04-28T15:29:00+08:00","updated_at":"2026-04-28T15:29:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50cb2c80d56e73b8bb1f584cee324870d7aebede.webp?v=1777361343","variant_ids":[44146010423395]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者 - Bordeaux Red","public_title":"Bordeaux Red","options":["Bordeaux Red"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610D-PB161","featured_media":{"alt":null,"id":27249772888163,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50cb2c80d56e73b8bb1f584cee324870d7aebede.webp?v=1777361343"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44146010882147,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012610C-PB161","requires_shipping":true,"taxable":true,"featured_image":{"id":35722959126627,"product_id":8004430987363,"position":5,"created_at":"2026-04-28T15:29:02+08:00","updated_at":"2026-04-28T15:29:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a35a9d0c950a5b17a072559e73f3c530afa22970.webp?v=1777361344","variant_ids":[44146010882147]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者 - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610C-PB161","featured_media":{"alt":null,"id":27249773740131,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a35a9d0c950a5b17a072559e73f3c530afa22970.webp?v=1777361344"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44146011177059,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01261O9-PB161","requires_shipping":true,"taxable":true,"featured_image":{"id":35722958831715,"product_id":8004430987363,"position":4,"created_at":"2026-04-28T15:29:01+08:00","updated_at":"2026-04-28T15:29:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/60e0fc9a42424013ac299370f3d9b6e8c18d297c.webp?v=1777361344","variant_ids":[44146011177059]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者 - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01261O9-PB161","featured_media":{"alt":null,"id":27249773412451,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/60e0fc9a42424013ac299370f3d9b6e8c18d297c.webp?v=1777361344"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44146011635811,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"MST0126157-PB161","requires_shipping":true,"taxable":true,"featured_image":{"id":35722957848675,"product_id":8004430987363,"position":2,"created_at":"2026-04-28T15:29:00+08:00","updated_at":"2026-04-28T15:29:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bc5599fc0219c6740530b9763c7f819351f6c87.webp?v=1777361342","variant_ids":[44146011635811]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者 - 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":"MST0126157-PB161","featured_media":{"alt":null,"id":27249772462179,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bc5599fc0219c6740530b9763c7f819351f6c87.webp?v=1777361342"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44146012553315,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0126152-PB161","requires_shipping":true,"taxable":true,"featured_image":{"id":35722960404579,"product_id":8004430987363,"position":6,"created_at":"2026-04-28T15:29:03+08:00","updated_at":"2026-04-28T15:29:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51c0f2cea57d273448ae1249f6136ee4140dd926.webp?v=1777361345","variant_ids":[44146012553315]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126152-PB161","featured_media":{"alt":null,"id":27249774166115,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51c0f2cea57d273448ae1249f6136ee4140dd926.webp?v=1777361345"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fd67ac27c98265cdbd1ce78375790a8300cfe2e.webp?v=1777361341","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bc5599fc0219c6740530b9763c7f819351f6c87.webp?v=1777361342","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50cb2c80d56e73b8bb1f584cee324870d7aebede.webp?v=1777361343","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/60e0fc9a42424013ac299370f3d9b6e8c18d297c.webp?v=1777361344","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a35a9d0c950a5b17a072559e73f3c530afa22970.webp?v=1777361344","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51c0f2cea57d273448ae1249f6136ee4140dd926.webp?v=1777361345"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fd67ac27c98265cdbd1ce78375790a8300cfe2e.webp?v=1777361341","options":["color"],"media":[{"alt":null,"id":27249772068963,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fd67ac27c98265cdbd1ce78375790a8300cfe2e.webp?v=1777361341"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fd67ac27c98265cdbd1ce78375790a8300cfe2e.webp?v=1777361341","width":2000},{"alt":null,"id":27249772462179,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bc5599fc0219c6740530b9763c7f819351f6c87.webp?v=1777361342"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bc5599fc0219c6740530b9763c7f819351f6c87.webp?v=1777361342","width":2000},{"alt":null,"id":27249772888163,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50cb2c80d56e73b8bb1f584cee324870d7aebede.webp?v=1777361343"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50cb2c80d56e73b8bb1f584cee324870d7aebede.webp?v=1777361343","width":2000},{"alt":null,"id":27249773412451,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/60e0fc9a42424013ac299370f3d9b6e8c18d297c.webp?v=1777361344"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/60e0fc9a42424013ac299370f3d9b6e8c18d297c.webp?v=1777361344","width":2000},{"alt":null,"id":27249773740131,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a35a9d0c950a5b17a072559e73f3c530afa22970.webp?v=1777361344"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a35a9d0c950a5b17a072559e73f3c530afa22970.webp?v=1777361344","width":2000},{"alt":null,"id":27249774166115,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51c0f2cea57d273448ae1249f6136ee4140dd926.webp?v=1777361345"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51c0f2cea57d273448ae1249f6136ee4140dd926.webp?v=1777361345","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":44146002264163,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012610F-PB161","requires_shipping":true,"taxable":true,"featured_image":{"id":35722957455459,"product_id":8004430987363,"position":1,"created_at":"2026-04-28T15:28:59+08:00","updated_at":"2026-04-28T15:29:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fd67ac27c98265cdbd1ce78375790a8300cfe2e.webp?v=1777361341","variant_ids":[44146002264163]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者 - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610F-PB161","featured_media":{"alt":null,"id":27249772068963,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fd67ac27c98265cdbd1ce78375790a8300cfe2e.webp?v=1777361341"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44146010423395,"title":"Bordeaux Red","option1":"Bordeaux Red","option2":null,"option3":null,"sku":"MST012610D-PB161","requires_shipping":true,"taxable":true,"featured_image":{"id":35722958274659,"product_id":8004430987363,"position":3,"created_at":"2026-04-28T15:29:00+08:00","updated_at":"2026-04-28T15:29:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50cb2c80d56e73b8bb1f584cee324870d7aebede.webp?v=1777361343","variant_ids":[44146010423395]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者 - Bordeaux Red","public_title":"Bordeaux Red","options":["Bordeaux Red"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610D-PB161","featured_media":{"alt":null,"id":27249772888163,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50cb2c80d56e73b8bb1f584cee324870d7aebede.webp?v=1777361343"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44146010882147,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012610C-PB161","requires_shipping":true,"taxable":true,"featured_image":{"id":35722959126627,"product_id":8004430987363,"position":5,"created_at":"2026-04-28T15:29:02+08:00","updated_at":"2026-04-28T15:29:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a35a9d0c950a5b17a072559e73f3c530afa22970.webp?v=1777361344","variant_ids":[44146010882147]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者 - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610C-PB161","featured_media":{"alt":null,"id":27249773740131,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a35a9d0c950a5b17a072559e73f3c530afa22970.webp?v=1777361344"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44146011177059,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01261O9-PB161","requires_shipping":true,"taxable":true,"featured_image":{"id":35722958831715,"product_id":8004430987363,"position":4,"created_at":"2026-04-28T15:29:01+08:00","updated_at":"2026-04-28T15:29:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/60e0fc9a42424013ac299370f3d9b6e8c18d297c.webp?v=1777361344","variant_ids":[44146011177059]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者 - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01261O9-PB161","featured_media":{"alt":null,"id":27249773412451,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/60e0fc9a42424013ac299370f3d9b6e8c18d297c.webp?v=1777361344"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44146011635811,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"MST0126157-PB161","requires_shipping":true,"taxable":true,"featured_image":{"id":35722957848675,"product_id":8004430987363,"position":2,"created_at":"2026-04-28T15:29:00+08:00","updated_at":"2026-04-28T15:29:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bc5599fc0219c6740530b9763c7f819351f6c87.webp?v=1777361342","variant_ids":[44146011635811]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者 - 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":"MST0126157-PB161","featured_media":{"alt":null,"id":27249772462179,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bc5599fc0219c6740530b9763c7f819351f6c87.webp?v=1777361342"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44146012553315,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0126152-PB161","requires_shipping":true,"taxable":true,"featured_image":{"id":35722960404579,"product_id":8004430987363,"position":6,"created_at":"2026-04-28T15:29:03+08:00","updated_at":"2026-04-28T15:29:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51c0f2cea57d273448ae1249f6136ee4140dd926.webp?v=1777361345","variant_ids":[44146012553315]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126152-PB161","featured_media":{"alt":null,"id":27249774166115,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51c0f2cea57d273448ae1249f6136ee4140dd926.webp?v=1777361345"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":44146002264163,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012610F-PB161","requires_shipping":true,"taxable":true,"featured_image":{"id":35722957455459,"product_id":8004430987363,"position":1,"created_at":"2026-04-28T15:28:59+08:00","updated_at":"2026-04-28T15:29:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fd67ac27c98265cdbd1ce78375790a8300cfe2e.webp?v=1777361341","variant_ids":[44146002264163]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) StarWars 星際大戰 星際大戰 - 路克・天行者 - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610F-PB161","featured_media":{"alt":null,"id":27249772068963,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8fd67ac27c98265cdbd1ce78375790a8300cfe2e.webp?v=1777361341"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}; $device_handle = null; $type = ""; var sellingStatus if ($isMerge) { $(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: "停產" }