First, an overview of how wishlists work:
- Each wishlist is stored in the database with its own ID
- Each product added to a wishlist is assigned a
wishlist_item_id
- This ID is not the same as the
product_id
For this reason you can't just pass in a product ID to the remove URL because it's actually referencing the product's wishlist_item_id
.
This explains why you are getting a blank url ("/wishlist/index/remove"), because when you pass in the product it doesn't have the required wishlist_item_id
, you have to retrieve this in a different way.
To get around this, there is a method in Mage_Wishlist_Model_Item
you can use to get a wishlist item by product ID:
/** @var $_wishlistHelper Mage_Wishlist_Helper_Data */
$_wishlistHelper = $this->helper('wishlist');
/** @var $_wishlist Mage_Wishlist_Model_Wishlist */
$_wishlist = $_wishlistHelper->getWishlist();
/** @var $_wishlistItem Mage_Wishlist_Model_Item */
$_wishlistItem = Mage::getModel('wishlist/item');
$_wishlistItem->loadByProductWishlist(
$_wishlist->getId(),
$_product->getId(),
$this->helper('core')->getStoreId()
);
$_wishlistRemoveUrl = $_wishlistHelper->getRemoveUrl($_wishlistItem);
Or the shorter way:
$_wishlistItem = Mage::getModel('wishlist/item')->loadByProductWishlist(
$this->helper('wishlist')->getWishlist()->getId(),
$_product->getId(),
$_product->getStoreId()
);
$_wishlistRemoveUrl = $this->helper('wishlist')->getRemoveUrl($_wishlistItem);
This code has been tested in blocks of type Mage_Catalog_Block_Product_List
and Mage_Catalog_Block_Product_View
As mentioned before you can edit your local.xml file.
It should be in your theme folder e.g.:
app/design/frontend/yourpackage/yourversion/layout/local.xml
If it´s not there you can create it. It`s a very good way to edit the layout xml for a theme.
Remove "My Account" for the default handle
<default>
<reference name="top.links">
<action method="removeLinkByUrl">
<url helper="customer/getAccountUrl"/>
</action>
</reference>
</default>
Add "Register" for the logged out handle
<customer_logged_out>
<reference name="top.links">
<action method="addLink" translate="label title">
<label>Register</label>
<url helper="customer/getLogInUrl"/>
<prepare/>
<urlParams/>
</action>
</reference>
</customer_logged_out>
Add "My Account" for the logged in handle
<customer_logged_in>
<reference name="top.links">
<action method="addLink" translate="label title">
<label>Your Account</label>
<url helper="customer/getAccountUrl" />
<prepare/>
<urlParams/>
<liParams>
<id>header-account-link</id>
</liParams>
<aParams/>
<beforeText/>
<afterText/>
</action>
</reference>
</customer_logged_in>
In app/design/frontend/base/default/layout/customer.xml you can find the possible handles and url helper etc.
Best Answer
you can remove it from
if you have no theme installed you can go to this and change the 1 item and %1 items.
if you have a theme installed you can go to this location and do that.