$product = {"id":7920556769379,"title":"iPhone 15 Plus SolidX 咒術迴戰 懷玉・玉折角色系列-最強組合","handle":"iphone-15-plus-solidx-ptt05","description":null,"published_at":"2025-11-10T16:31:49+08:00","created_at":"2025-11-10T15:09:31+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-jujutsu-kaisen","device-iPhone 15 Plus","merge","reseller-jujutsu-kaisen"],"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":43828968652899,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT05","requires_shipping":true,"taxable":true,"featured_image":{"id":36125152739427,"product_id":7920556769379,"position":19,"created_at":"2026-06-29T15:42:40+08:00","updated_at":"2026-06-29T15:42:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_4bf722f9-1a54-4603-b114-ec828ae1c115.webp?v=1782718962","variant_ids":[43828968652899]},"available":true,"name":"iPhone 15 Plus SolidX 咒術迴戰 懷玉・玉折角色系列-最強組合 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012960B-PTT05","featured_media":{"alt":null,"id":27630395523171,"position":19,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_4bf722f9-1a54-4603-b114-ec828ae1c115.webp?v=1782718962"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43828972617827,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129652-PTT05","requires_shipping":true,"taxable":true,"featured_image":{"id":36125151002723,"product_id":7920556769379,"position":17,"created_at":"2026-06-29T15:42:37+08:00","updated_at":"2026-06-29T15:42:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324_0bba66b1-6d5e-49c6-964b-4656fc967468.webp?v=1782718960","variant_ids":[43828972617827]},"available":true,"name":"iPhone 15 Plus 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":"NST0129652-PTT05","featured_media":{"alt":null,"id":27630393786467,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324_0bba66b1-6d5e-49c6-964b-4656fc967468.webp?v=1782718960"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9d85ad18999a7c35fff4fbbd72f8ef0f46490e76.webp?v=1762758579","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95d6235856d6c06d4a0e31875036d06608f4ee78.webp?v=1762758579","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bb81cf9e0be965a0ff64285ab1685f22f550ee2.webp?v=1762758580","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79b5dfbe8ef8cb89e15e8c21c79789921d2ec924.webp?v=1762758581","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6ac4f216fedcdf18b9477f8a7b2d2d70e55e856.webp?v=1762758582","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ada324a409170ac67576b86856aa115ac73e729a.webp?v=1762758583","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d2c535a56b383f1b2bc9d00fec0ebfba7eacc111.webp?v=1762758584","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8.webp?v=1762758584","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/24c3a6c38b104ccab2c681ab0cb6b7417e51c70a.webp?v=1762758585","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324.webp?v=1762758586","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_0c4d3205-b763-4fbf-9bb1-61a9e01809ac.webp?v=1782266139","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79b5dfbe8ef8cb89e15e8c21c79789921d2ec924_787727cb-2bb9-43ad-a16e-cd131ace7b4b.webp?v=1782266140","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324_7ce5b9e0-a390-45f9-9290-de812cf01ad9.webp?v=1782266142","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_ec90dbeb-aa24-4612-8ae4-4ce3b731c7ce.webp?v=1782291738","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79b5dfbe8ef8cb89e15e8c21c79789921d2ec924_72ed79b5-d519-4305-85d4-3bd3e0214427.webp?v=1782291740","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324_7bafdc1d-2409-4345-9a33-0ef6ce98ce73.webp?v=1782291741","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324_0bba66b1-6d5e-49c6-964b-4656fc967468.webp?v=1782718960","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79b5dfbe8ef8cb89e15e8c21c79789921d2ec924_bd4a9d56-c837-4873-9102-9fff9741dcca.webp?v=1782718960","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_4bf722f9-1a54-4603-b114-ec828ae1c115.webp?v=1782718962"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9d85ad18999a7c35fff4fbbd72f8ef0f46490e76.webp?v=1762758579","options":["color"],"media":[{"alt":null,"id":26347872616547,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9d85ad18999a7c35fff4fbbd72f8ef0f46490e76.webp?v=1762758579"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9d85ad18999a7c35fff4fbbd72f8ef0f46490e76.webp?v=1762758579","width":2000},{"alt":null,"id":26347873075299,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95d6235856d6c06d4a0e31875036d06608f4ee78.webp?v=1762758579"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95d6235856d6c06d4a0e31875036d06608f4ee78.webp?v=1762758579","width":2000},{"alt":null,"id":26347873271907,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bb81cf9e0be965a0ff64285ab1685f22f550ee2.webp?v=1762758580"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7bb81cf9e0be965a0ff64285ab1685f22f550ee2.webp?v=1762758580","width":2000},{"alt":null,"id":26347873435747,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79b5dfbe8ef8cb89e15e8c21c79789921d2ec924.webp?v=1762758581"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79b5dfbe8ef8cb89e15e8c21c79789921d2ec924.webp?v=1762758581","width":2000},{"alt":null,"id":26347873632355,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6ac4f216fedcdf18b9477f8a7b2d2d70e55e856.webp?v=1762758582"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6ac4f216fedcdf18b9477f8a7b2d2d70e55e856.webp?v=1762758582","width":2000},{"alt":null,"id":26347873927267,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ada324a409170ac67576b86856aa115ac73e729a.webp?v=1762758583"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ada324a409170ac67576b86856aa115ac73e729a.webp?v=1762758583","width":2000},{"alt":null,"id":26347874156643,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d2c535a56b383f1b2bc9d00fec0ebfba7eacc111.webp?v=1762758584"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d2c535a56b383f1b2bc9d00fec0ebfba7eacc111.webp?v=1762758584","width":2000},{"alt":null,"id":26347874320483,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8.webp?v=1762758584"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8.webp?v=1762758584","width":2000},{"alt":null,"id":26347874418787,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/24c3a6c38b104ccab2c681ab0cb6b7417e51c70a.webp?v=1762758585"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/24c3a6c38b104ccab2c681ab0cb6b7417e51c70a.webp?v=1762758585","width":2000},{"alt":null,"id":26347874549859,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324.webp?v=1762758586"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324.webp?v=1762758586","width":2000},{"alt":null,"id":27587409608803,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_0c4d3205-b763-4fbf-9bb1-61a9e01809ac.webp?v=1782266139"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_0c4d3205-b763-4fbf-9bb1-61a9e01809ac.webp?v=1782266139","width":2000},{"alt":null,"id":27587410624611,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79b5dfbe8ef8cb89e15e8c21c79789921d2ec924_787727cb-2bb9-43ad-a16e-cd131ace7b4b.webp?v=1782266140"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79b5dfbe8ef8cb89e15e8c21c79789921d2ec924_787727cb-2bb9-43ad-a16e-cd131ace7b4b.webp?v=1782266140","width":2000},{"alt":null,"id":27587411181667,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324_7ce5b9e0-a390-45f9-9290-de812cf01ad9.webp?v=1782266142"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324_7ce5b9e0-a390-45f9-9290-de812cf01ad9.webp?v=1782266142","width":2000},{"alt":null,"id":27594718019683,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_ec90dbeb-aa24-4612-8ae4-4ce3b731c7ce.webp?v=1782291738"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_ec90dbeb-aa24-4612-8ae4-4ce3b731c7ce.webp?v=1782291738","width":2000},{"alt":null,"id":27594718478435,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79b5dfbe8ef8cb89e15e8c21c79789921d2ec924_72ed79b5-d519-4305-85d4-3bd3e0214427.webp?v=1782291740"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79b5dfbe8ef8cb89e15e8c21c79789921d2ec924_72ed79b5-d519-4305-85d4-3bd3e0214427.webp?v=1782291740","width":2000},{"alt":null,"id":27594719035491,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324_7bafdc1d-2409-4345-9a33-0ef6ce98ce73.webp?v=1782291741"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324_7bafdc1d-2409-4345-9a33-0ef6ce98ce73.webp?v=1782291741","width":2000},{"alt":null,"id":27630393786467,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324_0bba66b1-6d5e-49c6-964b-4656fc967468.webp?v=1782718960"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324_0bba66b1-6d5e-49c6-964b-4656fc967468.webp?v=1782718960","width":2000},{"alt":null,"id":27630394769507,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79b5dfbe8ef8cb89e15e8c21c79789921d2ec924_bd4a9d56-c837-4873-9102-9fff9741dcca.webp?v=1782718960"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/79b5dfbe8ef8cb89e15e8c21c79789921d2ec924_bd4a9d56-c837-4873-9102-9fff9741dcca.webp?v=1782718960","width":2000},{"alt":null,"id":27630395523171,"position":19,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_4bf722f9-1a54-4603-b114-ec828ae1c115.webp?v=1782718962"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_4bf722f9-1a54-4603-b114-ec828ae1c115.webp?v=1782718962","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43828968652899,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT05","requires_shipping":true,"taxable":true,"featured_image":{"id":36125152739427,"product_id":7920556769379,"position":19,"created_at":"2026-06-29T15:42:40+08:00","updated_at":"2026-06-29T15:42:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_4bf722f9-1a54-4603-b114-ec828ae1c115.webp?v=1782718962","variant_ids":[43828968652899]},"available":true,"name":"iPhone 15 Plus SolidX 咒術迴戰 懷玉・玉折角色系列-最強組合 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012960B-PTT05","featured_media":{"alt":null,"id":27630395523171,"position":19,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_4bf722f9-1a54-4603-b114-ec828ae1c115.webp?v=1782718962"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43828972617827,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129652-PTT05","requires_shipping":true,"taxable":true,"featured_image":{"id":36125151002723,"product_id":7920556769379,"position":17,"created_at":"2026-06-29T15:42:37+08:00","updated_at":"2026-06-29T15:42:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324_0bba66b1-6d5e-49c6-964b-4656fc967468.webp?v=1782718960","variant_ids":[43828972617827]},"available":true,"name":"iPhone 15 Plus 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":"NST0129652-PTT05","featured_media":{"alt":null,"id":27630393786467,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b3466b0d783551b329423e2eebf03329dafd324_0bba66b1-6d5e-49c6-964b-4656fc967468.webp?v=1782718960"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43828968652899,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT05","requires_shipping":true,"taxable":true,"featured_image":{"id":36125152739427,"product_id":7920556769379,"position":19,"created_at":"2026-06-29T15:42:40+08:00","updated_at":"2026-06-29T15:42:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_4bf722f9-1a54-4603-b114-ec828ae1c115.webp?v=1782718962","variant_ids":[43828968652899]},"available":true,"name":"iPhone 15 Plus SolidX 咒術迴戰 懷玉・玉折角色系列-最強組合 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012960B-PTT05","featured_media":{"alt":null,"id":27630395523171,"position":19,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36482f6247c3be8f03285ac24038fa9f85a49fb8_4bf722f9-1a54-4603-b114-ec828ae1c115.webp?v=1782718962"}},"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: "停產" }