Narrated Abu Hurairah:
The Messenger of Allah (ﷺ) prohibited two sales in one.
There are narrations on this topic from 'Abdullah bin 'Amr, Ibn 'Umar, and Ibn Mas'ud.
[Abu Eisa said:] The Hadith of Abu Hurairah is a Hasan Sahih Hadith.
This is acted upon according to the people of knowledge. Some of the people of knowledge have explained it by saying that two sales in one is when one says: I will sell you this garment for ten in cash, and twenty on credit. He does not distinguish between either of the two sales. But when he distinguishes it as being one of them, then there is no harm when one of them is agreed upon.
Ash-Shafi'i said: Included in the meaning of what the Prophet (ﷺ) prohibited of regarding two sales in one, is if one said: 'I will sell you the house of mine for that (price), upon the condition that you sell me you alve for this (price). When I get the slave, then you get the house.' In this way the sales are distinguished without the prices being known, and neither of them knows what will happen at the conclusion of it (the agreement).