added functionality for search and sort in checkout history