You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your application should now be running on [http://localhost:3000](http://localhost:3000).
70
+
71
+
## WordPress Setup Guide
72
+
73
+
This guide will help you set up your WordPress site with WooCommerce and GraphQL for seamless integration. Follow the steps below carefully to ensure a successful configuration.
74
+
75
+
### Step 1: Install Required Plugins
76
+
77
+
To begin, make sure the following plugins are installed and activated on your WordPress site:
78
+
79
+
-[**WooCommerce**](https://woocommerce.com/): The essential plugin for creating an e-commerce store.
80
+
-[**WPGraphQL**](https://www.wpgraphql.com/): Enables GraphQL support for WordPress.
81
+
-[**WPGraphQL CORS**](https://github.com/funkhaus/wp-graphql-cors): Allows Cross-Origin Resource Sharing for WPGraphQL.
> **Tip:** You can install these plugins directly from the WordPress Plugin Repository or upload them manually if you have the plugin files.
85
+
86
+
### Step 2: Upload Product Data
87
+
88
+
To populate your WooCommerce store with product data, follow these steps:
89
+
90
+
1. Download the product data files from [this link](https://github.com/zackha/nuxtcommerce/blob/master/public/products.zip). The zip file contains both variable and variation product CSV files.
91
+
2. Navigate to the WooCommerce admin panel.
92
+
3. Go to **Products > Import**, then upload the CSV files from the downloaded zip.
93
+
4. Follow the on-screen instructions to map the CSV columns to WooCommerce fields and complete the import.
94
+
95
+
> **Note:** Ensure your CSV files are properly formatted to avoid errors during the import process.
96
+
97
+
### Step 3: Configure WPGraphQL
98
+
99
+
1. Navigate to **WPGraphQL > Settings** in the WordPress admin dashboard.
100
+
2. Locate the **GraphQL Endpoint URL** and copy it. The default endpoint is typically `/graphql`.
101
+
3. Open your project’s `.env` file and add the following line:
102
+
103
+
```env
104
+
GQL_HOST=<your_graphql_endpoint_url>
105
+
```
106
+
107
+
Replace `<your_graphql_endpoint_url>` with the copied URL from WPGraphQL settings.
108
+
109
+
> **Important:** Make sure your server allows CORS (Cross-Origin Resource Sharing) to enable communication between your WordPress backend and frontend application.
110
+
111
+
By following these steps, your WordPress site will be ready to integrate WooCommerce with GraphQL. For additional troubleshooting or advanced customization, refer to the official documentation of each plugin.
112
+
36
113
## Contributing
37
114
38
115
Contributions of any kind are welcome! You can open an issue for requests, bug reports, or general feedback, or you can directly create a pull request(PR).
0 commit comments