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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.