I'm a little confused here - you can't buy pets for a ranger. So, the question is, are you talking about an actual *pet* that you can use in battle, or are you talking about a "mini-pet" which is basically a toy?
To get an actual PET, be a ranger or have ranger as your secondary profession. You can't buy them, you haveto go out into an explorable area and capture it.
To get a MINI-PET (like the one's you see in town) either buy one, get pig from the festival, or Have a character turn 1 year old.
like Kook said, you can have an actualy pet, put your second prof as ranger
you can get mini pets either from buying from others players or wait until one of your chhars turn 12 months old, then you get a birthday present..which will be a mini pet