Это содержимое ps_socialfollow.tpl по умолчанию:
Код: Выделить всё
{block name='block_social'}
[list]
{foreach from=$social_links item='social_link'}
[*][url={$social_link.url}]{$social_link.label}[/url]
{/foreach}
[/list]
{/block}
Код: Выделить всё
{block name='block_social'}
{if $language.language_code == 'en-us'}
[list]
[*]{$social_link.label}
[*]{$social_link.label}
[*]{$social_link.label}
[*]{$social_link.label}
[*]{$social_link.label}
[/list]
{elseif $language.language_code == 'ko'}
[list]
[*]{$social_link.label}
[*]{$social_link.label}
[*]{$social_link.label}
[*]{$social_link.label}
[*]{$social_link.label}
[/list]
{/if}
{/block}
Код: Выделить всё
> ContextErrorException in smarty_internal_templatebase.php(157) :
> eval()'d code line 68:
> Notice: Undefined index: social_link
> in smarty_internal_templatebase.php(157) : eval()'d code line 68
> at ErrorHandler->handleError('8', 'Undefined index: social_link', '/var/www/html/store/vendor/prestashop/smarty/sysplugins/smarty_internal_templatebase.php(157)
> : eval()'d code', '68', array('_smarty_tpl' =>
> object(SmartyDevTemplate))) in smarty_internal_templatebase.php(157) :
> eval()'d code line 68
> at content_5b4fc96564eec0_18848187(object(SmartyDevTemplate)) in smarty_internal_templatebase.php line 188
> at Smarty_Internal_TemplateBase->fetch(object(SmartyDevTemplate), null, null, null, false, true, false) in SmartyDevTemplate.php line 41
> at SmartyDevTemplateCore->fetch() in Module.php line 2282
> at ModuleCore->fetch('module:ps_socialfollow/ps_socialfollow.tpl', 'ps_socialfollow|1|3|3|3|1|1') in ps_socialfollow.php line 201
> at Ps_Socialfollow->renderWidget('displayFooterAfter', array('smarty' => object(SmartyDevTemplate), 'cookie' =>
> object(Cookie), 'cart' => object(Cart), 'altern' => '1')) in Hook.php
> line 929
> at HookCore::coreRenderWidget(object(Ps_Socialfollow), 'displayFooterAfter', array('smarty' => object(SmartyDevTemplate),
> 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => '1'))
> in Hook.php line 881
> at HookCore::exec('displayFooterAfter', array('smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' =>
> object(Cart), 'altern' => '1'), null) in smarty.config.inc.php line
> 168
> at smartyHook(array('h' => 'displayFooterAfter'), object(SmartyDevTemplate)) in SmartyLazyRegister.php line 83
> at SmartyLazyRegister->__call('smartyHook', array(array('h' => 'displayFooterAfter'), object(SmartyDevTemplate))) in
> smarty_internal_templatebase.php(157) : eval()'d code line 691
> at content_5b4fc96527b774_70366195(object(SmartyDevTemplate)) in smarty_internal_templatebase.php(157) : eval()'d code line 248
> at content_5b4fc965282d34_37575711(object(SmartyDevTemplate)) in smarty_internal_templatebase.php line 188
> at Smarty_Internal_TemplateBase->fetch('index.tpl', null, 'layouts/layout-full-width.tpl', object(SmartyDev), false, true,
> false) in SmartyDev.php line 41
> at SmartyDev->fetch('index.tpl', null, 'layouts/layout-full-width.tpl') in FrontController.php line 684
> at FrontControllerCore->smartyOutputContent('index.tpl') in FrontController.php line 668
> at FrontControllerCore->display() in Controller.php line 273
> at ControllerCore->run() in Dispatcher.php line 428
> at DispatcherCore->dispatch() in index.php line 28
Какие изменения мне придется внести? Как правильно реализовать поддержку нескольких языков (веб-сайтов) в этом модуле?
Я отредактировал ps_socialfollow.tpl в соответствии с предложением Александра Гросула.
Код: Выделить всё
[list]
[*]{$social_link.facebook.label}
[*]{$social_link.twitter.label}
[*]{$social_link.instagram.label}
[*]{$social_link.googleplus.label}
[*]{$social_link.pinterest.label}
[/list]
Я тоже пробовал эту версию:
Код: Выделить всё
{block name='block_social'}
[list]
{foreach from=$social_links item='social_link'}
{if $language.language_code == 'en-us'}
[*]{$social_link.label}
[*]{$social_link.label}
[*]{$social_link.label}
[*]{$social_link.label}
[*]{$social_link.label}
{elseif $language.language_code == 'ko'}
[*]{$social_link.label}
[*]{$social_link.label}
[*]{$social_link.label}
[*]{$social_link.label}
[*]{$social_link.label}
{/if}
{/foreach}
[/list]
{/block}
Подробнее здесь: https://stackoverflow.com/questions/514 ... tilanguage
Мобильная версия