Remember add to cart form state
You can store it in session

During Add to cart.

$_SESSION['my_module_name']['product_id']['field_name'] = $filter_value


Then set form option value from session

function my_module_name_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if($form_id == 'your_form_id') {
    $get_default_value = isset($_SESSION['my_module_name']['product_id']['field_name'])?$_SESSION['my_module_name']['product_id']['field_name']:'';
    $form['field_name']['#default_value'] = $get_default_value;
  }
}