We investigate lattice ordering phenomena for the heterovalent ternaries that are based on the wurtzite lattice, under the constraint that the octet rule be preserved. We show that, with the single exception of a highly symmetric twinned structure, all allowed lattice orderings can be described by a pseudospin model corresponding to the two different stackings of ABAB rows of atoms in the basal plane that occur in the P na21 and P mc21 crystal structures. First-principles calculations show that the difference in the energies of formation between these two structures is 13±3 meV/fu (formula unit) for ZnSnN2 and is an order of magnitude larger for ZnGeN2, and that for both materials the P m31 structure, which contains only octet-rule-violating tetrahedra, has a significantly higher energy of formation and a signficantly lower band gap. We predict almost random stacking and wurtzite-like x-ray diffraction spectra in the case of ZnSnN2, consistent with reported measurements. The octet-rule-preserving model of disorder proposed here predicts a band gap that for ZnSnN2 is relatively insensitive to ordering, in contrast to the prevailing model, which invokes the random placement of atoms on the cation sublattice. The violations of the octet rule in the latter model lead to significant narrowing of the band gap. The Raman and photoluminescence spectra of ZnSnN2 are interpreted in light of the ordering model developed here. The observation that ZnGeN2 orders in the P na21 structure under appropriate growth conditions is consistent with the larger difference in the energies of formation of the P na21 and P mc21 structures for this material. The ordering model presented here has important implications for the optical, electronic and lattice properties of all wurtzite-based heterovalent ternaries.