Never go to the market hungry. Shop more than one market when possible. Shop for the best deals at the different stores. For long storage, keep flour in a plastic bag in the freezer. Leftover pimentos will keep longer if covered with vinegar before storing in refrigerator.
Leftover onions are a problem in the refrigerator.
Rather than throwing them away, cut them up and put them in the freezer. You'll always have a supply of cut-up onions. Keep fresh parsley in the freezer all ready for use, after washing, stemming and drying it. When tomatoes are in abundance, core them and freeze them whole. Just before using, hold under running water and the skin will come right off.