The royal prerogative seems to be the source of UK's government's power to conduct foreign affairs. But does it completely cover trade treaties, i.e. before joining the EU was parliamentary ratification of trade treaties required in the UK, or was the government's signature equivalent to ratification as well?
There is actually a parliamentary briefing paper on this subject. The short version is that prior to Constitutional Reform and Governance Act 2010, parliament had no statutory role in the ratification of treaties, but since 1924 an informal 'rule' meant that the Government would present them for scrutiny prior to ratification, with the Government dealing with signing and ratifying.
Note the other important statement in that paper is that:
"The UK is a ‘dualist’ state, which means that treaties are seen as automatically creating rights and duties only for the Government under international law. When the Government ratifies a treaty – even with Parliamentary involvement – this does not amount to legislating. For a treaty provision to become part of domestic law, the relevant legislature must explicitly incorporate it into domestic law."
So even a ratified treaty wouldn't constitutionally force parliament to create relevant domestic legislation (or accept, in the case of secondary legislation created by government ministers).