Home Forums ACF PRO Use the “Relationship” to select Product Variations?


Use the “Relationship” to select Product Variations?

  • I want to create a “this item pairs well with ${another item variation}” section on the product page. Is it possible to perform the following workflow?

    1. Select Product on back end of page
    2. It reveals product variation, allowing a selection

    If so, how would something like this get accomplished? Thanks!

  • 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.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.