edit products logic