apply the max discount code after trying all codes