in each run of your loop:
for item in food:
total = 0
total is assigned a value of zero, so all the sums you do here:
total = total+prices[item]
is reset each time, place the declaration of total outside the for loop.
The function ends the moment a return keyword is reached:
which in your case happens in the first run of the loop. Change the indention of the return so the whole loop can run