For PySpark, You can use quinn which implemented a sort_column functions that support ordering both nested Struct and Array(Struct) fields. The implementation was originally inspired by @pault answer.
For Scala Spark, spark-daria sortColumnsBy which also support ordering nested Struct and Array(Struct). The scala API is a bit more flexible as it gives you ability to write your custom Ordering