Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit 8e288b3

Browse files
authored
Update README
Add useful information and how to setup/test.
1 parent ecfb38b commit 8e288b3

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,24 @@
1-
# woocommerce-product-inventory-datastore
2-
Sample WooCommerce DataStore for products, overrides inventory count
1+
# Demo Inventory Data Store for WooCommerce Products
2+
3+
This demo shows an example of how to extend existing Data Stores in WooCommerce.
4+
5+
**NOTE: This is demo code and not even close to being something you want to use in production.**
6+
7+
It extends an existing Product Data Store, and overrides only the inventory count,
8+
replacing the database count with one retrieved from an external API.
9+
10+
## Try it out!
11+
12+
This plugin has everything needed to try out the example code.
13+
14+
### Pre-Setup
15+
16+
1. Set up a test WooCommerce site.
17+
2. Add 3 products with SKUs of "p120", "p121", and "p122", set stock quantities.
18+
19+
### Plugin Setup
20+
21+
1. Clone this repository under `wp-content/plugins`.
22+
2. Under the `server` directory run `npm install` then `npm start` to run the test API server.
23+
3. Activate the "WooCommerce Product Inventory Datastore" plugin.
24+
4. Observe the products with the SKUs above now receive inventory counts from the API instead of `wpdb`.

0 commit comments

Comments
 (0)