Skip to content

Commit a331063

Browse files
authored
Merge branch 'master' into package
2 parents 6df73c3 + 4d506ca commit a331063

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ plugins:[
2828
fields: ['products'],
2929
// Version of the woocommerce API to use
3030
// OPTIONAL: defaults to 'wc/v1'
31-
api_version: ['wc/v3'],
31+
api_version: 'wc/v3',
3232
// OPTIONAL: How many results to retrieve
3333
per_page: 100
3434
}
@@ -123,4 +123,4 @@ For example, to get product categories: including 'products/categories' in field
123123

124124
## Changelog
125125
- 0.3.2: Mapping products & categories to each other
126-
- 0.3.0: Associated products & product categories with local file images downloaded during the build process to allow use of image transform plugins.
126+
- 0.3.0: Associated products & product categories with local file images downloaded during the build process to allow use of image transform plugins.

gatsby-node.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ exports.sourceNodes = async (
1313
const { createNode, touchNode } = actions
1414
delete configOptions.plugins
1515

16-
const { api, https, api_keys, fields, api_version, per_page } = configOptions
16+
const { api, https, api_keys, fields, api_version = 'wc/v1', per_page } = configOptions;
1717

1818
// set up WooCommerce node api tool
1919
const WooCommerce = new WooCommerceAPI({
2020
url: `http${https ? "s" : ""}://${api}`,
2121
consumerKey: api_keys.consumer_key,
2222
consumerSecret: api_keys.consumer_secret,
2323
wpAPI: true,
24-
version: api_version || "wc/v1",
25-
})
24+
version: api_version
25+
});
2626

2727
// Fetch Node and turn our response to JSON
2828
const fetchNodes = async fieldName => {

0 commit comments

Comments
 (0)