updated retail to retailer
Some checks failed
NPM Installation / build (16.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (16.x, windows-latest) (push) Has been cancelled
NPM Installation / build (17.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (17.x, windows-latest) (push) Has been cancelled
NPM Installation / build (18.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (18.x, windows-latest) (push) Has been cancelled

This commit is contained in:
ROSHAN GARG 2024-11-04 13:46:32 +05:30
parent a4c6bf8042
commit 9d10460f5b
6 changed files with 66 additions and 39 deletions

View File

@ -17,7 +17,7 @@
name="keyword" name="keyword"
content="Bootstrap,Admin,Template,Open,Source,CSS,SCSS,HTML,RWD,Dashboard,React" content="Bootstrap,Admin,Template,Open,Source,CSS,SCSS,HTML,RWD,Dashboard,React"
/> />
<title>Retail distributer</title> <title>Retailer</title>
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<link rel="shortcut icon" href="/favicon.ico" /> <link rel="shortcut icon" href="/favicon.ico" />
</head> </head>

View File

@ -164,7 +164,7 @@ const OrderDetails = () => {
<TableCell>{row.SKU}</TableCell> <TableCell>{row.SKU}</TableCell>
<TableCell>{row.quantity}</TableCell> <TableCell>{row.quantity}</TableCell>
<TableCell>{row.price}</TableCell> <TableCell>{row.price}</TableCell>
<TableCell>{gstAmount}</TableCell> <TableCell>{gstAmount.toFixed(2)}</TableCell>
<TableCell>{row.price * row.quantity}</TableCell> <TableCell>{row.price * row.quantity}</TableCell>
</TableRow> </TableRow>
) )
@ -178,13 +178,13 @@ const OrderDetails = () => {
<TableRow> <TableRow>
<TableCell colSpan={7} /> <TableCell colSpan={7} />
<TableCell> <TableCell>
Total GST:<strong> {gstTotal} </strong> Total GST:<strong> {gstTotal.toFixed(2)} </strong>
</TableCell> </TableCell>
</TableRow> </TableRow>
<TableRow> <TableRow>
<TableCell colSpan={7} /> <TableCell colSpan={7} />
<TableCell> <TableCell>
Grand Total: <strong> {grandTotal}</strong> Grand Total: <strong> {grandTotal.toFixed(2)}</strong>
</TableCell> </TableCell>
</TableRow> </TableRow>
</TableBody> </TableBody>

View File

@ -119,7 +119,7 @@ const OrderConfirmation = ({ orderId, billTo, shipTo, paymentMode, cartItem }) =
<TableCell>{row.SKU}</TableCell> <TableCell>{row.SKU}</TableCell>
<TableCell>{row.count}</TableCell> <TableCell>{row.count}</TableCell>
<TableCell>{row.price}</TableCell> <TableCell>{row.price}</TableCell>
<TableCell>{gstAmount}</TableCell> <TableCell>{gstAmount.toFixed(2)}</TableCell>
<TableCell>{row.price * row.count}</TableCell> <TableCell>{row.price * row.count}</TableCell>
</TableRow> </TableRow>
) )
@ -127,20 +127,20 @@ const OrderConfirmation = ({ orderId, billTo, shipTo, paymentMode, cartItem }) =
<TableRow> <TableRow>
<TableCell colSpan={7} /> <TableCell colSpan={7} />
<TableCell> <TableCell>
Subtotal:<strong> {subtotal}</strong> Subtotal:<strong> {subtotaltoFixed(2)}</strong>
</TableCell> </TableCell>
</TableRow> </TableRow>
<TableRow> <TableRow>
<TableCell colSpan={7} /> <TableCell colSpan={7} />
<TableCell> <TableCell>
Total GST:<strong> {totalGST} </strong> Total GST:<strong> {totalGSTtoFixed(2)} </strong>
</TableCell> </TableCell>
</TableRow> </TableRow>
<TableRow> <TableRow>
<TableCell colSpan={7} /> <TableCell colSpan={7} />
<TableCell> <TableCell>
Grand Total: <strong> {subtotal + totalGST}</strong> Grand Total: <strong> {subtotal.toFixed(2) + totalGST.toFixed(2)}</strong>
</TableCell> </TableCell>
</TableRow> </TableRow>
</TableBody> </TableBody>

View File

@ -137,7 +137,7 @@ const ShoppingCart = ({ handleTabChange }) => {
</Box> </Box>
</TableCell> </TableCell>
<TableCell>{row.price}</TableCell> <TableCell>{row.price}</TableCell>
<TableCell>{gstAmount}</TableCell> <TableCell>{gstAmount.toFixed(2)}</TableCell>
<TableCell>{row.price * row.count}</TableCell> <TableCell>{row.price * row.count}</TableCell>
</TableRow> </TableRow>
) )
@ -151,7 +151,7 @@ const ShoppingCart = ({ handleTabChange }) => {
<TableRow> <TableRow>
<TableCell colSpan={5} /> <TableCell colSpan={5} />
<TableCell> <TableCell>
Total GST:<strong> {totalGST} </strong> Total GST:<strong> {totalGST.toFixed(2)} </strong>
</TableCell> </TableCell>
</TableRow> </TableRow>

View File

@ -8,11 +8,17 @@ import {
CircularProgress, CircularProgress,
Container, Container,
FormControl, FormControl,
Grid,
MenuItem, MenuItem,
Pagination, Pagination,
Select, Select,
Typography, Typography,
Table,
TableBody,
TableCell,
TableContainer,
TableHead,
TableRow,
Paper,
} from '@mui/material' } from '@mui/material'
import ShopCard from './shopCard' import ShopCard from './shopCard'
@ -114,13 +120,45 @@ const Shop = () => {
<CircularProgress /> <CircularProgress />
) : ( ) : (
<> <>
<Grid container spacing={2}> <TableContainer component={Paper} sx={{ mt: 3 }}>
{products.map((item, i) => ( <Table>
<Grid key={i} item xs={12} sm={6} md={4} lg={4}> <TableHead>
<ShopCard item={item} /> <TableRow>
</Grid> <TableCell sx={{ fontWeight: 'bold' }} align="center">
))} Product Name
</Grid> </TableCell>
<TableCell sx={{ fontWeight: 'bold' }} align="center">
Category
</TableCell>
<TableCell sx={{ fontWeight: 'bold' }} align="center">
Price
</TableCell>
<TableCell sx={{ fontWeight: 'bold' }} align="center">
Action
</TableCell>
</TableRow>
</TableHead>
<TableBody>
{products?.map((product) => (
<TableRow key={product._id}>
<TableCell size="small" align="center">
{product?.name}
</TableCell>
<TableCell size="small" align="center">
{product.category.categoryName}
</TableCell>
<TableCell size="small" align="center">
{product.price}
</TableCell>
<TableCell size="small" align="center">
<ShopCard item={product} />
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableContainer>
<Box mt={3} display="flex" justifyContent="center"> <Box mt={3} display="flex" justifyContent="center">
<Pagination <Pagination
count={Math.ceil(totalData / itemsPerPage)} count={Math.ceil(totalData / itemsPerPage)}

View File

@ -18,27 +18,16 @@ const ShopCard = ({ item }) => {
} }
return ( return (
<div> <div>
<Card> <Button
<CardMedia component="img" height="150" image={item?.image} alt={item?.name} /> variant="contained"
<CardContent> color="primary"
<Typography gutterBottom variant="h5" component="div"> // fullWidth
{item?.name} disabled={isProductInCart}
</Typography> onClick={handleAddToCart}
<Typography variant="body2" color="text.secondary"> sx={{ marginTop: '10px' }}
${item?.price} >
</Typography> {isProductInCart ? 'Already in Cart' : 'Add to Cart'}
<Button </Button>
variant="contained"
color="primary"
fullWidth
disabled={isProductInCart}
onClick={handleAddToCart}
sx={{ marginTop: '10px' }}
>
{isProductInCart ? 'Already in Cart' : 'Add to Cart'}
</Button>
</CardContent>
</Card>
</div> </div>
) )
} }