For the hat, I have never been able to keep hats on either of my children. Sorry I couldn't help on that one.
Sunglasses on the other hand, we have had many. You can get toddler sunglasses at most retailers, just look for the ones with the 100% UV protection sticker. I have yet to see a pair that doesn't have that on them. They have them at Kohl's, Target, and Wal-Mart. I have gotten pairs at all of those places, because my children area AWESOME at losing things (as am I so I can't complain *laugh*) They do make some that are called "Kid Tough" that are much harder to break. I believe those were at Wal-Mart and ran about $5.
edit:
OH! and Children's Place has a great selection of them! They don't cost a fortune, but are still the 100% UV protection. If there is a store near you, I would go and check them out, they are almost always on sale, or else try the website.
http://www.childrensplace.com/webapp/wcs/stores/servlet/c...