Thursday, 29 November 2018

How do Delete wishlist item in magento 1.9 by programatically?

  $wishList = Mage::getSingleton('wishlist/wishlist')->loadByCustomer($userId);
            $wishListItemCollection = $wishList->getItemCollection();
            foreach ($wishListItemCollection as $item) {
               $w_product_id = $item->getProductId();
                if ($w_product_id==$product_id) {
                    $item->delete();
                   
                    echo 'Deleted successfully';
                }else{
                    echo 'Not Deleted';

                }

No comments:

Post a Comment