I've got a 2G iPhone and a limited budget and wanted in on this barcode-scanning fun as well. I googled some things and was inspired by this, but it wasn't quite what I wanted. I finally came up with the following cheap (free) solution.
What you need:
-a disposable camera. You can get these from most any photo counter, for processing they just crack the film out and will recycle the rest. They'll usually give you a handful of cameras for free if you tell them you're doing a project.
-a flathead screwdriver or something else to pry the camera case open.
-a flexible iPhone case. Not necessary, but you've gotta mount the lens somehow. I got a case for $5 at 5 Below.
Step 1: Assess the salvaged disposable camera
WARNING!!! These cameras have a large capacitor for the flash which can give you a very damaging shock if you touch it. Stay away from the circuit board or you may get injured. The people at the photo place will probably warn you about this as well. You should probably wear safety goggles for this project.
Also, do NOT press the "flash" button before you start to take apart the camera, or you can be sure that you've made the project a lot more dangerous than it needs to be.