Добрый день
версия 4.18.4
ранее такого не наблюдалось
в своем модуле цепляюсь к хуку orders:order_status в файле view/orders/details.tpl
через файл orders/order_status.post.tpl
через post хука добавляю свою информацию под кнопкой статуса заказа в боковой панели.
кусок кода с хуком:
<div class="control-group" id="order_status_block">
<div class="control-label"><h4 class="subheader">{__("status")}</h4></div>
<div class="controls">
{hook name="orders:order_status"}
{$get_additional_statuses=true}
{$order_status_descr=$smarty.const.STATUSES_ORDER|fn_get_simple_statuses:$get_additional_statuses:true}
{$extra_status=$config.current_url|escape:"url"}
{if "MULTIVENDOR"|fn_allowed_for}
{$notify_vendor=true}
{else}
{$notify_vendor=false}
{/if}
{$statuses = []}
{$order_statuses=$smarty.const.STATUSES_ORDER|fn_get_statuses:$statuses:$get_additional_statuses:true}
{include file="common/select_popup.tpl"
type="orders"
suffix="o"
id=$order_info.order_id
status=$order_info.status
items_status=$order_status_descr
update_controller="orders"
notify=true
notify_department=true
notify_vendor=$notify_vendor
status_target_id="content_downloads,order_status_block"
extra="&return_url=`$extra_status`"
statuses=$order_statuses
popup_additional_class="dropleft"
btn_meta="btn btn-info o-status-`$order_info.status` order-status"|lower
text_wrap=true
}
{/hook}
</div>
<!--order_status_block--></div>
то есть хук находится внутри блока, который обновляется при смене статуса.
Так вот, обнаружил, что теперь при смене статуса заказа разметка из моего order_status.post.tpl дублируется, идет подряд два раза. Что интересно, при очередной смене статуса, если не перезагружать страницу - дубля так и остается два.
Много уже чего перекопал, но пока так и не смог понять, как при обычной GET загрузке страницы мой хук цепляется один раз, а при вызове AJAX - он же цепляется к хуку два раза…