@bythewell - I worked in retail for a while and even if they don't get commission retail workers are usually trained to approach customers for several reasons. We had a 30 second rule that we had to make eye contact within that time and a two minute rule that we had to ask if they needed help by then.
It wasn't just in order to get them to buy things. Making contact meant that they would be less likely to steal anything, because they knew they had been acknowledged, which can be important in a small store. It's also important to let a person know that you see them as a person and aren't ignoring them. For every customer that would prefer no interaction, there's another one that would be offended without a friendly "hello".
And it does help sales if you are nice to people, because they will start feeling loyalty towards the store. That only works if the workers are genuinely nice though, which is a difficult thing to train into them.