Smarty 2.6.26

How to add one more condition on OR for another controller? I could not get through (syntax error).

How to add one more condition on OR for another controller? I could not get through (syntax error).

Please try

Please try

Thank you! Happened! But how! I thought that, by the condition 'I', the conditions must be fulfilled simultaneously. Can not more than two controllers be executed right away ?!

Thank you! Happened! But how! I thought that, by the condition 'I', the conditions must be fulfilled simultaneously. Can not more than two controllers be executed right away ?!


No, only one controller can be used according to CS-Cart logic. But each controller can have .pre and .post controllers. Even in these controllers you will have main controller value in the runtime.controller

No, only one controller can be used according to login in CS-Cart. But each controller can have .pre and .post controllers. Even in these controllers you will have main controller value in the runtime.controller

I first used the logical "OR" (||) in the condition {if .....}. That it was carried out at performance of one of conditions. I did not think I needed to use the logical "AND" (&&).

I first used the logical "OR" (||) in the condition {if .....}. That it was carried out at performance of one of conditions. I did not think I needed to use the logical "AND" (&&).


You can also use

{if !($runtime.controller=='checkout' || $runtime.controller=='orders')}

You can also use

{if !($runtime.controller=='checkout' || $runtime.controller=='orders')}

Thank you! It works!

Hello, help me understand. In the override of the template, I create a block with a selectbox:

{__("bc_cloud_storage.save_file")}:
{__("bc_cloud_storage.server")}
{__("bc_cloud_storage.dropbox")}
The variable save_type in the controller file is not defined. I try to get it in PHP to find out what is selected - ($save_type = Registry::get('view')->getTemplateVars('save_type'), but the answer comes empty. So the variable save_type is not automatically created and it should be assigned? Then where in the template or in the controller?

Значит переменная save_type автоматически не создается и ее надо назначить? Тогда где в самом шаблоне или в контроллере?

Не очень понятно, что за переменная save_type. Но скорее всего она не определена в контроллере

Tygh::$app['view']->assign('save_type', $save_type);

Переменная save_type нигде не определена. Мне она нужна только для того, чтоб узнать что выбрали dropbox. Как мне это сделать? Нужно определить её в шаблоне через {assign var="save_type" value=0}?

Переменную save_type я употребил в при создании селектбокса для присвоения ей значений value="S" или value="D" :

{__("bc_cloud_storage.server")}

{__("bc_cloud_storage.dropbox")}

и мне нужно ее получить в контроллере (что выбрал пользователь?). И что-то у меня не получается, в контроллер пусто приходит..

Какой объект обнооляете? Товар? Поле в базу данных добавили? Там значение обновляется после отправки формы?

Здравствуйте, обновляю форму "Новый файл" для электронного товара. Возможность записывать файл-товар в облачное хранилище.

Здравствуйте, обновляю форму "Новый файл" для электронного товара. Возможность записывать файл-товар в облачное хранилище.

Надо на месте смотреть, что и как до этого сделано было

Здравствуйте, я меняю стандартную конфигурацию CS-Cart. Как в стандартном модуле attachments, в контроллере products.post.php я создаю переменную $save_type и передаю ее:

if ($mode == 'update') {
$save_type='S';
Tygh::$app['view']->assign('save_type', $save_type);
}
В шаблоне \cscart\design\backend\templates\views\products\update.tpl переменная $save_type и равна "S". А вот в нужном мне шаблоне \cscart\design\backend\templates\views\products\update_file.tpl её нет. Нужно как-то её туда передать. Вот есть хук:
{** Products files section **}
{if $settings.General.enable_edp == "Y"}
{hook name="products:content_files"}
{include file="views/products/components/products_update_files.tpl"}
{/hook}
{/if}
{** /Products files section **}
Думаю в своем модуле к нему обратится, сделать override?

на первый взгляд, вижу, что вы передаете переменную для $mode == 'update' (вызывается шаблон update.tpl), а используете $mode == 'update_file' (вызывается шаблон update_file.tpl)

Если у вас update_file.tpl показывается аяксом через какой-то другой $mode, то передавать переменную нужно именно для этого $mode

Здравствуйте, спасибо! Все получилось!