Support

Account

Home Forums General Issues Is it possible to load custom field data into a woocommerce product?

Helping

Is it possible to load custom field data into a woocommerce product?

  • I hope someone can help me, i’ve been trying to figure out the simplest way of explaining this but I’m not sure I’ll succeed!

    My client is running a woocommerce store using WC Vendors in addition.

    I am trying to create a category sidebar that can filter products as standard by their attributes, but also by the attributes of the vendor who is selling the product.

    I am wondering if this is possible to do using ACF.

    Essentially if a field exists on a Vendor of Insured – “Yes” or “No” I want to pull that field data into the product as a filterable attribute.

    Is this possible? Or am I overlooking a really simple way of doing this?

  • You would have to use an acf/save_post filter on the product. In this filter you would need to copy the values from the vendor to the post what that they are available for sorting the post.

    So
    1) Get the vendor associated with the product
    2) Get the values that you want to be able to sort the post on
    3) Add these values as meta_values to the post

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

You must be logged in to reply to this topic.