diff --git a/src/components/ProductDetailPage.js b/src/components/ProductDetailPage.js index 37a042d..8e06aee 100644 --- a/src/components/ProductDetailPage.js +++ b/src/components/ProductDetailPage.js @@ -599,13 +599,16 @@ class ProductDetailPage extends Component { const productData = res.translatedProduct || res.product; productData.seoName = this.props.seoName; + // Use translated attributes if available + const attributesData = res.translatedAttributes || res.attributes; + // Initialize cache if it doesn't exist if (!window.productDetailCache) { window.productDetailCache = {}; } // Cache the complete response data (product + attributes) - cache the response with translated product - const cacheData = { ...res, product: productData }; + const cacheData = { ...res, product: productData, attributes: attributesData }; window.productDetailCache[cacheKey] = cacheData; // Clean up prerender fallback since we now have real data @@ -628,7 +631,7 @@ class ProductDetailPage extends Component { upgrading: false, // Clear upgrading state since we now have complete data error: null, imageDialogOpen: false, - attributes: res.attributes, + attributes: attributesData, komponenten: komponenten, komponentenLoaded: komponenten.length === 0, // If no komponenten, mark as loaded similarProducts: res.similarProducts || [] @@ -653,7 +656,7 @@ class ProductDetailPage extends Component { console.log("getProductView", res); // Load attribute images - this.loadAttributeImages(res.attributes); + this.loadAttributeImages(attributesData); } else { console.error( "Error loading product:",