You can’t add a number of products inside hover the navigation menu, what you can do, add a snippet inside the layout of the cart page inside the snippet add a dataview with a microflow data source, and create a helper non-persistable entity with attribute to add the result of the products, do your logic inside the microflow and the return object should be a helper, inside the dataview add the cart icon and the attribute value as a text, after that, you need a UI developer if you are not aware of the design to help you in adding the needed styling to get the final result.
Like Nour Abouasal says, you can add any information in the topbar by adding a snippet to the page-layout an make the snippet retrieve data linked to the currentUser. Here is a sample how to do that:
The image on the right is a snippet in the BaseApplication=>Design=>PageLayout. This contains a snippet ‘Person.Ship_Person_NavigationBarAddon’ which is filled by a microflow retrieving data. This can be your Cart-entity.