The defense chose not to invoke an 'advice of counsel' defense for several reasons, but Trump still enjoys some of the benefits.
The poster's question illustrates this: "Did Cohen warn Trump that it was illegal?"
The jury already knows that Cohen was actively involved from the very start, and that it was Cohen and Weisselberg who setup the payment schedule and amounts.
The defense doesn't have to ask Cohen if he gave Trump advice that the payoffs were legal, and Trump doesn't have to say he asked. Cohen was the architect of the plan, and the jury already knows this.
Most people expect that an attorney will warn his client if he is about to do something illegal, so there is an implicit "advice of counsel" built into the case that the jury will just assume.