Thanks for all your help! With both your replies I managed to get it working.
What worked was:
Code:
{php}$variable=$this->_tpl_vars['products'][0]['extra_fields']['0']['value'];{/php}
Annoyingly it has to have a the cart id value [0], and ['product'] didn't work. I sorted it out by having a variable which I looped:
Code:
{php}
$cartid=0;
$variable=$this->_tpl_vars['products'][$cartid]['extra_fields']['0']['value'];
$cartid=$cartid+1;
{/php}
This is very ugly but it works. Thanks again.