Well, they don't know if you are buying them for yourself or another person, and most people will automatically assume it's for someone else. I've even asked about dress sizes at one store (legitimately for my girlfriend) and the lady didn't bat an eye at me or think it was odd a guy would be asking about a very pretty dress. For all anyone knows, you are buying something you think your SO will look good in, something you think they will like for a present, or any other reason.
And of course it doesn't get anymore discreet than the internet. And not only is it 100% discreet, I have found the selection is often much better than in store.