0
votes

I have a woocommerce site setup that is pulling in products from an external system using the woocommerce REST API.

Everything is coming through fine except the parent_id is not being set.

example data:

{"product": {"title":"Example Shoe","type":"simple","status":"publish","regular_price":"84.00","description":"","short_description":"Trainers","categories":["Mens Trainers"],"catalog_visibility":"visible","attributes":[{"name":"Colour","position":1,"visible":true,"variation":false,"options":["BLACK"]}],"images":[{"src":"","title":null,"alt":"","position":0}],"parent_id":5254}}

I'm a bit stumped as to why, and as it is only an integer posting through I can't see why It wouldn't work.

Any help is appreciated, Thanks.

1

1 Answers

1
votes

I figured out after some trial and error that the reason for this is that the parent_id field seems to be used for grouped products so using it for a variable product was causing issues.