function for automatic food purchases