挂钩购物车更新

I have a Woocommerce One Page Checkout and I have the quantity input changed to a select box according this snippet.

Now I want that when I change my quantity with the select, the quantity in my shopping cart also updates with the selected quantity using AJAX. How can I achieve this in my functions.php?

The snippet later on that page does not what it should do. Can someone help me out?

Update:

Could this maybe part of my solution?