The Decalogue appears in Exodus 20. The two 'great commandments' appear in Deuteronomy and Leviticus respectively, so they cannot precede the Decalogue.The Two Great Commandments preceded the Ten. Because the Ten HUNG from them. The Two did not HANG from the Ten.
“On these two commandments hang all the law and the prophets.” (Matthew 22:40) (KJV 1900)
What you don't seem to understand is that the twofold command does not replace the Decalogue, it summarizes or epitomizes it. And the great thing is that we learn is that the Decalogue is not just a series of 'Thou shalt nots' but is actually based on love. When we love God with all our heart, mind, soul and strength we shall do so by observing the first four Commandments. When we love our neighbour as our self, we do so by observing the second six. they are not in competition, but in the sweetest of harmony.
The 'law and the prophets' are the whole Old Testament. The twofold command is the peg from which the O.T. hangs because the entire O.T., with all its commandments and covenants, prophecies and promises, types, testimonies, invitations and exhortations, points to the love of God which demands the response of love from mankind. That is why the Lord Jesus says, "If you love Me, keep My commandments." All ten of them.