Changing Product attributes in drupal commerce, maintain data with ajax reload

What I needed is to preprocess this whole group of data, that consist add to cart button and attributes fields. "Add to cart form" is basically the one that consists attributes and add to cart button. To do that the only way to make it work with AJAX is with form alter. So change the forms data in

function my_module_form_commerce_cart_add_to_cart_form_alter(&$form, &$form_state) {

and you can probably get what you need. Think this is the only way. Templates get overrun by Ajax calls and only work on first generating of product.