You can order a sim online or buy it from a Digicel kiosk at San Salvador Airport, or convenience stores.
You might not even need to register it under your name, but make sure to get it activated.
Note: Foreign sim cards will work on unlocked phones only. So, contact your provider at home before your El Salvador trip.