As in there are tags to determine the exact resources you need to buy something. Would work pretty much the same as the costs for equipping a unit with it only with gold instead of production (think of it as being rushed).
Example: To buy a horse you need a horse, if you don't have single horse in your empire no matter how much gold you have, your hero shouldn't be able to buy a horse. Added advantage: Buy and sale value are now in different tags, allowing modders extra control over item economy.
Also upgrading troop count should take into account the value of the troop and not cost 50 gold flat no matter if its a militia with a club or an overequipped paladin that costs 50 metal and crystal each unit. Currently you can also "cheat" by upgrading equipment before troop size leading to less total cost than the other way around.