Skip to content

Commit

Permalink
Merge pull request #231 from UjjwalGupta1105/showcaseMesssage
Browse files Browse the repository at this point in the history
Empty cart message added
  • Loading branch information
mohitparmar1 authored Jun 2, 2024
2 parents 649d960 + aea4b64 commit f8593b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Components/CartItems.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import AddIcon from "@mui/icons-material/Add";
import RemoveIcon from "@mui/icons-material/Remove";
import { loadStripe } from "@stripe/stripe-js";
import { Link } from "react-router-dom";
import img from '../assets/Empty_Cart_img.png'

const CartItems = () => {
const {
Expand All @@ -16,6 +17,9 @@ const CartItems = () => {
AddToCart,
} = useContext(ShopContext);


const isEmptyCart=Object.keys(cartItem).length

//payment gateway
const makePayment = async () => {
const stripe = await loadStripe("Enter Your Stripe Public Key Here");
Expand Down Expand Up @@ -73,6 +77,9 @@ const CartItems = () => {
<span className="font-semibold">Quantity</span>
<span className="font-semibold">Total Price</span>
</div>

{isEmptyCart && (<img src={img} alt="image" />)}

{all_products &&
all_products.map((item) => {
if (cartItem[item.id] > 0) {
Expand Down
Binary file added src/assets/Empty_Cart_img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f8593b0

Please sign in to comment.