Skip to content

Commit f55d3bc

Browse files
authored
Merge pull request #70 from imranhsayed/feature/add-dynamic-location
Feature/add dynamic location
2 parents 77476dd + 876d349 commit f55d3bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+5945
-714
lines changed

README.md

+10-20
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ branch is upto date with those changes. You can also refer to the PR notes for c
3333

3434
# Features:
3535

36-
1. WooCommerce Store in React( contains: Products Page, Single Product Page, AddToCart, CartPage and Checkout Page ).
36+
1. WooCommerce Store in React( contains: Products Page, Single Product Page, AddToCart, CartPage and Checkout Page with country selection ).
3737
2. SSR
3838
3. SEO friendly
3939
4. Automatic Code Splitting
@@ -59,54 +59,44 @@ These instructions will get you a copy of the project up and running on your loc
5959

6060
1. Download and activate the following plugins , in your WordPress plugin directory:
6161

62-
* [wp-graphql](https://github.com/imranhsayed/woo-next/tree/master/wordpress/plugins) Exposes graphql for WordPress ( **Tested with v-0.8.0** of this plugin )
63-
* [wp-graphql-woocommerce](https://github.com/imranhsayed/woo-next/tree/master/wordpress/plugins) Adds Woocommerce functionality to a WPGraphQL schema ( **Tested with v-0.5.0** of this plugin )
62+
* [wp-graphql](https://github.com/imranhsayed/woo-next/tree/master/wordpress/plugins) Exposes graphql for WordPress ( **Tested with v-1.3.8** of this plugin )
63+
* [wp-graphql-woocommerce](https://github.com/imranhsayed/woo-next/tree/master/wordpress/plugins) Adds Woocommerce functionality to a WPGraphQL schema ( **Tested with v-0.8.1** of this plugin )
64+
* [headless-cms](https://github.com/imranhsayed/woo-next/tree/master/wordpress/plugins) Extends WPGraphQL Schema ( **Tested with v-1.8.0** of this plugin )
6465

6566
* Make sure Woocommerce plugin is also installed in your WordPress site. You can also import default wooCommerce products that come with wooCommerce Plugin for development ( if you don't have any products in your WordPress install ) `WP Dashboard > Tools > Import > WooCommerce products(CSV)`: The WooCommerce default products csv file is available at `wp-content/plugins/woocommerce/sample-data/sample_products.csv`
6667

6768
## Hero Carousel.
6869
To use Hero carousel, create a category called 'offers' from WordPress Dashboard > Products > Categories.
6970
Now create and assign as many child categories to this parent 'offers' category with name, description and image.
70-
These Child categories data will automatically be used to create hero carousel on the frontend.
71+
These Child categories data will automatically be used to create hero carousel on the frontend.
7172

7273

7374
## Configuration(for GraphQL implementation) :wrench:
7475

7576
* _Note_ Below is for GraphQL implementation , for REST API check [feature/rest-api](https://github.com/imranhsayed/woo-next/tree/feature/rest-api) branch
7677

77-
1. (Required) Create a `.env` file taking reference from `.env-example` and update your WordPressSite URL.
78-
2. (optional) You can update your productImagePlaceholder, singleImagePlaceholder in `client-config.js`
79-
80-
```ruby
81-
const clientConfig = {
82-
productImagePlaceholder: 'https://via.placeholder.com/800', // e.g https://via.placeholder.com/434 - Placeholder image URL for index page
83-
singleImagePlaceholder: 'https://via.placeholder.com/200', // e.g https://via.placeholder.com/200 - Placeholder image URL for individual product page
84-
};
85-
86-
export default clientConfig;
87-
```
78+
1. (Required) Create a `.env` file taking reference from `.env-example` and update your WordPressSite URL.
79+
- `NEXT_PUBLIC_WORDPRESS_URL=https://example.com`
8880

8981
## Branch details
9082

9183
1. [feature/rest-api](https://github.com/imranhsayed/woo-next/tree/feature/rest-api) Contains REST API Implementation.
9284

93-
2. The `master` branch has the GraphQL implementation.
85+
2. The `master` branch has the GraphQL implementation.
9486

9587
## Common Commands :computer:
9688

9789
* `dev` Runs server in development mode
9890

9991
## Code Contributors ✰
10092

101-
Thanks to all the people who contributed to the code of this project 🤝
93+
Thanks to all the people who contributed to the code of this project 🤝
10294

10395
<div>
10496
<img src="https://github.com/imranhsayed.png?size=30" alt="Imran Sayed">
10597
<img src="https://github.com/w3bdesign.png?size=30" alt="Daniel F">
10698
<img src="https://github.com/delunix.png?size=30" alt="Fandi Rahmawan">
10799
<img src="https://github.com/yudyananda.png?size=30" alt="yudyananda">
108-
<img src="https://github.com/mahvash-fatima.png?size=30" alt="mahvash-fatima">
109-
<img src="https://github.com/muhaimincs.png?size=30" alt="muhaimincs">
110100
</div>
111101

112102

@@ -116,7 +106,7 @@ Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c6
116106

117107
## Versioning :bookmark_tabs:
118108

119-
I use [Git](https://github.com/) for versioning.
109+
I use [Git](https://github.com/) for versioning.
120110

121111
## Author :bust_in_silhouette:
122112

client-config.js

-6
This file was deleted.

next.config.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
21
const path = require("path");
2+
const allowedImageWordPressDomain = new URL(process.env.NEXT_PUBLIC_WORDPRESS_URL).hostname
3+
34
module.exports = {
45
trailingSlash: true,
56
webpackDevMiddleware: (config) => {
@@ -13,4 +14,12 @@ module.exports = {
1314
sassOptions: {
1415
includePaths: [path.join(__dirname, "styles")],
1516
},
17+
/**
18+
* We specify which domains are allowed to be optimized.
19+
* This is needed to ensure that external urls can't be abused.
20+
* @see https://nextjs.org/docs/basic-features/image-optimization#domains
21+
*/
22+
images: {
23+
domains: [ allowedImageWordPressDomain, 'via.placeholder.com' ],
24+
},
1625
};

0 commit comments

Comments
 (0)