-
Notifications
You must be signed in to change notification settings - Fork 110
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
Woocommerce webhooks #1179
Comments
Not clear to me.
Also please copy/paste complete code/outputs here. |
Based on a comment in the code i was expecting to recieve the raw data in every webhook.
This is the webhook payload from a variable product update. The product name is in raw format, but the attributes are translated. In the following payload one of the attributes with the id 25 is called "Cor Traduções" with the following options "Amarelo, castanho, Preto" EDIT: The expected result would be "[:pt]Cor Traduções 2[:en]Color traductions 1[:]" for the attribute name. Categories name are also translated in the default language. I am not sure about the remaining fields like description, short_description etc.
When the webhook payload is related to one variation and not about the parent product, the name is translated in the default language "ee - Amarelo" EDIT: The expected webhook would be to have all fields with the raw ml format. The attribute field is also translated in default language
|
My guess is that get_term is returning the field already translated and not in raw format i guess. My initial thoughts was the more fields were translated, but the main problem right know is the attributes value. Thanks |
@tonysilva16 can you test this branch |
Hello @spleen1981 , For what i could test, one of the problems remains. When the product is a variation type, the returning data has translated attributes. The function in the screenshoot bellow is called to get the attributes field. The result of the get_attribute_taxonomy_name function is this one, that contains the translated attribute If the product type is not a variation, the attribute name is correct. |
ok, it seems under some circumnstances (e.g. variations updates) the webhook is generated through AJAX instead of cron, and in that case |
Hello, Its seems that is fixed, at least for what i could tried it was working allright. Tomorrow i am gonna test it better and i will give you feedback. |
Hello, I am getting an error on a coupon update. I am not sure, but the webhook must be trigger using the admin page and the webhook function is using a function only available when doing frontend
|
Right, that part shouldn't be needed if not doing frontend. |
Thanks. It seems that is fixed now. |
Merged in master. |
Hello,
With a variable product, if i update the variation price and click on save changes, woocommerce will send two webhooks, one of them have the raw data (parent product update), and the other webhook (variation update) all the fields are translated.
Example:
https://i.imgur.com/IBz5MiE.png
I already tried with the latest published version, and also with the current plugin files on the master branch.
Thanks.
The text was updated successfully, but these errors were encountered: