We are Providing an option for "Add to cart" & "Delete" for each product in My account section.
what we need is if that product is added to cart, than we want to hide the "Delete" button.
<?php
$productId = $_product = Mage::getModel('catalog/product')->load($product->getId());
$quote = Mage::getSingleton('checkout/session')->getQuote();
if (! $quote->hasProductId($productId))
{
?>
<a><span>Delete</span></a>
<?php
}
?>
I tried above code, but still "Delete" button visible after click on "Add to cart"
bool(false)
after i usedvar_dump($quote->hasProductId($productId));