diff --git a/src/User/components/Products/ProductDetails.jsx b/src/User/components/Products/ProductDetails.jsx index 3ecba7e1c..a6d796638 100644 --- a/src/User/components/Products/ProductDetails.jsx +++ b/src/User/components/Products/ProductDetails.jsx @@ -263,8 +263,8 @@ const ProductPage = () => { try { const response = await axios.get(`https://dummyjson.com/products/${productId}`); const requiredProduct = response.data; - console.log(response.data) requiredProduct.newPrice = getNewPrice(requiredProduct.discountPercentage, requiredProduct.price) + requiredProduct.image = requiredProduct.images[0] || requiredProduct.thumbnail setProduct(requiredProduct); } catch (error) { console.error("Axios error:", error); diff --git a/src/User/pages/Order/Wishlist.jsx b/src/User/pages/Order/Wishlist.jsx index 3bff5e537..5fa9fcf46 100644 --- a/src/User/pages/Order/Wishlist.jsx +++ b/src/User/pages/Order/Wishlist.jsx @@ -35,7 +35,7 @@ const WishlistItem = ({ product, onUpdate, onAddToCart, isExistsInTheCart }) => style={{ border: "1px solid black" }}>
{product.title} diff --git a/src/User/redux/cartSlice.jsx b/src/User/redux/cartSlice.jsx index e7e4fd964..1160651d8 100644 --- a/src/User/redux/cartSlice.jsx +++ b/src/User/redux/cartSlice.jsx @@ -29,7 +29,7 @@ const cartSlice = createSlice({ oldPrice: product.price || product.oldPrice, newPrice: product.newPrice, total: newQuantity * product.newPrice, - image: product.thumbnail, + image: product.image, } : [] )