Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Check if we are in BackOffice in PHP, not in JS
  • Loading branch information
Kamil committed Dec 11, 2019
1 parent df8dbce commit 23bc6c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions custompopup.php
Expand Up @@ -48,7 +48,7 @@ public function __construct()
{
$this->name = 'custompopup';
$this->tab = 'front_office_features';
$this->version = '2.2.0';
$this->version = '2.3.0';
$this->author = 'PrestaCraft';
$this->need_instance = 0;
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
Expand Down Expand Up @@ -383,7 +383,9 @@ public function functionHook()
$all = array_merge($langContent, $scripts, $assign);
$this->context->smarty->assign($all);

return $this->display(__FILE__, 'custompopup.tpl');
if (!Context::getContext()->employee->id) {
return $this->display(__FILE__, 'custompopup.tpl');
}
}

// ---- Hooks [end] ----
Expand Down
2 changes: 0 additions & 2 deletions views/templates/hook/custompopup.tpl
Expand Up @@ -16,7 +16,6 @@
<script src="{/literal}{$pc_js_tingle}{literal}"></script>
<script src="{/literal}{$pc_js_cookie}{literal}"></script>
<script>
if (!$("body").hasClass("ps_back-office")) {
if (typeof id_lang === 'undefined') {
var id_lang = {/literal}{Context::getContext()->language->id}{literal};
}
Expand Down Expand Up @@ -109,7 +108,6 @@
}, {/literal}{$pc_popup_delay*1000}{literal});
{/literal}{/if}{literal}
}
}
</script>
{/literal}

Expand Down

0 comments on commit 23bc6c5

Please sign in to comment.