Возможно ли как то подточить код? ))
Нет, подточить низя, можно только новый сделать )
Для того что бы учитывалась группа клиента "по умолчанию":
В controllers/MyAccountController.php:
self::$smarty->assign('customerGroup', parent::getDefaultCustomerGroup());
self::$smarty->assign('HOOK_CUSTOMER_ACCOUNT', Module::hookExec('customerAccount'));
Для тема/my-account.tpl ставим там где надо отображать.
Пример:
<h4>{l s='Welcome to your account. Here you can manage your addresses and orders.'}</h4>
{if in_array('2', $customerGroup)}
<p class="warning">
{l s='Message for group with ID2'}</p>
{elseif in_array('3', $customerGroup)}
<p class="warning">
{l s='Message for group with ID3'}</p>
{else}
{/if}
И самое главное для classes/FrontController.php:
protected static $currentCustomerGroups;
protected static $defaultCustomerGroup;
public static function getCurrentCustomerGroups()
{
if (!isset(self::$cookie) || !self::$cookie->id_customer)
return array();
if (!is_array(self::$currentCustomerGroups))
{
self::$currentCustomerGroups = array();
$result = Db::getInstance()->ExecuteS('SELECT id_group FROM '._DB_PREFIX_.'customer_group WHERE id_customer = '.(int)self::$cookie->id_customer);
foreach ($result as $row)
self::$currentCustomerGroups[] = $row['id_group'];
}
return self::$currentCustomerGroups;
}
public static function getDefaultCustomerGroup()
{
if (!isset(self::$cookie) || !self::$cookie->id_customer)
return array();
if (!is_array(self::$defaultCustomerGroup))
{
self::$defaultCustomerGroup= array();
$result = Db::getInstance()->ExecuteS('SELECT id_default_group FROM '._DB_PREFIX_.'customer WHERE id_customer = '.(int)self::$cookie->id_customer);
foreach ($result as $row)
self::$defaultCustomerGroup[] = $row['id_default_group'];
}
return self::$defaultCustomerGroup;
}
Ну и понятное дело что для {if in_array('
2', $customerGroup)} вместо '
2' надо ставить ID группы для которой будет сообщение...