Diary of a Wimpy Kid hats are hard to find because 1) only a couple of styles were made, 2) they were made for a limited time, and 3) they are sold out in most places.
Amazon has had a couple in stock but they sell out quickly and are often through resellers.
Borders has a purple one but it is not available locally. If you are lucky, you can keep trying back at your local stores or Borders.com and they do come into stock every now and again.
If you are in a pinch and not looking for any particular hat, Retrofacts is selling some through their eBay store as well:
[phpbay]wimpy kid hat, 15[/phpbay]