-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support WooCommerce post types in wordpress source plugin #5794
Comments
I would like to do this myself, but the wordpress source plugin was difficult to understand. |
You should already be able to query WooCommerce data. WooCommerce has its own routes, I've also learned that if you want the plugin to optimize product images, you will need to make sure the I should also add that I don't believe WooCommerce is "officially" supported and you may still run into issues. For example, node links are not created for product tags and categories as they are for regular Wordpress posts as WooCommerce tags and categories have different wordpress types and are not accounted for in the plugin. #5796 discusses extending gatsby-source-wordpress. |
I am receiving alot 401s, 403 etc actually. How should I attach the wc auth field ?
Or is there a special naming convention for WC ? The actual products are showing up as posts in graphql inspector but only the most basic post data such as title, excerpt etc. |
Why not use WooCommerce REST API to create a gatsby-source-woocommerce? |
This is not working, but this works in the browser: @keithgonzalez |
https://github.com/Amanej/gatsby-source-woocommerce-plugin @tscangussu Good idea. |
@Amanej what do you mean by not working? Are you getting any errors? |
Yes, 401 Unauthorized. |
Try setting up a fresh WordPress installation on a local development environment as well as a fresh Gatsby repo with the gatsby-source-wordpress plugin. It would be helpful to figure out if this is a Gatsby issue or a Wordpress server configuration issue. The latter seems more likely. I can only help so much with the limited details provided. Try going over https://docs.woocommerce.com/document/woocommerce-rest-api/ and https://github.com/woocommerce/woocommerce/wiki/Getting-started-with-the-REST-API. There's a 401 Unauthorized troubleshooting section in there as well. |
Well, the url works in the browser, as an ajax call, with curl and with nodejs rest api. So its definitely not a wp server config issue. How exactly does the source plugin use the auth parameters ? That is what is really missing here. If you are able to just provide one example of how it could work, of how the auth parameters would look with WooCommerce keys, not WordPress login (which would not sufficient) that would be helpful.
I have just started my own source plugin anyway: wc source plugin. But unfortunately for the current project, its way out-of-scope already. |
The link in the above comment does not resolve for me: https://github.com/gatsbyjs/gatsby/issues/wc-source-plugin |
@wilsonmar I updated the link now! |
@Amanej @wilsonmar late to the party, but I created a source plugin for woocommerce today. rather than node-fetch it uses the woocommerce node package. Not sure if it will be useful to you all. But it allows you to pull in a few different data fields from the WooCommerce REST API. Still need to test it out some more. https://github.com/marcaaron/gatsby-source-woocommerce |
Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open! |
This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue. |
Currently the wordpress source plugin only fetches the woocommerce post titles, excerpts and other generic wordpress content.
It would be good if it supports the product data, such as prices, variations etc.
The text was updated successfully, but these errors were encountered: