Populate simple text field with selected woocommerce product variation?

HI there! I’m trying to build my own custom “ask for a quote” product with woo-commerce and gravity forms. On a single product page, I have a form and I would like when I change the variation for it to be displayed in the text field. Ready to send in with some additional information. Is that possible? Probably with some js right? Any suggestion on how I could achieve this?

This is what I’ve been testing this far:

add_filter( 'gform_field_value_selected_variation', 'get_selected_product' );
function get_selected_product( $value ) {
  global $product;

  return $product->get_name();

and gets the product title in the form field. But need to update on variation selection.

@JoelA This might be what you need?

1 Like