Extend WooCommerce Product with relationship field
-
Hi, I extended WooCommerce product with a new field cl_product_documents that is a relationship field with multiple options (a product can have several documents).
If I add documents and check the product with the API I see it in meta_data
{ "meta_data": [ { "key": "_pods_cl_product_documents", "value": [ 79, 75 ] }, { "key": "cl_product_documents", "value": "79" }, { "key": "cl_product_documents", "value": "75" } ] }
But if I update documents with the API, nothing happen, I see in the API the new meta_data, but in admin, documents are the same. In database I see that wp_podsrel isn’t changed.
Can you guide me about the correct method to update this field with the API REST from an external service, data sent was:
{ "meta_data": [ { "key": "_pods_cl_product_documents", "value": [ 79, 75, 58 ] }, { "key": "cl_product_documents", "value": "79" }, { "key": "cl_product_documents", "value": "75" }, { "key": "cl_product_documents", "value": "58" } ] }
But the API result is:
"meta_data": [ { "id": 1813, "key": "_pods_cl_product_documents", "value": [ 79, 75, 58 ] }, { "id": 1816, "key": "cl_product_documents", "value": "58" } ],
Thanks in advance.
Kindly regards.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Extend WooCommerce Product with relationship field’ is closed to new replies.