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

unable to update a product #84

Open
Irfan-Ahmad-byte opened this issue Dec 16, 2022 · 3 comments
Open

unable to update a product #84

Irfan-Ahmad-byte opened this issue Dec 16, 2022 · 3 comments

Comments

@Irfan-Ahmad-byte
Copy link

I am trying to update products in my store. But, the put/post methods do not work at all. The requests are executed but there are no changes in the product's properties.
I gave my homepage URL as the url param, and the permalink in the wordpress is set to something like https://my-website.co.il/year/month/day/sample-post/. below is the constructor defined
wcapi = API(
url=STORE,
consumer_key=DEV,
consumer_secret=SECRET,
wp_api=True,
version="wc/v2",
query_string_auth=True
)
and here is how I update a product
wcapi.put("products/4713", data={'price':'0.15'}).json()

and then it returns the product with old price.

Actually, the product is not updated and still it does not give an error.

@Vincenzoferrara
Copy link

v2 is old try using v3 and to filter use params in the place of data

@Irfan-Ahmad-byte
Copy link
Author

thank

@Vincenzoferrara
Copy link

remember that if you solved it, close the post and publish the solution

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