Ottoman Empire sharia comes from the Hanafi Madhhab, which is the largest Islamic legal school. It existed alongside "secular" courts. Sultan Suleiman the Magnificent is also called Suleiman the Kanuni which means the Lawgiver because he transformed the "secular" laws (called Kanun) from traditions to a codified legal system. In the Ottoman empire, Kanun and Sharia existed side by side. Kanun were used in criminal law, taxation, and land ownership, while sharia was used in other matters like family law. While they were separate everything in Kanun had to be acceptable in within Sharia.
On top of this system was the Ottoman Millet system. The Ottomans treated each non-Muslim religious community as separate nation or "millet" and were allowed to administer their own religious law to their religious communities, unless the legal disputes involved the Ottoman state or its Muslim subjects then they were brought to the appropriate sharia or kanun court.