When I get home from shopping I take the receipt from every store and record line by line on a sheet of paper what was spent for each category. I typically shop once per week and this takes my just a few minutes to do. I have a running total in the grocery category and the eating out category(and a few other categories). When I reach my limit I stop buying.
Since I look at that sheet right before I go I have a pretty good idea how much I can spend. If I want to keep my groceries to under $125/mo and I am on week 4 of the month and have spent $105 I know I need to spend under $20 for this trip, That motivates me to look around and see what I have that I can use from the pantry. The receipt also makes it easy to separate out dog food or household expenses.
I toss receipts that are on the credit card in an envelop to check before I pay the credit card bill. Then they are discarded. I ask for receipts where they aren't readily given. If I don't get a receipt I jot the amount down(usually on a receipt I have already gotten for that day) so I remember.