Dynamically populate Gravityform field with Woocommerce Product title
-
Hello all,
I’m hoping someone can help me. I’ve looked on some woocommerce forums and gravityform forums and I don’t see a solution to this, which is a little bizarre because I think a lot of people could use this.
I have a gravityform that I want to auto populate with the post/product title. I followed directions on here:
https://www.gravityhelp.com/documentation/article/gform_field_value_parameter_name/
https://www.gravityhelp.com/documentation/article/using-dynamic-population/On my gf field I checked: Allow field to be populated dynamically, but it’s not working. Here is the code I have:
//Autopopulate Gravity form on product page add_filter( 'gform_field_value_product_info', 'my_custom_population_function' ); function my_custom_population_function( $value ) { global $post; $product_title = get_the_title('ID', $post->post_title); return $product_title; }
Could someone help me figure out why this doesn’t work? Am I missing a step?
- The topic ‘Dynamically populate Gravityform field with Woocommerce Product title’ is closed to new replies.