San Francisco will mandate a fee of 17 cents per plastic or paper bag used in city grocery stores.