Great recommendation! I've made this many times.
Some additional notes:
With the limited budget, I would recommend eating the onion halves rather than discarding them.
And if an onion is too much produce, onion powder will work. Both onion and garlic powder are reasonable options, especially in any recipe that cooks a while. Especially given your limited budget, do not shake any spices directly into the pot (they'll start to clump). Always put spices in another dish (like your bowl, you can always rinse it if you feel the need), or your hand and then add them to the pot.
Onions will keep for quite a while in a cool dark place, and can still be used even if they start to go off.
- Soft spot? Cut it off
- Sprouting? That's edible, chuck it in too
- Mold? If it's black mold, Peel off all layers with evidence of mold, or wash it off, it's probably only on the top layer
In any of these cases, you might consider using twice as much onion as the recipe calls for, to try and use up as much as you can.
Carrots and celery can also keep for similar amounts of time in the fridge, and bad spots can be cut out. They can also be added in a lot of places where they're not asked for. I understand that produce might be challenging, but even if you only make it to the grocery store once a month, these may still be an option.