Skip to content

Commit 3fb2b71

Browse files
committed
Hide checkout page if order has been marked as completed
1 parent a643cf1 commit 3fb2b71

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

components/Checkout/CheckoutForm.component.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const CheckoutForm = () => {
2222

2323
const [orderData, setOrderData] = useState(null);
2424
const [requestError, setRequestError] = useState(null);
25-
const [orderCompleted, setorderCompleted] = useState(false);
25+
const [orderCompleted, setorderCompleted] = useState(false);
2626

2727
// Checkout GraphQL mutation
2828
const [
@@ -70,7 +70,7 @@ const CheckoutForm = () => {
7070

7171
return (
7272
<>
73-
{cart ? (
73+
{cart && !orderCompleted ? (
7474
<div className="container mx-auto">
7575
{/* Order*/}
7676
<OrderDetails cart={cart} />

utils/config/nextConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const WOO_CONFIG = {
1717
GRAPHQL_URL: 'http://localhost/wp/graphql',
1818
ALGOLIA_APP_ID: '7L9M5Y0B1K',
1919
ALGOLIA_PUBLIC_API_KEY: '925cc92373120f1bf477bb8ce0e71649',
20+
ALGOLIA_INDEX_NAME: 'dfweb',
2021
};
2122

2223

0 commit comments

Comments
 (0)