Implemented below mentioned changes :

1. Used template plugin.
2. Created function getDisplayString() to return the string value.
3. Used helper method to return ID selectors.
4. Changed the logic of method isItemAlreadyPresentInOrder(). Now the logic is dependent on data and not the html.