Skip to content

Commit 7ab3b20

Browse files
authored
Merge pull request #149 from w3bdesign/development
You can now place orders through Woocommerce!
2 parents 14f0927 + 0b231ee commit 7ab3b20

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Next.js Ecommerce site with Woocommerce backend
44

5-
## This is still a work in progress
5+
## This is still a work in progress, but you can place orders and add products to cart.
66

77
Live url: <a href="https://nextjs-woocommerce.now.sh/">https://nextjs-woocommerce.now.sh/</a>
88

@@ -22,7 +22,8 @@ Start the server with ```npm run dev ```
2222
## Features
2323

2424
- Connect to Woocommerce GraphQL API and list name, price and display image for products
25-
- Cart handling with createContext
25+
- Cart handling with createContext and GraphQL mutations
26+
- Able to place orders remotely with Woocommerce (bank transfers only for now)
2627
- Algolia search (work in progress)
2728
- Apollo Client with GraphQL
2829
- Animations with React-Spring
@@ -34,15 +35,15 @@ Start the server with ```npm run dev ```
3435
- Pretty URLs with builtin Nextjs functionality
3536
- Tailwind CSS for styling
3637
- Minimalistic and responsive design
37-
- JSDoc comments on all functions
38-
- Currently connected to live Woocommerce installation instead of using a local installation
38+
- JSDoc comments
39+
- Currently connected to a local installation
3940

4041
## TODO
4142

4243
- Add more cart functionality
4344
- Add checkout functionality
4445
- Hide products not in stock
4546
- Add better SEO
46-
- Add price to Algolia search
47+
- Add price to Algolia search (Wordpress plugin has been developed)
4748
- Add a better README.md
4849
- Implement https://github.com/cyrilwanner/next-optimized-images for production

components/Checkout/CheckoutForm.component.jsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useState, useContext, useEffect } from 'react';
22
import { useQuery, useMutation } from '@apollo/react-hooks';
33

44
import Billing from './Billing.component';
5-
import Payment from "./Payment.component";
5+
import Payment from './Payment.component';
66

77
import { GET_CART } from 'utils/const/GQL_QUERIES';
88
import { CHECKOUT_MUTATION } from 'utils/const/GQL_MUTATIONS';
@@ -106,12 +106,10 @@ const CheckoutForm = () => {
106106
<h2 className="">Betalingsdetaljer</h2>
107107
<Billing input={input} handleOnChange={handleOnChange} />
108108
</div>
109-
110109
{/*Payment*/}
111110
<div className="">
112-
<Payment input={ input } handleOnChange={ handleOnChange }/>
113-
</div>
114-
111+
<Payment input={input} handleOnChange={handleOnChange} />
112+
</div>
115113
<div>
116114
<button
117115
className="px-4 py-2 font-bold bg-white border border-gray-400 border-solid rounded hover:bg-gray-400"
@@ -120,14 +118,14 @@ const CheckoutForm = () => {
120118
BESTILL
121119
</button>
122120
</div>
123-
121+
//TODO Add error handling here
124122
{/* Checkout Loading*/}
125123
{
126-
//checkoutLoading && <p>Behandler ordre ...</p>
124+
//checkoutLoading && <p>Behandler ordre ...</p>
127125
}
128126
{
129-
//requestError && <p>Feilmelding: {requestError} </p>
130-
}
127+
//requestError && <p>Feilmelding: {requestError} </p>
128+
}
131129
</div>
132130
</form>
133131
) : (

0 commit comments

Comments
 (0)