I have written an extension support save all items from cart to wishlist in magento.
This extension help customers easy to save all the cart items to their wishlist for later order.
It supports all kind of products in magento : Simple product, configurable product, bundle product , simple product with custom option
It will compatible with magento community :  1.7.x.x,1.8.x.x

Images for demo extension are listed as below :

demo_add_button_save_items_from_cart_to_wishlist_1

Saving all items from cart to wishlist in magento step 1

demo_add_button_save_items_from_cart_to_wishlist_2

Saving all items from cart to wishlist in magento step 2

In this tutorial, I will show you how to make it done. Here is how :

1/ Create a xml file Inbusiness_Wishlist.xml to declare your module . It is located in : app/etc/modules/Inbusiness_Wishlist.xml

 

<?xml version="1.0"?>
<config>
<modules>
<Inbusiness_Wishlist>
<active>true</active>
<codePool>local</codePool>
</Inbusiness_Wishlist>
</modules>
</config>

 

2/ Create app/code/local/Inbusiness/Wishlist/etc/config.xml as the below code :

<?xml version="1.0"?>

<config>
<modules>
<Inbusiness_Wishlist>
<version>1.1.1</version>
</Inbusiness_Wishlist>
</modules>
<frontend>
<routers>
<checkout>
<use>standard</use>
<args>
<modules>
<Inbusiness_Wishlist before="Mage_Checkout">Inbusiness_Wishlist_Checkout</Inbusiness_Wishlist>
</modules>
</args>
</checkout>
</routers>
</frontend>
</config>

 

3/ Create Inbusiness_Wishlist_Checkout_CartController which is extended from Mage_Checkout_CartController to handle save all items from cart to wishlist. By default,Mage_Checkout_CartController only have empty_cart, update_qty and default action. So , I added more option : update_wislist.

<?php
require_once 'Mage/Checkout/controllers/CartController.php';

class Inbusiness_Wishlist_Checkout_CartController extends Mage_Checkout_CartController
{

public function updatePostAction(){

if (!$this->_validateFormKey()) {
$this->_redirect('*/*/');
return;
}

$updateAction = (string)$this->getRequest()->getParam('update_cart_action');

switch ($updateAction) {
case 'empty_cart':
$this->_emptyShoppingCart();
break;

case 'update_qty':
$this->_updateShoppingCart();
break;

case 'update_wishlist':
$this->_updateItemsToWishlist();
break;
default:
$this->_updateShoppingCart();
}

$this->_goBack();
}
protected function getWishlistInb(){

$wishlist = Mage::registry('wishlist');
if ($wishlist) {
return $wishlist;
}

try {
if (!$wishlistId) {
$wishlistId = $this->getRequest()->getParam('wishlist_id');
}
$customerId = Mage::getSingleton('customer/session')->getCustomerId();
/* @var Mage_Wishlist_Model_Wishlist $wishlist */
$wishlist = Mage::getModel('wishlist/wishlist');
if ($wishlistId) {
$wishlist->load($wishlistId);
} else {
$wishlist->loadByCustomer($customerId, true);
}

if (!$wishlist->getId() || $wishlist->getCustomerId() != $customerId) {
$wishlist = null;
Mage::throwException(
Mage::helper('wishlist')->__("Requested wishlist doesn't exist")
);
}

Mage::register('wishlist', $wishlist);
} catch (Mage_Core_Exception $e) {
Mage::getSingleton('wishlist/session')->addError($e->getMessage());
return false;
} catch (Exception $e) {
Mage::getSingleton('wishlist/session')->addException($e,
Mage::helper('wishlist')->__('Wishlist could not be created.')
);
return false;
}

return $wishlist;

}
protected  function _updateItemsToWishlist(){

try {

//$wishlist = Mage::helper('wishlist')->getWishlist();
$wishlist = $this->getWishlistInb();
if (!$wishlist) {
$this->_goBack();
}
$session =  $this->_getSession();
$cart = $this->_getCart()->getQuote();
//getAllItems
foreach ($cart->getAllVisibleItems() as $item) {
$product = $item->getProduct();
$productId  = $item->getProductId();
$buyRequest = $item->getBuyRequest();
try {
$result = $wishlist->addNewItem($productId, $buyRequest);
if (is_string($result)) {
Mage::throwException($result);
}

$productName = Mage::helper('core')->escapeHtml($item->getProduct()->getName());
$wishlistName = Mage::helper('core')->escapeHtml($wishlist->getName());
$message =  Mage::helper('wishlist')->__("%s has been added to your wishlist %s", $productName, $wishlistName);
$session->addSuccess($message);
$wishlist->save();
}
catch (Mage_Core_Exception $e) {
$session->addError($this->__('An error occurred while adding item to wishlist: %s', $e->getMessage()));
}
catch (Exception $e) {
$session->addError($this->__('An error occurred while adding item to wishlist.'));
}
}

} catch (Mage_Core_Exception $e) {
$this->_getSession()->addError(Mage::helper('core')->escapeHtml($e->getMessage()));
} catch (Exception $e) {
$this->_getSession()->addException($e, $this->__('Cannot update items to wishlist.'));
Mage::logException($e);
}

}

}

 

4/ Adding new button “Update all items to wishlist” below “Clear Shopping Cart” button in  app/design/frontend/your_current_packagetheme/your_current_theme/template/checkout/cart.phtml

<button type="submit" name="update_cart_action" value="update_qty" title="<?php echo $this->__('Update Shopping Cart'); ?>" class="button btn-update"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span></span></button>

<button type="submit" name="update_cart_action" value="empty_cart" title="<?php echo $this->__('Clear Shopping Cart'); ?>" class="button btn-empty" id="empty_cart_button"><span><span><?php echo $this->__('Clear Shopping Cart'); ?></span></span></button>
<?php if($this->helper('customer')->isLoggedIn()) : ?>
<button type="submit" name="update_cart_action" value="update_wishlist" title="<?php echo $this->__('Update All Items to Wishlist'); ?>" class="button btn-update" style="margin-right:10px"><span><span><?php echo $this->__('Update All Items to Wishlist'); ?></span></span></button>
<?php endif; ?>

 

Happy coding. Please leave your comment if you have any troubles with it. Feel free to contact with me.