How to display item availability count and close/hide it when the limit is reached?