Skip to content

Instantly share code, notes, and snippets.

@gskema
Created May 10, 2015 08:21
Show Gist options
  • Save gskema/751e2791b35008beb71f to your computer and use it in GitHub Desktop.
Save gskema/751e2791b35008beb71f to your computer and use it in GitHub Desktop.
Minor method modification: 'company_name'
<?php
if (!defined('_PS_VERSION_'))
exit;
class BlockUserInfoOverride extends BlockUserInfo
{
public function hookDisplayTop($params)
{
if (!$this->active)
return;
$this->smarty->assign(array(
'company_name' => ($this->context->customer->logged ? $this->context->customer->company : false),
'cart' => $this->context->cart,
'cart_qties' => $this->context->cart->nbProducts(),
'logged' => $this->context->customer->isLogged(),
'customerName' => ($this->context->customer->logged ? $this->context->customer->firstname.' '.$this->context->customer->lastname : false),
'firstName' => ($this->context->customer->logged ? $this->context->customer->firstname : false),
'lastName' => ($this->context->customer->logged ? $this->context->customer->lastname : false),
'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order'
));
return $this->display(__FILE__, 'blockuserinfo.tpl');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment