Cheap alternative to an accelerometer
As Chris suggests, a ball tilt switch is the standard cheap approach for detecting orientation. The lowest-cost option appears to be the SW-200D, available for under 5 cents in quantity:  This will close a contact when the gold-colored lead is below the horizontal, and open it when the silver-colored lead is below the horizontal, with a hysteresis of up to 30 degrees. If your product can be in several different orientations, distinguishing vertical might required more than one of these switches, mounted at different orientations. A better option, though a bit hard to find, is the SW-520, about 12 cents in quantity, which only makes contact when within 45 degrees of upright:  Of course, an accelerometer gives you a lot more options and flexibility. The best price I've found there is for the MMA8653, at 35 cents in quantity.