Home Forums Backend Issues (wp-admin) Problem adding ACF to Variable Product


Problem adding ACF to Variable Product

  • Hello, we are having issues trying to add a unique ACF per each variable product.

    Our product: “Product A – Variable Product.” This product has 4 different variations, and we would like to add unique ACF depending on that product variation.

    Within our custom fields tab I created a new custom field, field group, and label, I then selected; “Show this field group if post is equal to product_variation Product A – Variable Product.” Doing so did NOT add the custom field to our products admin page. Previously we have used; “post type is equal to product” which works great, but can not be used in the variable product situation.

    More background:
    Currently, we are using AFC to aid in our WooCommerce Email customizer, and it is working great. The email is printing out AFC data in accordance to the product that is purchased (see code below).

    $product_idMe = $item->get_product_id();
    $fields = get_field_objects($product_idMe);
    if( $fields )
    foreach( $fields as $field_name => $field )
    echo $field[‘label’];
    echo $field[‘value’];

    Goal: To add unique ACF to variable products, and print out the data into an email (like we are doing already doing, but now with the variable products unique ACF).

    Please let me know if you need any clarification, a client of ours is trying to launch their website with this feature working.
    -Thanks, Michael P.

  • I’m also having this issue. Did you happen to find a solution?

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

The topic ‘Problem adding ACF to Variable Product’ is closed to new replies.