I have put many zippers in cushion covers. If you are using a top piece, a bottom piece and then a piece that goes around the middle or edge of the pillow, you would cut two strips (with seam allowance so that the finished size is the same as the rest of the strip), sew the zipper between the two strips and then attach it to the original strip and sew it to the top and bottom pieces.
For throw pillows, I do the "envelope" type using two pieces on the back, overlapping them approximately two inches and use velcro or not.
Good luck!