You can do it also like this:
modules/blockcontact/blockcontact.php
public function hookDisplayRightColumn($params) {
global $smarty;
$tpl = 'blockcontact';
if (isset($params['blockcontact_tpl']) && $params['blockcontact_tpl'])
$tpl = $params['blockcontact_tpl'];
// ADD THIS LINES
// assign customer firstname and lastname before caching tempate
$smarty->assign(array(
'customer_firstname' => $this->context->customer->firstname,
'customer_lastname' => $this->context->customer->lastname,
));
// END
if (!$this->isCached($tpl . '.tpl', $this->getCacheId()))
$smarty->assign(array(
'telnumber' => Configuration::get('BLOCKCONTACT_TELNUMBER'),
'email' => Configuration::get('BLOCKCONTACT_EMAIL'),
'customer_firstname' => $this->context->customer->firstname,
'customer_lastname' => $this->context->customer->lastname,
));
return $this->display(__FILE__, $tpl . '.tpl', $this->getCacheId());
}
and then in template (e.g. themes/default-theme/modules/blockcontact/nav.tpl) use {nocache}{/nocache} smarty function to customer firstname and lastname:
{nocache}{$customer_firstname} {$customer_lastname}{/nocache}