1
if (!empty($customerId) and ! empty($item_id)) {
                $return['canRemove'] = true;
                try {
                    $item = Mage::getModel('wishlist/item')->load($item_id);

                    $wishlist = $this->getWishListById($item->getWishlistId());

                    if ($wishlist->getCustomerId() == $customerId) {

                        $item->delete();

                        $wishlist->save();
                        $return['error'] = false;
                        $return['msg'] = $this->__("Requested Item deleted from wishlist");

                        $resultCode = 1;
                        $resultText = "success";
                    }
                     else {
                        $return['msg'] = $this->__("Requested wishlist doesn't exist");
                    }
                } catch (Exception $ex) {
                    $return['msg'] = $this->__('An error occurred while deleting the item from wishlist.');
                }
            } else {
                $return['msg'] = $this->__('Item or customer is invalid');
            }
  • check my answer and let me know if not solve. – Rohan Hapani Nov 17 '18 at 6:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.