Traditionally most fees are paid for upon completion except for conveyancing searches which are usually paid for at the start of the process. If you pull out of a sale or purchase before legally committing yourself then your solicitors may charge of a percentage of the overall legal fees for their time spent working on your case.
Related Pages
How Long will Conveyancing Take?
At what point shall I instruct a solicitor?