Fresh coconuts in the Philippines are classified according to maturity (see visual guide on everything coconut).
Ambulant vendors do not sell mature coconuts that are meant for grating or squeezing out the milk (see how to extract coconut milk). That kind you have to buy in the market where the vendors have a special machine for grating the tough coconut meat.
What ambulant vendors sell are coconuts still soft enough to be scraped from the husk and eaten directly.
There are three ways to buy coconuts from these ambulant vendors. First, buy the coconuts as is and crack them open at home. Second, ask the vendor to crack the husk open, pour the juice into a plastic bag (you can bring your own container) and you bring home the juice and coconut halves, or you can have the top and side of the husks chopped off to expose the meat which you can pierce with a straw to drink the juice (see a photo — it was taken in Phuket but the same is done in the Philippines). Third, you can have the vendor scrape the coconut meat and put it in a container along with the juice. I don’t advise the third option for sanitary reasons.
Some vendors also sell coconut juice on the side, like the one in the photo.