Let R and S be two irreducible root systems spanning the same vector space and having the same Weyl group W, such that S (but not necessarily R) is reduced. For each such pair (R,S) we construct a family of W-invariant orthogonal polynomials in several variables, whose coefficients are rational functions of parameters $q,t_1,t_2,...,t_r$, where r (=1,2 or 3) is the number of W-orbits in R. For particular values of these parameters, these polynomials give the values of zonal spherical functions on real and p-adic symmetric spaces. Also when R=S is of type $A_n$, they conincide with the symmetric polynomials described in I. G. Macdonald, Symmetric Functions and Hall Polynomials, 2nd edition, Oxford University Press (1995), Chapter VI.