$product = {"id":7920536256611,"title":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-虎杖悠仁","handle":"iphone-15-plus-solidx-ptt11","description":null,"published_at":"2025-11-10T16:34:59+08:00","created_at":"2025-11-10T15:04:29+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":43828888371299,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT11","requires_shipping":true,"taxable":true,"featured_image":{"id":36125153755235,"product_id":7920536256611,"position":18,"created_at":"2026-06-29T15:42:44+08:00","updated_at":"2026-06-29T15:42:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_49c7ab76-2e9b-40c0-bfd9-f263e0f0afc5.webp?v=1782718967","variant_ids":[43828888371299]},"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-PTT11","featured_media":{"alt":null,"id":27630396538979,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_49c7ab76-2e9b-40c0-bfd9-f263e0f0afc5.webp?v=1782718967"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43828891287651,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129652-PTT11","requires_shipping":true,"taxable":true,"featured_image":{"id":36125153230947,"product_id":7920536256611,"position":16,"created_at":"2026-06-29T15:42:42+08:00","updated_at":"2026-06-29T15:42:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb_3dffab72-3c6b-4e83-bfae-367b3f800f97.webp?v=1782718964","variant_ids":[43828891287651]},"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-PTT11","featured_media":{"alt":null,"id":27630396014691,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb_3dffab72-3c6b-4e83-bfae-367b3f800f97.webp?v=1782718964"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac4327443ce158f1fe65def14a9635047567f1a.webp?v=1762758277","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/24702e5c6b459b23b265442f17cc2f2a24482d1f.webp?v=1762758279","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/747dc2d92fafc31fd409fc358285abc30f686079.webp?v=1762758279","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/255ea7800cb288081da473e5b5b9e4d636c4f239.webp?v=1762758280","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb.webp?v=1762758281","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0.webp?v=1762758282","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da70d18fb3250156371ef28c2c76a7453220d187.webp?v=1762758282","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a77ba24a5ebef9eaa2c65c0002fe1f9ba77f4c5.webp?v=1762758283","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2aaabbe7648366c3146f0f9bb54adca96eb9716.webp?v=1762758284","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da70d18fb3250156371ef28c2c76a7453220d187_4587b084-0e8c-472d-9dc9-062befcb2c6b.webp?v=1782266139","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb_47a2dc25-bee2-4c32-8be0-6d08a373d5d9.webp?v=1782266140","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_74809634-1ee4-4ca0-86ca-ca823fc1b1cf.webp?v=1782266142","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da70d18fb3250156371ef28c2c76a7453220d187_78a61dd1-4b6d-4c36-b65b-515ec329e219.webp?v=1782291741","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb_e54e9ec0-b68b-4138-af20-7f50bd67256a.webp?v=1782291743","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_b5fd808f-ebdd-4c81-8a41-0354625e88b0.webp?v=1782291744","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb_3dffab72-3c6b-4e83-bfae-367b3f800f97.webp?v=1782718964","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da70d18fb3250156371ef28c2c76a7453220d187_e8fc2eab-dde7-453b-a9fe-c22291bb9bd8.webp?v=1782718964","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_49c7ab76-2e9b-40c0-bfd9-f263e0f0afc5.webp?v=1782718967"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac4327443ce158f1fe65def14a9635047567f1a.webp?v=1762758277","options":["color"],"media":[{"alt":null,"id":26347795873891,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac4327443ce158f1fe65def14a9635047567f1a.webp?v=1762758277"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac4327443ce158f1fe65def14a9635047567f1a.webp?v=1762758277","width":2000},{"alt":null,"id":26347796103267,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/24702e5c6b459b23b265442f17cc2f2a24482d1f.webp?v=1762758279"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/24702e5c6b459b23b265442f17cc2f2a24482d1f.webp?v=1762758279","width":2000},{"alt":null,"id":26347796267107,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/747dc2d92fafc31fd409fc358285abc30f686079.webp?v=1762758279"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/747dc2d92fafc31fd409fc358285abc30f686079.webp?v=1762758279","width":2000},{"alt":null,"id":26347796365411,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/255ea7800cb288081da473e5b5b9e4d636c4f239.webp?v=1762758280"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/255ea7800cb288081da473e5b5b9e4d636c4f239.webp?v=1762758280","width":2000},{"alt":null,"id":26347796562019,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb.webp?v=1762758281"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb.webp?v=1762758281","width":2000},{"alt":null,"id":26347796627555,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0.webp?v=1762758282"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0.webp?v=1762758282","width":2000},{"alt":null,"id":26347796791395,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da70d18fb3250156371ef28c2c76a7453220d187.webp?v=1762758282"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da70d18fb3250156371ef28c2c76a7453220d187.webp?v=1762758282","width":2000},{"alt":null,"id":26347796889699,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a77ba24a5ebef9eaa2c65c0002fe1f9ba77f4c5.webp?v=1762758283"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a77ba24a5ebef9eaa2c65c0002fe1f9ba77f4c5.webp?v=1762758283","width":2000},{"alt":null,"id":26347797086307,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2aaabbe7648366c3146f0f9bb54adca96eb9716.webp?v=1762758284"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a2aaabbe7648366c3146f0f9bb54adca96eb9716.webp?v=1762758284","width":2000},{"alt":null,"id":27587409576035,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da70d18fb3250156371ef28c2c76a7453220d187_4587b084-0e8c-472d-9dc9-062befcb2c6b.webp?v=1782266139"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da70d18fb3250156371ef28c2c76a7453220d187_4587b084-0e8c-472d-9dc9-062befcb2c6b.webp?v=1782266139","width":2000},{"alt":null,"id":27587410493539,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb_47a2dc25-bee2-4c32-8be0-6d08a373d5d9.webp?v=1782266140"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb_47a2dc25-bee2-4c32-8be0-6d08a373d5d9.webp?v=1782266140","width":2000},{"alt":null,"id":27587411148899,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_74809634-1ee4-4ca0-86ca-ca823fc1b1cf.webp?v=1782266142"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_74809634-1ee4-4ca0-86ca-ca823fc1b1cf.webp?v=1782266142","width":2000},{"alt":null,"id":27594719264867,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da70d18fb3250156371ef28c2c76a7453220d187_78a61dd1-4b6d-4c36-b65b-515ec329e219.webp?v=1782291741"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da70d18fb3250156371ef28c2c76a7453220d187_78a61dd1-4b6d-4c36-b65b-515ec329e219.webp?v=1782291741","width":2000},{"alt":null,"id":27594719887459,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb_e54e9ec0-b68b-4138-af20-7f50bd67256a.webp?v=1782291743"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb_e54e9ec0-b68b-4138-af20-7f50bd67256a.webp?v=1782291743","width":2000},{"alt":null,"id":27594720575587,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_b5fd808f-ebdd-4c81-8a41-0354625e88b0.webp?v=1782291744"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_b5fd808f-ebdd-4c81-8a41-0354625e88b0.webp?v=1782291744","width":2000},{"alt":null,"id":27630396014691,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb_3dffab72-3c6b-4e83-bfae-367b3f800f97.webp?v=1782718964"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb_3dffab72-3c6b-4e83-bfae-367b3f800f97.webp?v=1782718964","width":2000},{"alt":null,"id":27630396309603,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da70d18fb3250156371ef28c2c76a7453220d187_e8fc2eab-dde7-453b-a9fe-c22291bb9bd8.webp?v=1782718964"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da70d18fb3250156371ef28c2c76a7453220d187_e8fc2eab-dde7-453b-a9fe-c22291bb9bd8.webp?v=1782718964","width":2000},{"alt":null,"id":27630396538979,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_49c7ab76-2e9b-40c0-bfd9-f263e0f0afc5.webp?v=1782718967"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_49c7ab76-2e9b-40c0-bfd9-f263e0f0afc5.webp?v=1782718967","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43828888371299,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT11","requires_shipping":true,"taxable":true,"featured_image":{"id":36125153755235,"product_id":7920536256611,"position":18,"created_at":"2026-06-29T15:42:44+08:00","updated_at":"2026-06-29T15:42:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_49c7ab76-2e9b-40c0-bfd9-f263e0f0afc5.webp?v=1782718967","variant_ids":[43828888371299]},"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-PTT11","featured_media":{"alt":null,"id":27630396538979,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_49c7ab76-2e9b-40c0-bfd9-f263e0f0afc5.webp?v=1782718967"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43828891287651,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129652-PTT11","requires_shipping":true,"taxable":true,"featured_image":{"id":36125153230947,"product_id":7920536256611,"position":16,"created_at":"2026-06-29T15:42:42+08:00","updated_at":"2026-06-29T15:42:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb_3dffab72-3c6b-4e83-bfae-367b3f800f97.webp?v=1782718964","variant_ids":[43828891287651]},"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-PTT11","featured_media":{"alt":null,"id":27630396014691,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9e940f87d2b0a1ca18d4f8b8ad9d94b0b1d4f2eb_3dffab72-3c6b-4e83-bfae-367b3f800f97.webp?v=1782718964"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43828888371299,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT11","requires_shipping":true,"taxable":true,"featured_image":{"id":36125153755235,"product_id":7920536256611,"position":18,"created_at":"2026-06-29T15:42:44+08:00","updated_at":"2026-06-29T15:42:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_49c7ab76-2e9b-40c0-bfd9-f263e0f0afc5.webp?v=1782718967","variant_ids":[43828888371299]},"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-PTT11","featured_media":{"alt":null,"id":27630396538979,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/400cbdb4d4548ee17a90c8bb7b9706a328ce1ad0_49c7ab76-2e9b-40c0-bfd9-f263e0f0afc5.webp?v=1782718967"}},"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: "停產" }