Skip to content

Commit

Permalink
Video-27-Create-Place-Order-Page-Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
basir committed Jul 17, 2021
1 parent cdba856 commit ef13cce
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pages/placeorder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext } from 'react';
import React, { useContext, useEffect } from 'react';
import dynamic from 'next/dynamic';
import Layout from '../components/Layout';
import { Store } from '../utils/Store';
Expand All @@ -24,6 +24,7 @@ import {
import axios from 'axios';
import { useRouter } from 'next/router';
import useStyles from '../utils/styles';
import CheckoutWizard from '../components/CheckoutWizard';

function PlaceOrder() {
const classes = useStyles();
Expand All @@ -40,8 +41,15 @@ function PlaceOrder() {
const taxPrice = round2(itemsPrice * 0.15);
const totalPrice = round2(itemsPrice + shippingPrice + taxPrice);

useEffect(() => {
if (!paymentMethod) {
router.push('/payment');
}
}, []);

return (
<Layout title="Shopping Cart">
<CheckoutWizard activeStep={3}></CheckoutWizard>
<Typography component="h1" variant="h1">
Place Order
</Typography>
Expand Down

0 comments on commit ef13cce

Please sign in to comment.