Praise be to Allah.
It is possible to divide items sold in shops and grocery stores into two categories, with a different ruling for each category.
The first category:
This includes foods that it is thought most likely that the purchaser will eat as soon as he buys them, based on the type of food and the need for it, such as frozen items like ice cream, juice, cold drinks, and hot drinks in cups that are usually consumed at the time of purchase, or sweets that are made to be eaten straightaway, and similar kinds of food. It is not permissible for the Muslim to sell such items during the day in Ramadan, because it is thought most likely that the purchaser will transgress the sanctity of the sacred month by consuming them, whether he is a Muslim or not. The minor issues of sharee‘ah are addressed to all people, and for all people it is not permissible to cooperate in sin and transgression, as Allah, may He be exalted, says (interpretation of the meaning):
“Help you one another in Al-Birr and At-Taqwa (virtue, righteousness and piety); but do not help one another in sin and transgression. And fear Allah. Verily, Allah is Severe in punishment”
Imam ar-Ramli ash-Shaafa‘i (may Allah have mercy on him) said:
… A similar case is a Muslim who is accountable feeding a disbeliever who is accountable during the day in Ramadan, or selling him food when he knows or thinks it most likely that he will eat it during the day, as my father (may Allah have mercy on him) mentioned in his fatwa. That is because all of that may be a cause of sin or helping another person to sin, based on the fact that the minor issues of sharee‘ah are also addressed to the disbelievers, which is the view that is most likely to be correct.
End quote from Nihaayat al-Muhtaaj (3/471)
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said:
It is not permissible to open restaurants during the day in Ramadan, even if that is to serve disbelievers – and of course it is not permissible to do that for Muslims. Whoever among you sees a restaurant owner opening his restaurant during the day in Ramadan must inform the authorities of that so that they can stop him. No disbeliever should be allowed to eat or drink openly during the day in Ramadan in Muslim countries; they should be prevented from doing that.
End quote from al-Liqaa’ ash-Shahri (8/4)
In Fataawa al-Lajnah ad-Daa’imah (36/2-9) it says:
It is not permissible to open a restaurant during the day in Ramadan for disbelievers, or to serve them in the restaurant, because this is a serious transgression of sharee‘ah, and comes under the heading of helping them in that which Allah has prohibited. It is well-known according to Islamic teachings that both the fundamental and minor issues of sharee‘ah are addressed to the disbelievers; there is no doubt that the fast of Ramadan is one of the pillars of Islam, and that what they should do is observe that, after fulfilling the necessary condition, which is entering Islam. So it is not permissible for a Muslim to help them in refraining from doing what Allah has enjoined upon them. Likewise, it is not permissible for a Muslim to serve them in any way that is humiliating for the Muslim, such as serving them food and the like. Disbelievers who come to Muslim countries should be compelled not to do anything that is contrary to the laws of Islam and causes annoyance to the Muslims and upsets them. Hence it is essential to close the restaurant in the company mentioned during the day in Ramadan. End quote.
Shaykh ‘Abd al-‘Azeez ibn ‘Abdillah ibn Baaz, Shaykh ‘Abdullah ibn Ghadyaan, Shaykh Saalih al-Fawzaan, Shaykh ‘Abd al-‘Azeez Aal ash-Shaykh, Shaykh Bakr Abu Zayd.
The second category:
This includes food and drink concerning which the seller cannot know when the purchaser will consume them, whether it will be during the day or at night, such as canned goods, wrapped sweets, bread and all other grocery items such as olive oil, rice and so on, which form the majority of goods sold in stores, as far as we know. In this case, there is nothing wrong with the Muslim selling them during the day in Ramadan, and there is no sin on him for doing so. Even if he thinks it most likely that the purchaser is not fasting, because he is a non-Muslim or because he is a Muslim who is not fully committed to his faith, he does not know about what the purchaser will do with the things he buys. He may use them straight away, or he may not use them until later on, and they may expire and he may not benefit from them.
Moreover, there is no regular practice or usual way of using these purchased items, and no one has the ability to determine whether most people are buying them to eat them during the day or during the night, so this matter is open-ended.
In that case, the basic principle, that it is permissible to sell them, undoubtedly remains in effect, and it is not included in the prohibition on cooperating in sin and transgression, because no one can know for certain that these things will be used in a sinful and wrong manner. The basic principle is that it is permissible to sell them, and it is not permissible to move from that principle unless there is a good and convincing reason to do so.
You will find this condition referred to in what ar-Ramli said:
… Similarly, when he sells food, he knows or thinks it most likely that it will be consumed during the day…
With regard to the second category, the assumption is that the seller does not know and does not think it most likely that the purchaser will consume the food during the day in Ramadan, so the reason for the prohibition is not applicable; rather the ruling remains in effect that selling these products is permissible. The same applies in every transaction in which there is doubt about how the purchaser will use the item.
As ar-Ramli (may Allah have mercy on him) said:
Whoever says that the majority of scholars say that it is permissible in this case – but it is still makrooh – it is to be understood as referring to cases where there is still some doubt about the way in which the purchaser will use it.
End quote from Mughni al-Muhtaaj (3/471).
The majority of scholars who said that it is permissible to sell in such cases meant that it is permissible to sell if the seller is not sure and does not know the intention of the purchaser in purchasing that item.
Islamic teachings do not put people through hardship and do not enjoin on them that which they cannot bear. Expecting the seller to check on the intention of every purchaser comes under the heading of hardship and difficulty, as is quite clear, and is making life difficult for Muslims, and Allah, may He be glorified and exalted, does not want that, as He, may He be glorified, says (interpretation of the meaning):
“On no soul does Allah place a burden greater than it can bear. He gets reward for that (good) which he has earned, and he is punished for that (evil) which he has earned”
“Allah intends for you ease, and He does not want to make things difficult for you”
This second category cannot be compared to the prohibition on selling grapes to one who will press them and turn them into wine, because drinking wine is prohibited in all situations (in Ramadan and otherwise), and it is possible for the seller of grapes to think it likely that a particular purchaser will use what he buys in a sinful manner. As for the one who sells food during the day in Ramadan, it is not possible for him to think it most likely that a purchaser will use what he buys in a sinful manner.
And Allah knows best.