Support

Account

Home Forums Backend Issues (wp-admin) ACF Woocommerce products list

Solved

ACF Woocommerce products list

  • Hello!

    I have added a new select field: https://prnt.sc/19hbwmi
    I would like the “Choices” to be all the other products on the site (I use Woocommerce), how do I do this?

    Thanks 🙂

  • Use a relationship or post object field instead of a select field.

    Or https://www.advancedcustomfields.com/resources/dynamically-populate-a-select-fields-choices/

  • Thanks for your answer!
    Is it possible with this type to have a value + a label ?
    I want to use the value as the product link and the label as the product name, like that : https://prnt.sc/1a7y5ju

  • No, those other types of fields will only choose other posts on the same WP site, not links to external sites. The products would need to be posts on your site. When you said “all the products on the site” I assumed you were talking about WC products.

    But using these fields you could then get whatever values exists for the “Product” post, so you could display anything about that product that you chose.

  • Yeah of course, that’s for the product of my website.
    Maybe the screenshot confused you.

    I want that the data is an array with a value + a label.
    The value is the product link, and the label is the product name.

    For example :

    https://my-website.com/product/test1 : Test product 1
    https://my-website.com/product/test2 : Test product 2

  • the fields return posts. Maybe you should look at the documentation for these fields.

    Relationship Field
    Post Object Field

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

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.