Преглед изворни кода

done checkout page

cart-api-guide
azri пре 1 недеља
родитељ
комит
3f304f7207

+ 316
- 62
src/components/BillingForm/BillingForm.jsx Прегледај датотеку

@@ -8,6 +8,8 @@ import {
8 8
   RadioGroup,
9 9
   FormControlLabel,
10 10
   Radio,
11
+  Link,
12
+  Checkbox
11 13
 } from '@mui/material';
12 14
 import Table from '@mui/material/Table';
13 15
 import TableBody from '@mui/material/TableBody';
@@ -16,6 +18,9 @@ import TableContainer from '@mui/material/TableContainer';
16 18
 import TableHead from '@mui/material/TableHead';
17 19
 import TableRow from '@mui/material/TableRow';
18 20
 import Grid from '@mui/material/Grid2';
21
+import CreditCardIcon from '@mui/icons-material/CreditCard';
22
+import AccountBalanceWalletIcon from '@mui/icons-material/AccountBalanceWallet';
23
+
19 24
 
20 25
 const BillingForm = () => {
21 26
 
@@ -49,94 +54,343 @@ const BillingForm = () => {
49 54
 
50 55
   return (
51 56
     <Box
52
-     
57
+
53 58
       onSubmit={handleSubmit}
54 59
       sx={{
55 60
         width: '100%',
56 61
       }}
57 62
     >
58
-      
59
-      {/* Product List */}
63
+
64
+      {/* Product TableList */}
65
+      <Typography variant='body1' sx={{ fontWeight: "500", my: 5 }}>1. YOUR ORDER SUMMARY</Typography>
66
+
60 67
       <TableContainer>
61
-          <Table sx={{ minWidth: 650, mb: 5, backgroundColor:"#F7FBFF" }}>
62
-            <TableHead>
63
-              <TableRow>
64
-                <TableCell width={150}>
65
-                  <Typography variant='body1'>Item</Typography>
68
+        <Table sx={{ minWidth: 650, backgroundColor: "#F7FBFF" }}>
69
+          <TableHead>
70
+            <TableRow>
71
+              <TableCell width={150}>
72
+                <Typography variant='body1'>Item</Typography>
73
+              </TableCell>
74
+              <TableCell width={150}>
75
+                {/* This is just for table offset */}
76
+                <Typography variant='body1'></Typography>
77
+              </TableCell>
78
+              <TableCell align='center'>
79
+                <Typography variant='body1'>Colour</Typography>
80
+              </TableCell>
81
+              <TableCell align='center'>
82
+
83
+                <Typography variant='body1'>Quantity</Typography>
84
+              </TableCell>
85
+              <TableCell align='center'>
86
+                <Typography variant='body1'>Unit Price</Typography>
87
+              </TableCell>
88
+              <TableCell align='center'>
89
+                <Typography variant='body1'>Shipping</Typography>
90
+              </TableCell>
91
+              <TableCell align='center'>
92
+                <Typography variant='body1'>Tax</Typography>
93
+              </TableCell>
94
+              <TableCell align='center'>
95
+                <Typography variant='body1'>Duties</Typography>
96
+              </TableCell>
97
+            </TableRow>
98
+          </TableHead>
99
+          <TableBody>
100
+            {rows.map((row) => (
101
+              <TableRow
102
+                key={row.id}
103
+                sx={{
104
+                  '& td, & th': { border: 0 },
105
+                  '&:last-child td, &:last-child th': { border: 0 }
106
+                }}
107
+              >
108
+                <TableCell component="th" scope="row">
109
+                  <img
110
+                    src={row.img_src}
111
+                    alt={row.img_src}
112
+                    style={{
113
+                      width: 100,
114
+                      height: 100,
115
+                      aspectRatio: '4 / 4',
116
+                      objectFit: 'cover',
117
+                    }}
118
+                  />
66 119
                 </TableCell>
67
-                <TableCell width={150}>
68
-                  {/* This is just for table offset */}
69
-                  <Typography variant='body1'></Typography>
120
+                <TableCell>
121
+                  <Typography variant='body2' sx={{ fontWeight: "bold", mb: 1 }}>{row.name}</Typography>
122
+                  <Typography variant='body2'>{row.description}</Typography>
70 123
                 </TableCell>
71 124
                 <TableCell align='center'>
72
-                  <Typography variant='body1'>Colour</Typography>
125
+                  <Typography variant='body1' sx={{ fontWeight: "bold" }} >{row.colour}</Typography>
73 126
                 </TableCell>
74 127
                 <TableCell align='center'>
75
-
76
-                  <Typography variant='body1'>Quantity</Typography>
128
+                  <Typography variant='body1' sx={{ fontWeight: "bold" }}>{row.quantity}</Typography>
77 129
                 </TableCell>
78 130
                 <TableCell align='center'>
79
-                  <Typography variant='body1'>Unit Price</Typography>
131
+                  <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
80 132
                 </TableCell>
81 133
                 <TableCell align='center'>
82
-                  <Typography variant='body1'>Shipping</Typography>
134
+                  <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
83 135
                 </TableCell>
84 136
                 <TableCell align='center'>
85
-                  <Typography variant='body1'>Tax</Typography>
137
+                  <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
86 138
                 </TableCell>
87 139
                 <TableCell align='center'>
88
-                  <Typography variant='body1'>Duties</Typography>
140
+                  <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
89 141
                 </TableCell>
90 142
               </TableRow>
91
-            </TableHead>
92
-            <TableBody>
93
-              {rows.map((row) => (
94
-                <TableRow
95
-                  key={row.id}
143
+            ))}
144
+          </TableBody>
145
+        </Table>
146
+        <Box sx={{
147
+          backgroundColor: "#F7FBFF",
148
+          borderTop: "1px solid rgba(0,0,0,0.1)",
149
+          borderBottom: "1px solid rgba(0,0,0,0.1)",
150
+          pl: 2,
151
+          pr: 6,
152
+          py: 2,
153
+          mb: 5,
154
+          display: "flex",
155
+          justifyContent: "space-between"
156
+
157
+        }}>
158
+          <Link variant='body2' sx={{ textDecoration: "underline", color: "#000", fontWeight: "200", letterSpacing: 1 }}>ADD A GIFT CARD OR PROMOTION CODE</Link>
159
+          <Typography variant='body2'> Total <span style={{ fontWeight: "bold" }}>{`RM ${parseFloat(250).toFixed(2)}`}</span> </Typography>
160
+        </Box>
161
+      </TableContainer>
162
+
163
+      {/* Shipping Data */}
164
+      <Typography variant='body1' sx={{ fontWeight: "500", my: 5 }}>2. REVIEW SHIPPING AND BILLING ADDRESS</Typography>
165
+      <Grid container sx={{
166
+        backgroundColor: "#F7FBFF",
167
+        borderTop: "1px solid rgba(0,0,0,0.1)",
168
+        borderBottom: "1px solid rgba(0,0,0,0.1)",
169
+        p: 2,
170
+        mb: 10
171
+      }}>
172
+        <Grid size={6}>
173
+          <Typography variant="body2" sx={{ fontWeight: "bold", mb: 5 }}>SHIPPING ADDRESS</Typography>
174
+          <Box sx={{ display: "flex", flexDirection: "column" }}>
175
+            <Typography variant="body2" sx={{ fontWeight: "400" }}>Mr. David Olson</Typography>
176
+            <Typography variant="body2" sx={{ fontWeight: "400" }}>4220 Raintree Boulevard</Typography>
177
+            <Typography variant="body2" sx={{ fontWeight: "400" }}>Montezuma</Typography>
178
+            <Typography variant="body2" sx={{ fontWeight: "400" }}>Indiana</Typography>
179
+            <Typography variant="body2" sx={{ fontWeight: "400" }}>47862</Typography>
180
+            <Typography variant="body2" sx={{ fontWeight: "400", mb: 5 }}>USA</Typography>
181
+            <Link sx={{ color: "black", textDecoration: "underline", fontSize: 15 }}>CHANGE SHIPPING ADDRESS</Link>
182
+          </Box>
183
+        </Grid>
184
+        <Grid size={6}>
185
+          <Typography variant="body2" sx={{ fontWeight: "bold", mb: 5 }}>BILLING ADDRESS</Typography>
186
+          <Box sx={{ display: "flex", flexDirection: "column" }}>
187
+            <Typography variant="body2" sx={{ fontWeight: "400" }}>Mr. David Olson</Typography>
188
+            <Typography variant="body2" sx={{ fontWeight: "400" }}>4220 Raintree Boulevard</Typography>
189
+            <Typography variant="body2" sx={{ fontWeight: "400" }}>Montezuma</Typography>
190
+            <Typography variant="body2" sx={{ fontWeight: "400" }}>Indiana</Typography>
191
+            <Typography variant="body2" sx={{ fontWeight: "400" }}>47862</Typography>
192
+            <Typography variant="body2" sx={{ fontWeight: "400", mb: 5 }}>USA</Typography>
193
+            <Link sx={{ color: "black", textDecoration: "underline", fontSize: 15 }}>CHANGE SHIPPING ADDRESS</Link>
194
+          </Box>
195
+        </Grid>
196
+      </Grid>
197
+
198
+      {/* Delivery Data */}
199
+      <Typography variant='body1' sx={{ fontWeight: "500", my: 5 }}>3. DELIVERY METHOD</Typography>
200
+      <Grid container sx={{
201
+        backgroundColor: "#F7FBFF",
202
+        borderTop: "1px solid rgba(0,0,0,0.1)",
203
+        borderBottom: "1px solid rgba(0,0,0,0.1)",
204
+        p: 2,
205
+        mb: 10
206
+      }}>
207
+        <Grid size={6}>
208
+          <Typography variant="body2" sx={{ fontWeight: "bold", mb: 5 }}>EXPRESS DELIVERY (Free)</Typography>
209
+          <Box sx={{ display: "flex", flexDirection: "column" }}>
210
+            <Typography variant="body2" sx={{ fontWeight: "400" }}>Delivered in 3-4 business days</Typography>
211
+          </Box>
212
+        </Grid>
213
+        <Grid size={6}>
214
+          <Typography variant="body2" sx={{ fontWeight: "bold", mb: 5 }}>BILLING ADDRESS</Typography>
215
+          <Box sx={{ display: "flex", flexDirection: "column" }}>
216
+            <Typography variant="body2" sx={{ fontWeight: "400", mb: 5 }}>Caibre Premium Packaging</Typography>
217
+            <Link sx={{ color: "black", textDecoration: "underline", fontSize: 15 }}>GIFT MESSAGE & PERSONALISED LABELS AVAILABLE</Link>
218
+          </Box>
219
+        </Grid>
220
+      </Grid>
221
+
222
+      {/* PAYMENT Data */}
223
+      <Typography variant='body1' sx={{ fontWeight: "500", my: 5 }}>4. PAYMENT DETAILS</Typography>
224
+      <Grid container sx={{
225
+        backgroundColor: "#F7FBFF",
226
+        borderTop: "1px solid rgba(0,0,0,0.1)",
227
+        borderBottom: "1px solid rgba(0,0,0,0.1)",
228
+        p: 2,
229
+        mb: 5
230
+      }}>
231
+        <Grid size={6}>
232
+          <Typography variant="body2" sx={{ fontWeight: "400", mb: 5 }}>PAYMENT METHOD</Typography>
233
+          <Grid container spacing={2}>
234
+
235
+            {/* PAYMENT METHOD */}
236
+            <Grid item size={12}>
237
+              <Box>
238
+                <Typography variant="body2" sx={{ fontWeight: "500", mb: 2 }}>
239
+                  PAYMENT METHOD
240
+                </Typography>
241
+                <RadioGroup row>
242
+                  <FormControlLabel
243
+                    value="credit"
244
+                    control={<Radio />}
245
+                    label={
246
+                      <Box sx={{ display: "flex", alignItems: "center", gap: 1 }}>
247
+                        <CreditCardIcon />
248
+                      </Box>
249
+                    }
250
+                  />
251
+                  <FormControlLabel
252
+                    value="wallet"
253
+                    control={<Radio />}
254
+                    label={
255
+                      <Box sx={{ display: "flex", alignItems: "center", gap: 1 }}>
256
+                        <AccountBalanceWalletIcon />
257
+                      </Box>
258
+                    }
259
+                  />
260
+                </RadioGroup>
261
+              </Box>
262
+            </Grid>
263
+
264
+            {/* Cardholder Name Input */}
265
+            <Grid item size={12}>
266
+              <Box>
267
+                <Typography variant="body2" sx={{ fontWeight: "500", mb: 2 }}>
268
+                  CARDHOLDER NAME
269
+                </Typography>
270
+                <TextField
271
+                  variant="outlined"
272
+                  sx={{
273
+                    width: "100%",
274
+                    backgroundColor: "#FFF",
275
+                  }}
276
+                />
277
+              </Box>
278
+            </Grid>
279
+
280
+            {/* Card Number Input */}
281
+            <Grid item size={12}>
282
+              <Box>
283
+                <Typography variant="body2" sx={{ fontWeight: "500", mb: 2 }}>
284
+                  CARD NUMBER
285
+                </Typography>
286
+                <Box
96 287
                   sx={{
97
-                    '& td, & th': { border: 0 },
98
-                    '&:last-child td, &:last-child th': { border: 0 }
288
+                    display: "flex",
289
+                    flexDirection: "row",
290
+                    gap: 1,
99 291
                   }}
100 292
                 >
101
-                  <TableCell component="th" scope="row">
102
-                    <img
103
-                      src={row.img_src}
104
-                      alt={row.img_src}
105
-                      style={{
106
-                        width: 100,
107
-                        height: 100,
108
-                        aspectRatio: '4 / 4',
109
-                        objectFit: 'cover',
293
+                  {[...Array(4)].map((_, index) => (
294
+                    <TextField
295
+                      key={index}
296
+                      variant="outlined"
297
+                      inputProps={{ maxLength: 4 }}
298
+                      sx={{
299
+                        width: "100px",
300
+                        backgroundColor: "#FFF",
301
+                        textAlign: "center",
110 302
                       }}
111 303
                     />
112
-                  </TableCell>
113
-                  <TableCell>
114
-                    <Typography variant='body2' sx={{ fontWeight: "bold", mb: 1 }}>{row.name}</Typography>
115
-                    <Typography variant='body2'>{row.description}</Typography>
116
-                  </TableCell>
117
-                  <TableCell align='center'>
118
-                    <Typography variant='body1' sx={{ fontWeight: "bold" }} >{row.colour}</Typography>
119
-                  </TableCell>
120
-                  <TableCell align='center'>
121
-                  <Typography variant='body1' sx={{ fontWeight: "bold" }}>{row.quantity}</Typography>
122
-                  </TableCell>
123
-                  <TableCell align='center'>
124
-                    <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
125
-                  </TableCell>
126
-                  <TableCell align='center'>
127
-                    <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
128
-                  </TableCell>
129
-                  <TableCell align='center'>
130
-                    <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
131
-                  </TableCell>
132
-                  <TableCell align='center'>
133
-                    <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
134
-                  </TableCell>
135
-                </TableRow>
136
-              ))}
137
-            </TableBody>
138
-          </Table>
139
-        </TableContainer>
304
+                  ))}
305
+                </Box>
306
+              </Box>
307
+            </Grid>
308
+
309
+
310
+
311
+
312
+            {/* Expiration Date Input */}
313
+            <Grid item size={12}>
314
+              <Box>
315
+                <Typography variant="body2" sx={{ fontWeight: "500", mb: 2 }}>
316
+                  EXPIRATION DATE
317
+                </Typography>
318
+                <Box>
319
+                  <Grid container spacing={2}>
320
+                    <Grid item size={6}>
321
+                      <TextField
322
+                        select
323
+                        fullWidth
324
+                        variant="outlined"
325
+                        defaultValue={1}
326
+                        sx={{ backgroundColor: "#FFF" }}
327
+                      >
328
+                        {[...Array(12)].map((_, index) => (
329
+                          <MenuItem key={index} value={index + 1}>
330
+                            {index + 1}
331
+                          </MenuItem>
332
+                        ))}
333
+                      </TextField>
334
+                    </Grid>
335
+                    <Grid item size={3}>
336
+                      <TextField
337
+                        select
338
+                        fullWidth
339
+                        variant="outlined"
340
+                        defaultValue={2023}
341
+                        sx={{ backgroundColor: "#FFF" }}
342
+                      >
343
+                        {[...Array(10)].map((_, index) => (
344
+                          <MenuItem key={index} value={2023 + index}>
345
+                            {2023 + index}
346
+                          </MenuItem>
347
+                        ))}
348
+                      </TextField>
349
+                    </Grid>
350
+                    <Grid item size={3}>
351
+                      <TextField
352
+                        variant="outlined"
353
+                        inputProps={{ maxLength: 4 }}
354
+                        sx={{ backgroundColor: "#FFF" }}
355
+                      />
356
+                    </Grid>
357
+                  </Grid>
358
+                </Box>
359
+              </Box>
360
+            </Grid>
361
+
362
+            {/* Securely Store Payment Details */}
363
+            <Grid item size={12}>
364
+              <Box>
365
+                <FormControlLabel
366
+                  control={<Checkbox />}
367
+                  label="Securely store payment details for next purchase."
368
+                />
369
+              </Box>
370
+            </Grid>
371
+
372
+          </Grid>
373
+        </Grid>
374
+      </Grid>
375
+
376
+      <Box sx={{display:"flex", flexDirection:"row"}}>
377
+        <Button
378
+          variant="contained"
379
+          color="common.black"
380
+          onClick={() => { window.location.href = "/checkout" }}
381
+          sx={{
382
+            backgroundColor: (theme) => theme.palette.common.black,
383
+            color: "white",
384
+            textTransform: "none",
385
+            ml: "auto",
386
+            px: 8,
387
+            py: 2,
388
+            width: "fit-content",
389
+            "&:hover": {
390
+              backgroundColor: (theme) => theme.palette.grey[900],
391
+            },
392
+          }}>CONFIRM PURCHASE</Button>
393
+      </Box>
140 394
 
141 395
     </Box>
142 396
   );

+ 222
- 0
src/components/ConfirmOrder/ConfirmOrder.jsx Прегледај датотеку

@@ -0,0 +1,222 @@
1
+import React, { useState } from 'react';
2
+import {
3
+  Box,
4
+  Button,
5
+  Typography,
6
+  Link,
7
+} from '@mui/material';
8
+import Table from '@mui/material/Table';
9
+import TableBody from '@mui/material/TableBody';
10
+import TableCell from '@mui/material/TableCell';
11
+import TableContainer from '@mui/material/TableContainer';
12
+import TableHead from '@mui/material/TableHead';
13
+import TableRow from '@mui/material/TableRow';
14
+import Grid from '@mui/material/Grid2';
15
+import ProductSuggestion from '../../components/ProductSuggestion';
16
+import FiberManualRecordIcon from '@mui/icons-material/FiberManualRecord';
17
+
18
+
19
+
20
+const ConfirmOrder = () => {
21
+
22
+  const rows = [
23
+    {
24
+      img_src: 'https://via.placeholder.com/300',
25
+      name: 'MELUR',
26
+      description: 'Atma Sari New Raya Collection 2024',
27
+      colour: 'black',
28
+      quantity: 1,
29
+      price: 335.50
30
+    }
31
+  ];
32
+
33
+  const [shippingMethod, setShippingMethod] = useState('COD');
34
+
35
+  const handleSubmit = (e) => {
36
+    e.preventDefault();
37
+    // Handle form submission logic
38
+    console.log('Form submitted');
39
+  };
40
+
41
+  const FieldContainer = ({ label, children }) => (
42
+    <Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
43
+      <Typography variant="body1" sx={{ fontWeight: 500, minWidth: 120 }}>
44
+        {label}
45
+      </Typography>
46
+      {children}
47
+    </Box>
48
+  );
49
+
50
+  return (
51
+    <Box
52
+
53
+      onSubmit={handleSubmit}
54
+      sx={{
55
+        width: '100%',
56
+      }}
57
+    >
58
+      <Box sx={{ mt: 5, mb: 3 }}>
59
+        <Typography variant='body1' sx={{ fontWeight: "500", mb: 3 }}>THANK YOU MR. OLSON</Typography>
60
+        <Typography variant='body2'>Thank you for your order. Your order number is 347982. <br />A confirmation email has also been sent to the email address provided.</Typography>
61
+      </Box>
62
+
63
+      {/* Product TableList */}
64
+      <Typography variant='body1' sx={{ fontWeight: "500", my: 5 }}>ORDER CONFIRMATION</Typography>
65
+
66
+      <TableContainer>
67
+        <Table sx={{ minWidth: 650, backgroundColor: "#F7FBFF" }}>
68
+          <TableHead>
69
+            <TableRow>
70
+              <TableCell width={150}>
71
+                <Typography variant='body1'>Item</Typography>
72
+              </TableCell>
73
+              <TableCell width={150}>
74
+                {/* This is just for table offset */}
75
+                <Typography variant='body1'></Typography>
76
+              </TableCell>
77
+              <TableCell align='center'>
78
+                <Typography variant='body1'>Colour</Typography>
79
+              </TableCell>
80
+              <TableCell align='center'>
81
+
82
+                <Typography variant='body1'>Quantity</Typography>
83
+              </TableCell>
84
+              <TableCell align='center'>
85
+                <Typography variant='body1'>Unit Price</Typography>
86
+              </TableCell>
87
+              <TableCell align='center'>
88
+                <Typography variant='body1'>Shipping</Typography>
89
+              </TableCell>
90
+              <TableCell align='center'>
91
+                <Typography variant='body1'>Tax</Typography>
92
+              </TableCell>
93
+              <TableCell align='center'>
94
+                <Typography variant='body1'>Duties</Typography>
95
+              </TableCell>
96
+            </TableRow>
97
+          </TableHead>
98
+          <TableBody>
99
+            {rows.map((row) => (
100
+              <TableRow
101
+                key={row.id}
102
+                sx={{
103
+                  '& td, & th': { border: 0 },
104
+                  '&:last-child td, &:last-child th': { border: 0 }
105
+                }}
106
+              >
107
+                <TableCell component="th" scope="row">
108
+                  <img
109
+                    src={row.img_src}
110
+                    alt={row.img_src}
111
+                    style={{
112
+                      width: 100,
113
+                      height: 100,
114
+                      aspectRatio: '4 / 4',
115
+                      objectFit: 'cover',
116
+                    }}
117
+                  />
118
+                </TableCell>
119
+                <TableCell>
120
+                  <Typography variant='body2' sx={{ fontWeight: "bold", mb: 1 }}>{row.name}</Typography>
121
+                  <Typography variant='body2'>{row.description}</Typography>
122
+                </TableCell>
123
+                <TableCell align='center'>
124
+                  <Typography variant='body1' sx={{ fontWeight: "bold" }} >{row.colour}</Typography>
125
+                </TableCell>
126
+                <TableCell align='center'>
127
+                  <Typography variant='body1' sx={{ fontWeight: "bold" }}>{row.quantity}</Typography>
128
+                </TableCell>
129
+                <TableCell align='center'>
130
+                  <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
131
+                </TableCell>
132
+                <TableCell align='center'>
133
+                  <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
134
+                </TableCell>
135
+                <TableCell align='center'>
136
+                  <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
137
+                </TableCell>
138
+                <TableCell align='center'>
139
+                  <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
140
+                </TableCell>
141
+              </TableRow>
142
+            ))}
143
+          </TableBody>
144
+        </Table>
145
+        <Box sx={{
146
+          backgroundColor: "#F7FBFF",
147
+          borderTop: "1px solid rgba(0,0,0,0.1)",
148
+          borderBottom: "1px solid rgba(0,0,0,0.1)",
149
+          pl: 2,
150
+          pr: 6,
151
+          py: 2,
152
+          mb: 5,
153
+          display: "flex",
154
+          justifyContent: "space-between"
155
+
156
+        }}>
157
+          <Link variant='body2' sx={{ textDecoration: "underline", color: "#000", fontWeight: "200", letterSpacing: 1 }}>ADD A GIFT CARD OR PROMOTION CODE</Link>
158
+          <Typography variant='body2'> Total <span style={{ fontWeight: "bold" }}>{`RM ${parseFloat(250).toFixed(2)}`}</span> </Typography>
159
+        </Box>
160
+      </TableContainer>
161
+
162
+      <Box>
163
+        <Grid container>
164
+          <Grid size={6} sx={{ borderRight: "1px solid rgba(0,0,0,0.2)" }}>
165
+            <Typography variant='body1' sx={{ fontWeight: "500", mb: 5 }}>PAYMENT METHOD</Typography>
166
+            <Box sx={{ display: "flex", flexDirection: "row" }}>
167
+              <Typography variant='body2' sx={{ mr: 5 }}>PAYMENT METHOD</Typography>
168
+              <Typography variant="body2" sx={{ display: 'flex' }}>
169
+                {[...Array(12)].map((_, index) => (
170
+                  <FiberManualRecordIcon sx={{ fontSize: 'inherit', verticalAlign: 'middle', mr: ((index + 1) % 4 == 0) ? 2 : 0 }} />
171
+                ))}
172
+                <span>0046</span>
173
+              </Typography>
174
+            </Box>
175
+          </Grid>
176
+          <Grid size={6}>
177
+            <Typography variant='body1' sx={{ fontWeight: "500", mb: 5 }}>SHIPPING DETAILS</Typography>
178
+            <Button
179
+              variant="contained"
180
+              color="common.black"
181
+              onClick={() => { window.location.href = "/checkout" }}
182
+              sx={{
183
+                backgroundColor: (theme) => theme.palette.common.black,
184
+                color: "white",
185
+                textTransform: "none",
186
+                px: 8,
187
+                py: 2,
188
+                width: "fit-content",
189
+                "&:hover": {
190
+                  backgroundColor: (theme) => theme.palette.grey[900],
191
+                },
192
+              }}>TRACK ORDER</Button>
193
+
194
+          </Grid>
195
+        </Grid>
196
+      </Box>
197
+
198
+      <Box sx={{
199
+        width: "100%",
200
+        borderTop: "1px solid rgba(0,0,0,0.2)",
201
+        borderBottom: "1px solid rgba(0,0,0,0.2)",
202
+        py: 4,
203
+        textAlign: "center"
204
+      }}>
205
+        <Typography variant='body1' sx={{ fontWeight: "500", mb: 4 }}>
206
+          THE ESSENTIALS BASED ON YOUR LAST PURCHASE
207
+        </Typography>
208
+
209
+        <ProductSuggestion />
210
+
211
+      </Box>
212
+
213
+      <Typography variant='body2' sx={{ mb: 4, color: "#AEAEAE", letterSpacing: 1, textAlign:"center", mt:3, mb:6 }}>
214
+        <span style={{ color: "#000", fontWeight: "bold" }}>NEED HELP?</span> CALL US: +44 (0)10 2345 6789 | EMAIL CUSTOMER CARE | SHIPPING INFORMATION | RETURNS & EXCHANGES
215
+      </Typography>
216
+
217
+
218
+    </Box>
219
+  );
220
+};
221
+
222
+export default ConfirmOrder;

+ 1
- 0
src/components/ConfirmOrder/index.js Прегледај датотеку

@@ -0,0 +1 @@
1
+export { default } from './ConfirmOrder'

+ 1
- 0
src/components/ProductDetails/ProductDetails.jsx Прегледај датотеку

@@ -83,6 +83,7 @@ const ProductDetails = () => {
83 83
           {/* Buy Now Button */}
84 84
           <Grid item size={12}>
85 85
             <Button
86
+              onClick={()=>{window.location.href ="/cart"}}
86 87
               variant="contained"
87 88
               color="common.black"
88 89
               fullWidth

+ 8
- 1
src/pages/Checkout.jsx Прегледај датотеку

@@ -5,7 +5,8 @@ import Feature from '../components/Feature'
5 5
 import LoginForm from '../components/LoginForm'
6 6
 import SignUpForm from '../components/SignUpForm'
7 7
 import ShippingForm from '../components/ShippingForm'
8
-import BillingForm from '../components/BillingForm/BillingForm'
8
+import BillingForm from '../components/BillingForm'
9
+import ConfirmOrder from '../components/ConfirmOrder'
9 10
 
10 11
 import Grid from '@mui/material/Grid2';
11 12
 
@@ -92,6 +93,12 @@ const Checkout = () => {
92 93
         </Grid>
93 94
       </Grid>}
94 95
 
96
+      {(content == 3) && <Grid container sx={{ mb: 5 }}>
97
+        <Grid item size={12}>
98
+          <ConfirmOrder/>
99
+        </Grid>
100
+      </Grid>}
101
+
95 102
 
96 103
       <SocialMedia />
97 104
       <Feature />

Loading…
Откажи
Сачувај