Eating the substrate is not a common concern, as far as the chameleon actively taking in mouthfuls of planting mix. What is of concern are small items of bark, stone, twigs, fibrous mosses, and the like that can cause blockages if eaten by accident, when the chameleon is aiming at prey.
An all glass set-up is not good. It is much more difficult to establish proper gradients in glass enclosures and find a suitable size for a chameleon. There are options that are partially screen and partially glass or acrylic, and as long as they are densley planted, to minimize the chameleon being stressed by his/her own reflection, these can be ideal. Many people use an all screen set-up, which is easiest to acquire in adequate sizes, but not the easiest to keep the humidity up in. Many things are possible, with all three cage options, but what you need to do is find someone successful with the type of cage you want to use and compare notes, then check that against the care sheets and experienced keepers here.