These type of faults are often caused by the actuator which opens the soap dispenser during the wash, obviously its worth checking that there isnt something like a cutting board leaning against it when you shut the door.
If the compartment opens manually then its unlikely to be the dispenser at fault, the way to test is to strip the door down, and see if the actuator is stuck or the dispenser mechanism has come away or broken in anyway. A continuity test on the actuator will quickly show it the fault is electrical (at which case its the control board).
From experience the actuators are the most prone to fail.
Please let me know if you need anything else clarified.
The actuator used to come as a separate part, but cant find any stockists. You can probably get the actuator from somewhere like rapid electronics or RS components, but you would need to get the actuator out of the machine to try and match it up.
If you buy the dispenser from here for example it comes complete with the actuator.
Yes, thats your best bet, and probably makes the job easier as your just replace the complete unit you dont have to worry about stripping it down and prise the actuator out.