 commerce_wishlist.module                           |  8 ++++
 ...ist_handler_field_add_to_cart_from_wishlist.inc | 50 ++++++++++++++++++----
 2 files changed, 50 insertions(+), 8 deletions(-)

diff --git a/commerce_wishlist.module b/commerce_wishlist.module
index 4171b34..d879fac 100644
--- a/commerce_wishlist.module
+++ b/commerce_wishlist.module
@@ -210,6 +210,14 @@ function commerce_wishlist_form_alter(&$form, &$form_state, $form_id) {
     // If this user has some products, rename the field.
     if (_commerce_wishlist_user_has_wishlist()) {
       $form['actions']['submit']['#value'] = t('Update quantities');
+
+      // Might need to be button depending on the actions taken. Assumed is that submit will also update the quantities.
+      $form['actions']['all_to_cart'] = array(
+        '#type' => 'submit',
+        '#value' => t('Add all to cart'),
+// We handle this in the commerce_wishlist_handler_field_add_to_cart_from_wishlist submission.
+//        '#submit' => array('my_module_button_handler'),
+      );
     }
     // If this user does not have any products, hide the button.
     else {
diff --git a/views/handlers/commerce_wishlist_handler_field_add_to_cart_from_wishlist.inc b/views/handlers/commerce_wishlist_handler_field_add_to_cart_from_wishlist.inc
index e268542..eb2ebc2 100644
--- a/views/handlers/commerce_wishlist_handler_field_add_to_cart_from_wishlist.inc
+++ b/views/handlers/commerce_wishlist_handler_field_add_to_cart_from_wishlist.inc
@@ -104,10 +104,6 @@ class commerce_wishlist_handler_field_add_to_cart_from_wishlist extends views_ha
       '#tree' => TRUE,
     );
 
-    // Since the default views don't have a path. We need to set this manually.
-    $query = drupal_get_query_parameters($_GET, array('q'));
-    $form ['#action'] = url(current_path(), array('query' => $query));
-
     // At this point, the query has already been run, so we can access the
     // results in order to get the base key value (for example, nid for nodes).
     foreach ($this->view->result as $row_id => $row) {
@@ -160,12 +156,14 @@ class commerce_wishlist_handler_field_add_to_cart_from_wishlist extends views_ha
     if (isset($form_state['clicked_button']['#add_to_cart']) && isset($form_state['clicked_button']['#line_item_id'])) {
       global $user;
       // Get the shopping card order ID for this user.
-      $order_id = commerce_cart_order_id();
+// This was never user in the first place
+//      $order_id = commerce_cart_order_id();
       // Get the commerce line item ID.
       $line_item = commerce_line_item_load($form_state['clicked_button']['#line_item_id']);
       // Alter the order ID and line item ID values to avoid overwriting.
       $new_line_item = clone($line_item);
-      $new_line_item->order_id = $order_id;
+// No need to manually set this, will be done when adding to cart.
+//      $new_line_item->order_id = $order_id;
       // Alter the quantity for this line item and add only as much as it has
       // been entered in the quantity field.
       $row_id = $form_state['clicked_button']['#row_id'];
@@ -178,9 +176,45 @@ class commerce_wishlist_handler_field_add_to_cart_from_wishlist extends views_ha
       // Remove the ID and save this item to the database so we can get the new
       // ID stored in the variable.
       unset($new_line_item->line_item_id);
-      commerce_line_item_save($new_line_item);
+// As per http://www.drupalcontrib.org/api/drupal/contributions!commerce!modules!cart!commerce_cart.module/function/commerce_cart_product_add/7
+// We should not save the line item.
+//      commerce_line_item_save($new_line_item);
       commerce_cart_product_add($user->uid, $new_line_item);
     }
+    elseif($form_state['clicked_button']['#id'] == 'edit-all-to-cart') {
+      global $user;
+
+      dpm($form_state);
+
+      foreach($form_state['complete form']['edit_wishlist_quantity'] as $row_id => $line_item) {
+        if(!is_integer($row_id)) {
+          continue;
+        }
+
+        $line_item = commerce_line_item_load($line_item['#line_item_id']);
+
+        $new_line_item = clone($line_item);
+// No need to manually set this
+//      $new_line_item->order_id = $order_id;
+        // Alter the quantity for this line item and add only as much as it has
+        // been entered in the quantity field.
+        $new_line_item->quantity = $form_state['values']['add_to_cart_from_wishlist'][$row_id]['quantity'];
+        // Save the original line item ID, so we can pass it to rules after the
+        // checkout is completed.
+        $new_line_item->data['wishlist_line_item_id'] = $line_item->line_item_id;
+        // Invoke rules.
+        rules_invoke_all('commerce_wishlist_event_product_added_to_cart', $line_item, $new_line_item);
+        // Remove the ID and save this item to the database so we can get the new
+        // ID stored in the variable.
+        unset($new_line_item->line_item_id);
+//      commerce_line_item_save($new_line_item);
+
+// As per http://www.drupalcontrib.org/api/drupal/contributions!commerce!modules!cart!commerce_cart.module/function/commerce_cart_product_add/7
+// We should not save the line item above.
+
+        commerce_cart_product_add($user->uid, $new_line_item);
+
+      }
+    }
   }
-  
 }
