Switching between two sources of power to a battery?
You can use a Schottky diode in series at the charger and solar panel and then connect them both to the battery. The drawback is a ~0.3V drop on the diode. Not a problem in case of the charger, but will reduce the power output of the solar cell. On the other hand - smaller PCB area, cheaper and more reliable.