How to add products per page dropdown to WooCommerce

If you have a lot of products in your shop you can give an option to the visitors to choose how many products to display per page. This can be achieved by adding a dropdown select box within the shop archive page.