South African supermarket operator Shoprite Holdings saw its earnings climb in the first half of the year, despite what it described as a "difficult" trading environment.