Home
›
iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-五條悟
$product = {"id":7920574890083,"title":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-五條悟","handle":"iphone-13-jellytint-ptt12","description":null,"published_at":"2025-11-10T16:28:51+08:00","created_at":"2025-11-10T15:14:23+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-jujutsu-kaisen","device-iPhone 13","merge","reseller-jujutsu-kaisen"],"price":128000,"price_min":128000,"price_max":128000,"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":43829038284899,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012600J-PTT12","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750741603,"product_id":7920574890083,"position":12,"created_at":"2026-06-29T15:21:33+08:00","updated_at":"2026-06-29T15:21:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_33a0d12d-0a10-4b00-b106-926495808069.webp?v=1782717695","variant_ids":[43829038284899]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-五條悟 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600J-PTT12","featured_media":{"alt":null,"id":27629993689187,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_33a0d12d-0a10-4b00-b106-926495808069.webp?v=1782717695"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829039497315,"title":"Cyber Blue","option1":"Cyber Blue","option2":null,"option3":null,"sku":"CCN012600I-PTT12","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750872675,"product_id":7920574890083,"position":13,"created_at":"2026-06-29T15:21:33+08:00","updated_at":"2026-06-29T15:21:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_dc5f4962-df14-42a5-8ef8-f91a0cf61aec.webp?v=1782717695","variant_ids":[43829039497315]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-五條悟 - Cyber Blue","public_title":"Cyber Blue","options":["Cyber Blue"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600I-PTT12","featured_media":{"alt":null,"id":27629993820259,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_dc5f4962-df14-42a5-8ef8-f91a0cf61aec.webp?v=1782717695"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829039530083,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012600G-PTT12","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750479459,"product_id":7920574890083,"position":11,"created_at":"2026-06-29T15:21:32+08:00","updated_at":"2026-06-29T15:21:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_40a511ee-d9e7-4018-a2a4-744a0dc20c18.webp?v=1782717694","variant_ids":[43829039530083]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-五條悟 - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600G-PTT12","featured_media":{"alt":null,"id":27629993427043,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_40a511ee-d9e7-4018-a2a4-744a0dc20c18.webp?v=1782717694"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/994d64ac4cc1f5b12d3b428049a661ede55b6284_05ff75dc-f151-484e-8fab-085a5259e2a0.webp?v=1762758866","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_b733a54a-397b-4a78-b801-39bdbac734a2.webp?v=1762758866","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_7042a41f-026d-4486-8ec0-4f9436d67601.webp?v=1762758867","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_4565260f-acc6-4993-9522-dbe5f0ccb28b.webp?v=1762758868","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_52302593-77e4-4d1b-ab0b-3076f99453b9.webp?v=1782265101","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_b189a646-d868-447f-b309-7c3d9ccac42f.webp?v=1782265101","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_43e9e05a-6f4c-4495-9ed5-b737e2c3d56c.webp?v=1782265102","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_9b775cef-018f-4728-9566-2435291b2fc8.webp?v=1782291264","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_75be16f5-2c94-41a8-8aee-818b82b5f944.webp?v=1782291265","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_ead296d2-a555-43ce-99f5-3c5204eccb05.webp?v=1782291266","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_40a511ee-d9e7-4018-a2a4-744a0dc20c18.webp?v=1782717694","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_33a0d12d-0a10-4b00-b106-926495808069.webp?v=1782717695","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_dc5f4962-df14-42a5-8ef8-f91a0cf61aec.webp?v=1782717695"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/994d64ac4cc1f5b12d3b428049a661ede55b6284_05ff75dc-f151-484e-8fab-085a5259e2a0.webp?v=1762758866","options":["color"],"media":[{"alt":null,"id":26347946508387,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/994d64ac4cc1f5b12d3b428049a661ede55b6284_05ff75dc-f151-484e-8fab-085a5259e2a0.webp?v=1762758866"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/994d64ac4cc1f5b12d3b428049a661ede55b6284_05ff75dc-f151-484e-8fab-085a5259e2a0.webp?v=1762758866","width":2000},{"alt":null,"id":26347946803299,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_b733a54a-397b-4a78-b801-39bdbac734a2.webp?v=1762758866"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_b733a54a-397b-4a78-b801-39bdbac734a2.webp?v=1762758866","width":2000},{"alt":null,"id":26347946934371,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_7042a41f-026d-4486-8ec0-4f9436d67601.webp?v=1762758867"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_7042a41f-026d-4486-8ec0-4f9436d67601.webp?v=1762758867","width":2000},{"alt":null,"id":26347947032675,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_4565260f-acc6-4993-9522-dbe5f0ccb28b.webp?v=1762758868"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_4565260f-acc6-4993-9522-dbe5f0ccb28b.webp?v=1762758868","width":2000},{"alt":null,"id":27586961309795,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_52302593-77e4-4d1b-ab0b-3076f99453b9.webp?v=1782265101"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_52302593-77e4-4d1b-ab0b-3076f99453b9.webp?v=1782265101","width":2000},{"alt":null,"id":27586961997923,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_b189a646-d868-447f-b309-7c3d9ccac42f.webp?v=1782265101"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_b189a646-d868-447f-b309-7c3d9ccac42f.webp?v=1782265101","width":2000},{"alt":null,"id":27586962751587,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_43e9e05a-6f4c-4495-9ed5-b737e2c3d56c.webp?v=1782265102"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_43e9e05a-6f4c-4495-9ed5-b737e2c3d56c.webp?v=1782265102","width":2000},{"alt":null,"id":27594571743331,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_9b775cef-018f-4728-9566-2435291b2fc8.webp?v=1782291264"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_9b775cef-018f-4728-9566-2435291b2fc8.webp?v=1782291264","width":2000},{"alt":null,"id":27594572234851,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_75be16f5-2c94-41a8-8aee-818b82b5f944.webp?v=1782291265"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_75be16f5-2c94-41a8-8aee-818b82b5f944.webp?v=1782291265","width":2000},{"alt":null,"id":27594572464227,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_ead296d2-a555-43ce-99f5-3c5204eccb05.webp?v=1782291266"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_ead296d2-a555-43ce-99f5-3c5204eccb05.webp?v=1782291266","width":2000},{"alt":null,"id":27629993427043,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_40a511ee-d9e7-4018-a2a4-744a0dc20c18.webp?v=1782717694"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_40a511ee-d9e7-4018-a2a4-744a0dc20c18.webp?v=1782717694","width":2000},{"alt":null,"id":27629993689187,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_33a0d12d-0a10-4b00-b106-926495808069.webp?v=1782717695"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_33a0d12d-0a10-4b00-b106-926495808069.webp?v=1782717695","width":2000},{"alt":null,"id":27629993820259,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_dc5f4962-df14-42a5-8ef8-f91a0cf61aec.webp?v=1782717695"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_dc5f4962-df14-42a5-8ef8-f91a0cf61aec.webp?v=1782717695","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43829038284899,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012600J-PTT12","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750741603,"product_id":7920574890083,"position":12,"created_at":"2026-06-29T15:21:33+08:00","updated_at":"2026-06-29T15:21:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_33a0d12d-0a10-4b00-b106-926495808069.webp?v=1782717695","variant_ids":[43829038284899]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-五條悟 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600J-PTT12","featured_media":{"alt":null,"id":27629993689187,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_33a0d12d-0a10-4b00-b106-926495808069.webp?v=1782717695"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829039497315,"title":"Cyber Blue","option1":"Cyber Blue","option2":null,"option3":null,"sku":"CCN012600I-PTT12","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750872675,"product_id":7920574890083,"position":13,"created_at":"2026-06-29T15:21:33+08:00","updated_at":"2026-06-29T15:21:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_dc5f4962-df14-42a5-8ef8-f91a0cf61aec.webp?v=1782717695","variant_ids":[43829039497315]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-五條悟 - Cyber Blue","public_title":"Cyber Blue","options":["Cyber Blue"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600I-PTT12","featured_media":{"alt":null,"id":27629993820259,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a295f8ff2b80578d8cd136dd1d95aef67dfeae08_dc5f4962-df14-42a5-8ef8-f91a0cf61aec.webp?v=1782717695"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829039530083,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012600G-PTT12","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750479459,"product_id":7920574890083,"position":11,"created_at":"2026-06-29T15:21:32+08:00","updated_at":"2026-06-29T15:21:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_40a511ee-d9e7-4018-a2a4-744a0dc20c18.webp?v=1782717694","variant_ids":[43829039530083]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-五條悟 - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600G-PTT12","featured_media":{"alt":null,"id":27629993427043,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d84779e0d05612ecd9eb9b3c3b39340ee34ecdf8_40a511ee-d9e7-4018-a2a4-744a0dc20c18.webp?v=1782717694"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43829038284899,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012600J-PTT12","requires_shipping":true,"taxable":true,"featured_image":{"id":36124750741603,"product_id":7920574890083,"position":12,"created_at":"2026-06-29T15:21:33+08:00","updated_at":"2026-06-29T15:21:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_33a0d12d-0a10-4b00-b106-926495808069.webp?v=1782717695","variant_ids":[43829038284899]},"available":true,"name":"iPhone 13 Clear 咒術迴戰 澀谷事變戰鬥系列-五條悟 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600J-PTT12","featured_media":{"alt":null,"id":27629993689187,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39a6e598802bbeaf23a394a2bcb15b44e89351bc_33a0d12d-0a10-4b00-b106-926495808069.webp?v=1782717695"}},"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: "停產"
}