Lower prices influence shoppers to buy more healthful food, according to a new study from South Africa.

Discover, a South African health insurance company, offered a rebate of up to 25 percent on grocery purchases of fresh fruits, vegetables and other healthy foods. The cash rebate was part of a larger health promotion program.

“This has been going on for four years now with hundreds of thousands of people,” said Roland Sturm, a researcher with the U.S.-based Rand Corporation. “So, a unique opportunity to really evaluate what can a discount on healthy foods do in terms of shopping patterns, in terms of diet, in terms of obesity.”

To find out, Sturm and other researchers analyzed supermarket barcode data, which recorded participants’ purchases of groceries, both healthy and non-healthy. Because each transaction was matched to a credit card, they could track an individual shopper’s purchases from 2009 to 2012.

The researchers found that a “25 percent discount on healthy foods will increase the proportion of healthy foods by about 10 percent.”

At the same time, the purchases of unhealthy foods went down by six percent. Unhealthy foods included sugary soft drinks, candy and salty snacks.

To help shoppers make informed decisions, food eligible for rebates was labeled with signs in the store and on grocery receipts. A scientific panel decided which items were eligible. For example, canned fruits and vegetables were okay, unless sugar or salt were added. And only nonfat dairy products were included.

There were some limitations to the study. Participants chose to join the rebate program, rather than being randomly assigned to it. Also, the study only tracked credit card purchases at one grocery chain.