Skip to content

Commit 370ffbe

Browse files
committed
Start work on implementing Swiper
1 parent 94298d6 commit 370ffbe

File tree

7 files changed

+173
-145
lines changed

7 files changed

+173
-145
lines changed

CODE_OF_CONDUCT.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
3333

3434
## Our Responsibilities
3535

@@ -68,9 +68,9 @@ members of the project's leadership.
6868
## Attribution
6969

7070
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
71+
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
7272

7373
[homepage]: https://www.contributor-covenant.org
7474

7575
For answers to common questions about this code of conduct, see
76-
https://www.contributor-covenant.org/faq
76+
<https://www.contributor-covenant.org/faq>

CONTRIBUTING.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ Please note we have a code of conduct, please follow it in all your interactions
77

88
## Pull Request Process
99

10-
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
11-
build.
12-
2. Update the README.md with details of changes to the interface, this includes new environment
13-
variables, exposed ports, useful file locations and container parameters.
14-
3. Increase the version numbers in any examples files and the README.md to the new version that this
15-
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
16-
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
17-
do not have permission to do that, you may request the second reviewer to merge it for you.
10+
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
11+
build.
12+
2. Update the README.md with details of changes to the interface, this includes new environment
13+
variables, exposed ports, useful file locations and container parameters.
14+
3. Increase the version numbers in any examples files and the README.md to the new version that this
15+
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
16+
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
17+
do not have permission to do that, you may request the second reviewer to merge it for you.
1818

1919
## Code of Conduct
2020

@@ -32,22 +32,22 @@ orientation.
3232
Examples of behavior that contributes to creating a positive environment
3333
include:
3434

35-
* Using welcoming and inclusive language
36-
* Being respectful of differing viewpoints and experiences
37-
* Gracefully accepting constructive criticism
38-
* Focusing on what is best for the community
39-
* Showing empathy towards other community members
35+
- Using welcoming and inclusive language
36+
- Being respectful of differing viewpoints and experiences
37+
- Gracefully accepting constructive criticism
38+
- Focusing on what is best for the community
39+
- Showing empathy towards other community members
4040

4141
Examples of unacceptable behavior by participants include:
4242

43-
* The use of sexualized language or imagery and unwelcome sexual attention or
44-
advances
45-
* Trolling, insulting/derogatory comments, and personal or political attacks
46-
* Public or private harassment
47-
* Publishing others' private information, such as a physical or electronic
48-
address, without explicit permission
49-
* Other conduct which could reasonably be considered inappropriate in a
50-
professional setting
43+
- The use of sexualized language or imagery and unwelcome sexual attention or
44+
advances
45+
- Trolling, insulting/derogatory comments, and personal or political attacks
46+
- Public or private harassment
47+
- Publishing others' private information, such as a physical or electronic
48+
address, without explicit permission
49+
- Other conduct which could reasonably be considered inappropriate in a
50+
professional setting
5151

5252
### Our Responsibilities
5353

@@ -89,4 +89,5 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], versi
8989
available at [http://contributor-covenant.org/version/1/4][version]
9090

9191
[homepage]: http://contributor-covenant.org
92+
9293
[version]: http://contributor-covenant.org/version/1/4/

README.md

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,59 +9,64 @@
99

1010
# This is currently a work in progress!
1111

12-
1. Install and activate the following required plugins, in your WordPress plugin directory:
12+
1. Install and activate the following required plugins, in your WordPress plugin directory:
1313

14-
- [woocommerce](https://wordpress.org/plugins/woocommerce) Ecommerce for WordPress.
15-
- [wp-graphql](https://wordpress.org/plugins/wp-graphql) Exposes GraphQL for WordPress.
16-
- [wp-graphql-woocommerce](https://github.com/wp-graphql/wp-graphql-woocommerce) Adds WooCommerce functionality to a WPGraphQL schema.
17-
- [algolia-woo-indexer](https://github.com/w3bdesign/algolia-woo-indexer) Sends WooCommerce products to Algolia. Required for search to work.
18-
- [wp-graphql-cors](https://github.com/funkhaus/wp-graphql-cors) Ensures that CORS works correctly. Remember to add the domain to the store under `Extend "Access-Control-Allow-Origin” header`
14+
- [woocommerce](https://wordpress.org/plugins/woocommerce) Ecommerce for WordPress.
15+
- [wp-graphql](https://wordpress.org/plugins/wp-graphql) Exposes GraphQL for WordPress.
16+
- [wp-graphql-woocommerce](https://github.com/wp-graphql/wp-graphql-woocommerce) Adds WooCommerce functionality to a WPGraphQL schema.
17+
- [algolia-woo-indexer](https://github.com/w3bdesign/algolia-woo-indexer) Sends WooCommerce products to Algolia. Required for search to work.
18+
- [wp-graphql-cors](https://github.com/funkhaus/wp-graphql-cors) Ensures that CORS works correctly. Remember to add the domain to the store under `Extend "Access-Control-Allow-Origin” header`
1919

2020
Optional plugin:
2121

22-
- [headless-wordpress](https://github.com/w3bdesign/headless-wp) Disables the frontend so only the backend is accessible. (optional)
22+
- [headless-wordpress](https://github.com/w3bdesign/headless-wp) Disables the frontend so only the backend is accessible. (optional)
2323

2424
The current release has been tested and is confirmed working with the following versions:
2525

26-
- WordPress version 5.6.0
27-
- WooCommerce version 4.9.0
28-
- WP GraphQL version 1.1.2
29-
- WooGraphQL version 0.6.1 (latest development version)
30-
- WPGraphQL CORS version 1.1.0 (with introspection enabled)
26+
- WordPress version 5.6.0
27+
- WooCommerce version 4.9.0
28+
- WP GraphQL version 1.1.2
29+
- WooGraphQL version 0.6.1 (latest development version)
30+
- WPGraphQL CORS version 1.1.0 (with introspection enabled)
3131

32-
2. For debugging and testing, install either:
32+
2. For debugging and testing, install either:
3333

34-
https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/ (Firefox)
34+
<https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/> (Firefox)
3535

36-
https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm (Chrome)
36+
<https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm> (Chrome)
3737

38-
Rename .env.example to .env so the Apollo debugger will correctly load. It will not load if the NODE_ENV variable is not correctly set.
38+
Rename .env.example to .env so the Apollo debugger will correctly load. It will not load if the NODE_ENV variable is not correctly set.
3939

40-
3. Make sure WooCommerce has some products already or import some sample products
40+
3. Make sure WooCommerce has some products already or import some sample products
4141

42-
The WooCommerce sample products CSV file is available at `wp-content/plugins/woocommerce/sample-data/sample_products.csv` or [Sample products](sample_products/)
42+
The WooCommerce sample products CSV file is available at `wp-content/plugins/woocommerce/sample-data/sample_products.csv` or [Sample products](sample_products/)
4343

44-
Import the products at `WP Dashboard > Tools > Import > WooCommerce products(CSV)`
44+
Import the products at `WP Dashboard > Tools > Import > WooCommerce products(CSV)`
4545

46-
4. Clone or fork the repo and modify `.env` with the URL to the GraphQL endpoint (or set environment variables in the configuration UI for your deployment solution)
47-
5. Start the server with `npm run dev`
48-
6. Enable COD (Cash On Demand) payment method in WooCommerce
49-
7. Add a product to the cart
50-
8. Proceed to checkout
51-
9. Fill in your details and place the order
46+
4. Clone or fork the repo and modify `.env` with the URL to the GraphQL endpoint (or set environment variables in the configuration UI for your deployment solution)
47+
48+
5. Start the server with `npm run dev`
49+
50+
6. Enable COD (Cash On Demand) payment method in WooCommerce
51+
52+
7. Add a product to the cart
53+
54+
8. Proceed to checkout
55+
56+
9. Fill in your details and place the order
5257

5358
## Features
5459

55-
- NuxtJS
56-
- Tailwind CSS
57-
- Vue Apollo with GraphQL Codegen
58-
- Responsive design
59-
- Support for simple products
60-
- GraphQL-based filters
61-
- CSS animations and transitions
62-
- Form handling and validation with Vue Formulate
63-
- Checkout process
64-
- Animated mobile menu
60+
- NuxtJS
61+
- Tailwind CSS
62+
- Vue Apollo with GraphQL Codegen
63+
- Responsive design
64+
- Support for simple products
65+
- GraphQL-based filters
66+
- CSS animations and transitions
67+
- Form handling and validation with Vue Formulate
68+
- Checkout process
69+
- Animated mobile menu
6570

6671
## Troubleshooting
6772

@@ -75,7 +80,7 @@ Check the attributes of the products. Right now the application requires Size an
7580

7681
## TODO
7782

78-
- Look into variable product support
79-
- Make WooCommerce session token expire and get deleted after 24 hours
80-
- Finish implementing Algolia search
81-
- Make Algolia look good on mobile
83+
- Look into variable product support
84+
- Make WooCommerce session token expire and get deleted after 24 hours
85+
- Finish implementing Algolia search
86+
- Make Algolia look good on mobile

components/Cart/ShowCartContents.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default {
7979
result({ data, loading, networkStatus }) {
8080
const cartIsReady = data && networkStatus === 7
8181
82-
if (cartIsReady) {
82+
if (cartIsReady && !loading) {
8383
this.loading = false
8484
this.remoteCart = data
8585
this.subTotal = data.cart.total
@@ -118,7 +118,7 @@ export default {
118118
},
119119
},
120120
})
121-
.then(({ data }) => {
121+
.then(() => {
122122
this.removingCartItem = false
123123
this.$apollo.queries.cart.refetch()
124124
})

components/Header/Cart.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default {
5252
pollInterval: process.server ? undefined : 2000,
5353
result({ data, loading, networkStatus }) {
5454
const cartIsReady = networkStatus === 7
55-
if (cartIsReady) {
55+
if (cartIsReady && !loading) {
5656
this.remoteCart = data
5757
this.subTotal = data.cart.total
5858
this.cartLength = data.cart.contents.nodes.reduce(
@@ -68,10 +68,11 @@ export default {
6868
if (debug) {
6969
console.error(error)
7070
}
71+
7172
// Check if we are in the browser before checking localStorage
7273
// Will refresh the page to refetch the session from WooCommerce
7374
if (process.browser && !localStorage.getItem('woo-session')) {
74-
window.location.reload(true)
75+
this.$router.push({ path: '/', force: true })
7576
}
7677
},
7778
},

0 commit comments

Comments
 (0)