0
I have a problem in Woocommerce REST_API, in case the endpoint response wp-json/wc/v2/Orders, in products(line_items) is not returned metadata(metadata of products).
As in the image above, it can be observed that the values for the metadata, are empty!
I solved that question using register_rest_field, this is the code of the solution below!
The solution adds to key products in the REST_API response, within this array has the product id along with the metadata that I need!
The problem is that I want this change to be applied to Webhook, I thought by changing the REST_API endpoint response, it would also change the Webhook response. But this script has no effect on Webhook.
Can someone help me solve this problem?
Avoid using code images. To respond copy your code and use the answer field tools to paste it here in the correct way.
– hugocsl