Remember add to cart form state Is there a way to remember the chosen product attribute on the add to cart form? I have a product with a couple of options. If the users selects one on the product page and goes to another page, the form will reset and selects the first option again.
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;
  }
}