Skip to content
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

Won't update variation meta #17

Open
d3v-null opened this issue Sep 15, 2016 · 2 comments
Open

Won't update variation meta #17

d3v-null opened this issue Sep 15, 2016 · 2 comments

Comments

@d3v-null
Copy link

d3v-null commented Sep 15, 2016

Hi,
I'm having a problem with this plugin where updating a simple product works fine with the api call:

- endpoint: products/<simple_product_id> 
- data: {'custom_meta': {'field':'value'} }

However this doesn't work with product variations, for example if i have a variable product, which has a number of variations whose properties change regularly and I need to update those variations without deleting and re-creating them every time I update them, I want to be able to do this:

- endpoint: products/<variation_id> (not the id of the parent product but the ID of the variation
- data: {'custom_meta': {'field':'value'} }

However this just doesn't work on Variations, it just ignores it.

I also can't obtain the meta of a product variation through this plugin, only the meta of the variable product which is it's parent.

@d3v-null
Copy link
Author

I've fixed these issues in my fork, let me know if you'd like me to submit a pull request and i can get on that.

d3v-null@1103dcc

Changes I've made:

  • When accessing a product variation directly via product/<variation_id> it gives the variation's meta instead of the parent's meta.
  • When modifying a product variation directly via product/<variation_id> the API can directly modify the the variation's meta which was not possible before.

Let me know what you think, thanks

@judgej
Copy link
Owner

judgej commented Aug 2, 2017

Use the new v2 REST API (WC 3.x) instead of this plugin. It now does everything this plugin does out of the box. The README gives some examples of how you would manage the metadata fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants