Home › Forums › ACF PRO › Use the “Relationship” to select Product Variations? › Reply To: Use the “Relationship” to select Product Variations?
I don’t have a complete answer for you, just some idea after doing a quick 5 minute search.
First you would need to use something like a post object field to select the product.
The next step would be to create a select field. This field needs to be populated dynamically based on the selection in the first field. Do a search for “ACF dynamically populate a field from another field” in google and you will find this question comes up often.
You will need to do a custom query to get the product variations to populate the second field. These are saved as the post type “product_variation” with the “post_parent” value set to the “product” post of the main product.
To display this you’d need to figure out how to link to a specific product variation based on the values of these two fields.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!