$product = {"id":7916488982627,"title":"iPhone 15 Pro SolidX 火影忍者疾風傳 宇智波鼬-宇智波一族家紋","handle":"iphone-15-pro-solidx-pk107","description":null,"published_at":"2025-11-06T11:37:37+08:00","created_at":"2025-11-06T11:06:25+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-naruto-shippuden","device-iPhone 15 Pro","merge","reseller-naruto-shippuden"],"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":43820087574627,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-PK107","requires_shipping":true,"taxable":true,"featured_image":{"id":34755968893027,"product_id":7916488982627,"position":1,"created_at":"2025-11-06T11:06:29+08:00","updated_at":"2025-11-06T11:06:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a9aeefd4e61eb1dd4d5ba99f80f16125947e714.webp?v=1762398391","variant_ids":[43820087574627]},"available":true,"name":"iPhone 15 Pro 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":"NST012970B-PK107","featured_media":{"alt":null,"id":26322353225827,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a9aeefd4e61eb1dd4d5ba99f80f16125947e714.webp?v=1762398391"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43820089966691,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-PK107","requires_shipping":true,"taxable":true,"featured_image":{"id":34755969744995,"product_id":7916488982627,"position":5,"created_at":"2025-11-06T11:06:32+08:00","updated_at":"2025-11-06T11:06:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40b952c0e6be1a4af9c1f6107397358510107fa1.webp?v=1762398394","variant_ids":[43820089966691]},"available":true,"name":"iPhone 15 Pro SolidX 火影忍者疾風傳 宇智波鼬-宇智波一族家紋 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01297Z8-PK107","featured_media":{"alt":null,"id":26322354077795,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40b952c0e6be1a4af9c1f6107397358510107fa1.webp?v=1762398394"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43820090032227,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-PK107","requires_shipping":true,"taxable":true,"featured_image":{"id":34755969908835,"product_id":7916488982627,"position":6,"created_at":"2025-11-06T11:06:32+08:00","updated_at":"2025-11-06T11:06:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb461bee338214b9281c43462bff3310b2a2dda4.webp?v=1762398394","variant_ids":[43820090032227]},"available":true,"name":"iPhone 15 Pro SolidX 火影忍者疾風傳 宇智波鼬-宇智波一族家紋 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970A-PK107","featured_media":{"alt":null,"id":26322354241635,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb461bee338214b9281c43462bff3310b2a2dda4.webp?v=1762398394"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43820090064995,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-PK107","requires_shipping":true,"taxable":true,"featured_image":{"id":34755970105443,"product_id":7916488982627,"position":7,"created_at":"2025-11-06T11:06:33+08:00","updated_at":"2025-11-06T11:06:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38bd308e56a61d841cc417e13fb77561dcc7c870.webp?v=1762398395","variant_ids":[43820090064995]},"available":true,"name":"iPhone 15 Pro 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":"NST0129752-PK107","featured_media":{"alt":null,"id":26322354602083,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38bd308e56a61d841cc417e13fb77561dcc7c870.webp?v=1762398395"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43820090097763,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-PK107","requires_shipping":true,"taxable":true,"featured_image":{"id":34755970269283,"product_id":7916488982627,"position":8,"created_at":"2025-11-06T11:06:34+08:00","updated_at":"2025-11-06T11:06:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2085bda3b5bc081348c321752d4496a610e2456.webp?v=1762398396","variant_ids":[43820090097763]},"available":true,"name":"iPhone 15 Pro 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":"NST0129753-PK107","featured_media":{"alt":null,"id":26322354765923,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2085bda3b5bc081348c321752d4496a610e2456.webp?v=1762398396"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a9aeefd4e61eb1dd4d5ba99f80f16125947e714.webp?v=1762398391","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/49bb2c8778efb77378237d88e2e9fdd08e07c9e9.webp?v=1762398391","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9479020bbff4485893ac5cdac05ba3437caef944.webp?v=1762398392","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e00d7e3ae21d53012572dee2e4c68bab28be4ca9.webp?v=1762398393","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40b952c0e6be1a4af9c1f6107397358510107fa1.webp?v=1762398394","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb461bee338214b9281c43462bff3310b2a2dda4.webp?v=1762398394","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38bd308e56a61d841cc417e13fb77561dcc7c870.webp?v=1762398395","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2085bda3b5bc081348c321752d4496a610e2456.webp?v=1762398396","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4221e4430db7898f1a725a8d2aee263c8fd806c7.webp?v=1762398396","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c39e3d68bc06780bf6e7da71bf96b0c22abfb66b.webp?v=1762398397"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a9aeefd4e61eb1dd4d5ba99f80f16125947e714.webp?v=1762398391","options":["color"],"media":[{"alt":null,"id":26322353225827,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a9aeefd4e61eb1dd4d5ba99f80f16125947e714.webp?v=1762398391"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a9aeefd4e61eb1dd4d5ba99f80f16125947e714.webp?v=1762398391","width":2000},{"alt":null,"id":26322353422435,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/49bb2c8778efb77378237d88e2e9fdd08e07c9e9.webp?v=1762398391"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/49bb2c8778efb77378237d88e2e9fdd08e07c9e9.webp?v=1762398391","width":2000},{"alt":null,"id":26322353651811,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9479020bbff4485893ac5cdac05ba3437caef944.webp?v=1762398392"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9479020bbff4485893ac5cdac05ba3437caef944.webp?v=1762398392","width":2000},{"alt":null,"id":26322353848419,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e00d7e3ae21d53012572dee2e4c68bab28be4ca9.webp?v=1762398393"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e00d7e3ae21d53012572dee2e4c68bab28be4ca9.webp?v=1762398393","width":2000},{"alt":null,"id":26322354077795,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40b952c0e6be1a4af9c1f6107397358510107fa1.webp?v=1762398394"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40b952c0e6be1a4af9c1f6107397358510107fa1.webp?v=1762398394","width":2000},{"alt":null,"id":26322354241635,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb461bee338214b9281c43462bff3310b2a2dda4.webp?v=1762398394"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb461bee338214b9281c43462bff3310b2a2dda4.webp?v=1762398394","width":2000},{"alt":null,"id":26322354602083,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38bd308e56a61d841cc417e13fb77561dcc7c870.webp?v=1762398395"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38bd308e56a61d841cc417e13fb77561dcc7c870.webp?v=1762398395","width":2000},{"alt":null,"id":26322354765923,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2085bda3b5bc081348c321752d4496a610e2456.webp?v=1762398396"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2085bda3b5bc081348c321752d4496a610e2456.webp?v=1762398396","width":2000},{"alt":null,"id":26322354929763,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4221e4430db7898f1a725a8d2aee263c8fd806c7.webp?v=1762398396"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4221e4430db7898f1a725a8d2aee263c8fd806c7.webp?v=1762398396","width":2000},{"alt":null,"id":26322355191907,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c39e3d68bc06780bf6e7da71bf96b0c22abfb66b.webp?v=1762398397"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c39e3d68bc06780bf6e7da71bf96b0c22abfb66b.webp?v=1762398397","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43820087574627,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-PK107","requires_shipping":true,"taxable":true,"featured_image":{"id":34755968893027,"product_id":7916488982627,"position":1,"created_at":"2025-11-06T11:06:29+08:00","updated_at":"2025-11-06T11:06:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a9aeefd4e61eb1dd4d5ba99f80f16125947e714.webp?v=1762398391","variant_ids":[43820087574627]},"available":true,"name":"iPhone 15 Pro 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":"NST012970B-PK107","featured_media":{"alt":null,"id":26322353225827,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a9aeefd4e61eb1dd4d5ba99f80f16125947e714.webp?v=1762398391"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43820089966691,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-PK107","requires_shipping":true,"taxable":true,"featured_image":{"id":34755969744995,"product_id":7916488982627,"position":5,"created_at":"2025-11-06T11:06:32+08:00","updated_at":"2025-11-06T11:06:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40b952c0e6be1a4af9c1f6107397358510107fa1.webp?v=1762398394","variant_ids":[43820089966691]},"available":true,"name":"iPhone 15 Pro SolidX 火影忍者疾風傳 宇智波鼬-宇智波一族家紋 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01297Z8-PK107","featured_media":{"alt":null,"id":26322354077795,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/40b952c0e6be1a4af9c1f6107397358510107fa1.webp?v=1762398394"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43820090032227,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-PK107","requires_shipping":true,"taxable":true,"featured_image":{"id":34755969908835,"product_id":7916488982627,"position":6,"created_at":"2025-11-06T11:06:32+08:00","updated_at":"2025-11-06T11:06:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb461bee338214b9281c43462bff3310b2a2dda4.webp?v=1762398394","variant_ids":[43820090032227]},"available":true,"name":"iPhone 15 Pro SolidX 火影忍者疾風傳 宇智波鼬-宇智波一族家紋 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970A-PK107","featured_media":{"alt":null,"id":26322354241635,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb461bee338214b9281c43462bff3310b2a2dda4.webp?v=1762398394"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43820090064995,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-PK107","requires_shipping":true,"taxable":true,"featured_image":{"id":34755970105443,"product_id":7916488982627,"position":7,"created_at":"2025-11-06T11:06:33+08:00","updated_at":"2025-11-06T11:06:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38bd308e56a61d841cc417e13fb77561dcc7c870.webp?v=1762398395","variant_ids":[43820090064995]},"available":true,"name":"iPhone 15 Pro 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":"NST0129752-PK107","featured_media":{"alt":null,"id":26322354602083,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38bd308e56a61d841cc417e13fb77561dcc7c870.webp?v=1762398395"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43820090097763,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-PK107","requires_shipping":true,"taxable":true,"featured_image":{"id":34755970269283,"product_id":7916488982627,"position":8,"created_at":"2025-11-06T11:06:34+08:00","updated_at":"2025-11-06T11:06:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2085bda3b5bc081348c321752d4496a610e2456.webp?v=1762398396","variant_ids":[43820090097763]},"available":true,"name":"iPhone 15 Pro 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":"NST0129753-PK107","featured_media":{"alt":null,"id":26322354765923,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2085bda3b5bc081348c321752d4496a610e2456.webp?v=1762398396"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43820087574627,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-PK107","requires_shipping":true,"taxable":true,"featured_image":{"id":34755968893027,"product_id":7916488982627,"position":1,"created_at":"2025-11-06T11:06:29+08:00","updated_at":"2025-11-06T11:06:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a9aeefd4e61eb1dd4d5ba99f80f16125947e714.webp?v=1762398391","variant_ids":[43820087574627]},"available":true,"name":"iPhone 15 Pro 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":"NST012970B-PK107","featured_media":{"alt":null,"id":26322353225827,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a9aeefd4e61eb1dd4d5ba99f80f16125947e714.webp?v=1762398391"}},"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: "停產" }