You have to override magento wishlist IndexController.
for override wishlist in IndexController refer Question
Just put below function in it.
Use _addItemToWishList()
public function _addItemToWishList()
{
$wishlist = $this->_getWishlist();
if (!$wishlist) {
return $this->norouteAction();
}
$session = Mage::getSingleton('customer/session');
$productId = (int)$this->getRequest()->getParam('product');
if (!$productId) {
$this->_redirect('*/');
return;
}
$product = Mage::getModel('catalog/product')->load($productId);
if (!$product->getId() || !$product->isVisibleInCatalog()) {
$session->addError($this->__('Cannot specify product.'));
$this->_redirect('*/');
return;
}
//*******************Check if already exist****************
$customer = $session->getCustomer();
$already_exist=false;
if($customer->getId())
{
$wishlist = Mage::getModel('wishlist/wishlist')->loadByCustomer($customer, true);
$wishListItemCollection = $wishlist->getItemCollection();
foreach ($wishListItemCollection as $item)
{
if($item->getId()==$productId)
{
$already_exist=true;
break;
}
}
}
if($already_exist)
{
$session->addError($this->__('%s already exist in wishlist: %s', $product->getName()));
$this->_redirect('*/');
return;
}
//******************************************************
try {
$requestParams = $this->getRequest()->getParams();
if ($session->getBeforeWishlistRequest()) {
$requestParams = $session->getBeforeWishlistRequest();
$session->unsBeforeWishlistRequest();
}
$buyRequest = new Varien_Object($requestParams);
$result = $wishlist->addNewItem($product, $buyRequest);
if (is_string($result)) {
Mage::throwException($result);
}
$wishlist->save();
Mage::dispatchEvent(
'wishlist_add_product',
array(
'wishlist' => $wishlist,
'product' => $product,
'item' => $result
)
);
$referer = $session->getBeforeWishlistUrl();
if ($referer) {
$session->setBeforeWishlistUrl(null);
} else {
$referer = $this->_getRefererUrl();
}
/**
* Set referer to avoid referring to the compare popup window
*/
$session->setAddActionReferer($referer);
Mage::helper('wishlist')->calculate();
$message = $this->__('%1$s has been added to your wishlist. Click <a href="%2$s">here</a> to continue shopping.',
$product->getName(), Mage::helper('core')->escapeUrl($referer));
$session->addSuccess($message);
} 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.'));
}
$this->_redirect('*', array('wishlist_id' => $wishlist->getId()));
}