This is indeed the case.
Unfortunately the sources are in French (see for instance https://droit-finances.commentcamarche.com/faq/23970-refus-d...).
From that source:
> Le refus de vente à un particulier est prohibé par la législation. Cette interdiction est posée par l'article L121-11 du Code de la consommation. Elle s'applique aussi bien aux ventes de produits qu'aux prestations de services.
This loosely means that not accepting a sale to a individual is forbidden. The law covers goods and services (article L121-11 of a code for "consumption" (includes sales)).
There are "special cases" when a seller can refuse to sell and they were specified by courts. Some examples:
- no more items in stock (one cannot force a seller to get more stocks of a given product)
- enormous amounts of a given good
- customer who poses a danger to the seller (violence, insults)
- customer who is known to be unable to pay
- customer who would like to buy illegal goods in his context (e.g. alcohol for underage customers)
Generally speaking, there must be a very, very good reason to decline a sale. "No shirt, no shoes, no service" is not one of them (to take your example - because walking without shoes or shirt is allowed in France)