how to update quantity of products in the cart via javascript?
Create new simple module like my_updater_card
add hook_menu 
add php function to update the card 
call this function from ajax

&lt;?php
/**
 * Implements hook_menu().
 * see hook_menu()
 * see menu_example
 */
function my_updater_card_menu()
{
    $items['my_updater/card/%'] = array(
        'page callback'         =&gt; 'my_updater',
        'page arguments'        =&gt; array(2),
        'access arguments'      =&gt; array('put your permission here'),
    );
    return $items;
}

function my_updater($newTotal){
    //check if this request come from ajax =&gt; if not =&gt; ignore it
    //here put your php code to update the card
    //then return results true/false to ajax caller
}
?&gt;



Ajax

        $.ajax({
               url: 'my_updater/card/[new total here]',
               type: "GET",
               success: function (data) {
                 //do total refresh here 
               }
        });