[MarketPress] Help adding quantity field in the product list

I’ve got a product list page. For products that don’t have variations, I need a quantity box to display not just the add to cart button. I found a previous forum article in support that added code to the theme functions.php, but it did not work for me, most likely because the code is outdated.

Here’s the older article – https://premium.wpmudev.org/forums/topic/marketpress-show-quantity-in-product-list

Could you please help me refactor this code so that I can achieve this functionality now? Please advice.