How To Organize Receipts automatically when you print it out?

So I wanted to create a rule and action which arranges my reciept accordingly.

So for example,

If I have a group called burgers, the products of this category will appear on the top followed by milkshakes and then desserts .

So even if my counter person writes it haphazardly and writes desserts first and burgers after, the receipt is rearranged when printed and desserts come at last and burgers got to the top spot automatically.

And please I need help with this as it causes a lot of ruckus in rush hours.

Thanks for the help.