Sort products in wishlist by price

How can I sort products in the wishlist page by price asc and desc. I have found a piece of code but it is not working any help please.

public function getWishlistCollection(Mage_Customer_Model_Customer $customer = null){
    if($customer):
        $wishlists = Mage::getModel('wishlist/wishlist')->loadByCustomer($customer, true);
        if($wishlists->getItemCollection()->getSize()):
            $wishlists = $this->favorites->getItemCollection();
            $wishlists->addWishListSortOrder('added_at', 'DESC');
            $wishlists->getSelect()->limit(10, 0);
            return $wishlists;
        endif;
        return;
    endif;
    return;
}

this code can be found.


Go to Source of this post
Author Of this post: Mike
Title Of post: Sort products in wishlist by price
Author Link: {authorlink}