Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-25 21:31:33 +02:00
parent 3230af667b
commit ce27ff88f3
85 changed files with 2279 additions and 335 deletions

View File

@@ -3,6 +3,12 @@
"migracja": { "migracja": {
"public_html": { "public_html": {
"wyczarujprezent.pl": { "wyczarujprezent.pl": {
".env": {
"type": "-",
"size": 107,
"lmtime": 1775661148644,
"modified": false
},
".gitignore": { ".gitignore": {
"type": "-", "type": "-",
"size": 9, "size": 9,
@@ -484,6 +490,22 @@
"lmtime": 0, "lmtime": 0,
"modified": false "modified": false
}, },
"scripts": {
"__pycache__": {
"prestashop_orphan_images_cleanup.cpython-312.pyc": {
"type": "-",
"size": 16311,
"lmtime": 1775665307074,
"modified": false
}
},
"prestashop_orphan_images_cleanup.py": {
"type": "-",
"size": 12356,
"lmtime": 1775665297756,
"modified": false
}
},
"sitemap_shop_1.xml2": { "sitemap_shop_1.xml2": {
"type": "-", "type": "-",
"size": 271, "size": 271,
@@ -622,7 +644,15 @@
"lmtime": 0, "lmtime": 0,
"modified": false "modified": false
}, },
"zamowienie": {} "zamowienie": {},
"backups": {
"orphan_images_backup_20260408_183822.tar.gz": {
"type": "-",
"size": 0,
"lmtime": 1775666548551,
"modified": false
}
}
} }
} }
} }

View File

@@ -0,0 +1,278 @@
<?php
/**
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PrestaShop\PrestaShop\Core\Module\WidgetInterface;
require_once _PS_MODULE_DIR_ . 'an_banners/classes/anBanners.php';
require_once _PS_MODULE_DIR_ . 'an_banners/hooks_ignore.php';
class an_banners extends Module implements WidgetInterface
{
const PREFIX = 'an_b_';
protected $_tabs = [
[
'class_name' => 'AdminAnBanners',
'parent' => 'AdminParentModulesSf',
'name' => 'Banners',
'active' => 0
],
];
public function __construct()
{
$this->name = 'an_banners';
$this->tab = 'others';
$this->version = '1.0.8';
$this->author = 'Anvanto';
$this->need_instance = 0;
$this->bootstrap = true;
$this->module_key = '';
parent::__construct();
$this->displayName = $this->l('Banners, Simple text and others for theme');
$this->description = $this->l('Banners, Simple Text and others for themes y Anvanto');
$this->confirmUninstall = $this->l('Are you sure you want to uninstall the module?');
$this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_);
}
/**
* @return bool
*/
public function install()
{
$sql = include _PS_MODULE_DIR_ . $this->name . '/sql/install.php';
foreach ($sql as $_sql) {
Db::getInstance()->Execute($_sql);
}
$languages = Language::getLanguages();
foreach ($this->_tabs as $tab) {
$_tab = new Tab();
$_tab->active = $tab['active'];
$_tab->class_name = $tab['class_name'];
$_tab->id_parent = Tab::getIdFromClassName($tab['parent']);
if (empty($_tab->id_parent)) {
$_tab->id_parent = 0;
}
$_tab->module = $this->name;
foreach ($languages as $language) {
$_tab->name[$language['id_lang']] = $this->l($tab['name']);
}
$_tab->add();
}
$parent = parent::install();
$hooks = anBanners::importJsonBanners();
$listHooksForRegister = [];
foreach ($hooks as $hook) {
$listHooksForRegister[$hook] = $hook;
}
$this->registerHook('displayHeader');
foreach ($listHooksForRegister as $hook) {
$this->registerHook($hook);
}
return $parent;
}
/**
* @return bool
*/
public function uninstall()
{
$sql = include _PS_MODULE_DIR_ . $this->name . '/sql/uninstall.php';
foreach ($sql as $_sql) {
Db::getInstance()->Execute($_sql);
}
foreach ($this->_tabs as $tab) {
$_tab_id = Tab::getIdFromClassName($tab['class_name']);
$_tab = new Tab($_tab_id);
$_tab->delete();
}
return parent::uninstall();
}
/**
* @param $hookName
* @param array $params
* @return mixed|void
*/
public function renderWidget($hookName, array $params)
{
$banners = anBanners::getBanners($hookName);
$this->smarty->assign('banners', $banners);
return $this->fetch('module:' . $this->name . '/views/templates/front/banners.tpl');
}
/**
* @param $hookName
* @param array $params
* @return array
*/
public function getWidgetVariables($hookName, array $params)
{
return;
}
public function getHooksList($file = 'hooks')
{
if (Tools::file_exists_no_cache(_PS_MODULE_DIR_ . 'an_banners/'.$file.'.php')) {
return include _PS_MODULE_DIR_ . 'an_banners/'.$file.'.php';
} else {
return array();
}
}
/**
* @return bool
*/
public function hookFilter($hook)
{
$res = strpos(Tools::strtolower($hook['name']), 'admin') === false;
$res &= strpos(Tools::strtolower($hook['name']), 'backoffice') === false;
$ignoreHooks = $this->getHooksList('hooks_ignore');
if (in_array($hook['name'], $ignoreHooks)){
$res &= false;
}
return $res;
}
/**
* @return array
*/
public function getHooksQuery()
{
$hooksQuery = array();
$hooks = Hook::getHooks(true, true);
$prestaHooks = array_filter($hooks, array($this, 'hookFilter'));
if (version_compare(_PS_VERSION_, '1.7.0.0', '<') == 1) {
foreach ($this->getHooksList() as $hookname) {
$hooksQuery[] = array('name' => $hookname);
}
return array_merge($hooksQuery);
} else {
foreach ($this->getHooksList() as $hookname) {
if (!in_array($hookname, array_column($prestaHooks, 'name'))) {
$hooksQuery[] = array('name' => $hookname);
}
}
return array_merge($hooksQuery, $prestaHooks);
}
}
public function getContent()
{
Tools::redirectAdmin($this->context->link->getAdminLink('AdminAnBanners'));
}
public function hookHeader()
{
$this->hookDisplayHeader();
}
public function hookDisplayHeader()
{
$this->context->controller->registerStylesheet(
$this->name . "_css",
'modules/' . $this->name . '/views/css/front.css',
['server' => 'local', 'priority' => 150]
);
$this->context->controller->registerJavascript(
$this->name . "_js",
'modules/' . $this->name . '/views/js/front.js',
['server' => 'local', 'priority' => 150]
);
}
public function topPromo()
{
$this->context->smarty->assign('theme', $this->getThemeInfo());
return $this->display(__FILE__, 'views/templates/admin/top.tpl');
}
public function getThemeInfo()
{
$theme = [];
$themeFileJson = _PS_THEME_DIR_.'/config/theme.json';
if (Tools::file_exists_no_cache($themeFileJson)) {
$theme = (array)json_decode(Tools::file_get_contents($themeFileJson), 1);
}
if (!isset($theme['url_contact_us']) || $theme['url_contact_us'] == ''){
$urlContactUs = 'https://addons.prestashop.com/contact-form.php';
if (isset($theme['addons_id']) && $theme['addons_id'] != ''){
$urlContactUs .= '?id_product=' .$theme['addons_id'];
} elseif (isset($this->url_contact_us) && $this->url_contact_us != ''){
$urlContactUs = $this->url_contact_us;
} elseif (isset($this->addons_product_id) && $this->addons_product_id != ''){
$urlContactUs .= '?id_product=' .$this->addons_product_id;
}
$theme['url_contact_us'] = $urlContactUs;
}
if (!isset($theme['url_rate']) || $theme['url_rate'] == ''){
$urlRate = 'https://addons.prestashop.com/ratings.php';
if (isset($theme['addons_id']) && $theme['addons_id'] != ''){
$urlRate .= '?id_product=' .$theme['addons_id'];
} elseif (isset($this->url_rate) && $this->url_rate != ''){
$urlRate = $this->url_rate;
} elseif (isset($this->addons_product_id) && $this->addons_product_id != ''){
$urlRate .= '?id_product=' .$this->addons_product_id;
}
$theme['url_rate'] = $urlRate;
}
return $theme;
}
}

View File

@@ -0,0 +1 @@
[{"id_banner":"12","special_id_banner":"69e27b33a1185","hook":"displayFooterBefore","col":"12","active":"1","position":"0","template":"default","title":"","text":"","link":"#","image":"c584836401b44f9da10bfe3086305b33_1.jpg","id_lang":"1"},{"id_banner":"7","special_id_banner":"66bc9a8ed3b10","hook":"displayHome","col":"3","active":"1","position":"1","template":"default","title":"","text":"","link":"#","image":"b48be74beecad20e6975fc01bf8eee21_1.png","id_lang":"1"},{"id_banner":"6","special_id_banner":"66bc99eb9769b","hook":"displayHome","col":"3","active":"1","position":"2","template":"default","title":"","text":"","link":"#","image":"6bc1610c0c3f7bd7426223e2caca289c_1.png","id_lang":"1"},{"id_banner":"10","special_id_banner":"66c5c2b0e3adc","hook":"displayHome","col":"3","active":"1","position":"3","template":"default","title":"","text":"","link":"#","image":"6b91a14039a6b640fa273d97f24d3cf4_1.webp","id_lang":"1"},{"id_banner":"8","special_id_banner":"66bc9aad225e6","hook":"displayHome","col":"3","active":"1","position":"4","template":"default","title":"","text":"","link":"#","image":"68c738d264898756a2d704739aa5c5f3_1.png","id_lang":"1"},{"id_banner":"2","special_id_banner":"6346cae48c84e","hook":"displayHome","col":"3","active":"1","position":"5","template":"default","title":"","text":"","link":"#","image":"23d8bbd7db86422dccc6129e97b921db_1.png","id_lang":"1"},{"id_banner":"1","special_id_banner":"6346cae451b9a","hook":"displayHome","col":"3","active":"1","position":"6","template":"default","title":"","text":"","link":"#","image":"ca0f7e8439a85f0c9b56f9ca1525b70b_1.png","id_lang":"1"},{"id_banner":"4","special_id_banner":"66bc999cf4062","hook":"displayHome","col":"3","active":"1","position":"7","template":"default","title":"","text":"","link":"#","image":"cf7cb9245a9a6874135e7c835497a03c_1.png","id_lang":"1"},{"id_banner":"5","special_id_banner":"66bc99c56c11d","hook":"displayHome","col":"3","active":"1","position":"8","template":"default","title":"","text":"","link":"#","image":"0c543039a5c020ec0a10e816166d402e_1.png","id_lang":"1"},{"id_banner":"3","special_id_banner":"6346cb1ea01e9","hook":"displaySaleBanner","col":"12","active":"1","position":"9","template":"default","title":"","text":"","link":"#","image":"1f2f57c9942475824605db7fb8002845_1.png","id_lang":"1"}]

View File

@@ -0,0 +1,265 @@
<?php
/**
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
class anBanners extends ObjectModel
{
/**
* @var int
*/
public $id_banner;
/**
* @var int
*/
public $id;
public $hook;
public $col = 12;
public $special_id_banner;
public $active = 1;
public $position;
public $template;
public $title;
public $text;
public $link;
public $image;
/**
* @var array
*/
public static $definition = [
'table' => 'an_banners',
'primary' => 'id_banner',
'multilang' => true,
'fields' => [
'special_id_banner' => ['type' =>self::TYPE_STRING ],
'active' => ['type' => self::TYPE_BOOL, 'validate' => 'isBool'],
'position' => ['type' =>self::TYPE_INT ],
'hook' => ['type' =>self::TYPE_STRING],
'col' => ['type' =>self::TYPE_STRING,],
'template' => ['type' =>self::TYPE_STRING ],
'title' => ['type' =>self::TYPE_STRING,'lang' => true ],
'text' => ['type' =>self::TYPE_HTML,'lang' => true ],
'link' => ['type' =>self::TYPE_STRING,'lang' => true ],
'image' => ['type' =>self::TYPE_STRING,'lang' => true ],
],
];
public const imgDir = _PS_MODULE_DIR_.'an_banners/img/';
public const imgUrl = __PS_BASE_URI__.'modules/an_banners/img/';
public const fileJsonBanners = _PS_MODULE_DIR_ . 'an_banners/banners.json';
public const tplsDir = _PS_MODULE_DIR_ . 'an_banners/views/templates/front/banners/';
public const tplsThemeDir = _PS_THEME_DIR_ . 'modules/an_banners/banners/';
public const tplPath = _PS_MODULE_DIR_ . 'an_banners/views/templates/front/banners/';
/**
* Formula constructor.
*
* @param null $id
*/
public function __construct($id = null, $id_lang = null)
{
parent::__construct($id, $id_lang);
$this->imgUrlFile = '';
$this->width = '';
$this->height = '';
if (!is_array($this->image) && $this->image){
$this->imgUrlFile = self::imgUrl . $this->image;
$imgInfo = getimagesize(self::imgDir . $this->image);
if (isset($imgInfo['0'])){
$this->width = $imgInfo['0'];
}
if (isset($imgInfo['1'])){
$this->height = $imgInfo['1'];
}
}
if ($this->template == ''){
$this->template = 'default';
}
if (Tools::file_exists_no_cache(self::tplsThemeDir . $this->template . '.tpl')){
$this->tplFilePath = self::tplsThemeDir . $this->template . '.tpl';
} else if (Tools::file_exists_no_cache(self::tplsDir . $this->template . '.tpl')){
$this->tplFilePath = self::tplPath . $this->template . '.tpl';
}
}
public function add($auto_date = true, $null_values = false)
{
if (empty($this->special_id_banner)) {
$this->special_id_banner = uniqid();
}
return parent::add($auto_date, $null_values);
}
public static function getBanners($hookName = '', $forExport = false, $all = false)
{
$context = Context::getContext();
$sql = '
SELECT * FROM `' . _DB_PREFIX_ . 'an_banners` sw
LEFT JOIN `' . _DB_PREFIX_ . 'an_banners_lang` sl
ON (sw.`id_banner` = sl.`id_banner`
AND sl.`id_lang` = ' . (int) $context->language->id . ')
';
if (!$all){
$sql .= 'WHERE sw.`active`=1 ';
}
if ($hookName != 'all') {
$sql .= 'AND sw.`hook` = "'.pSQL($hookName).'"';
}
if (Shop::isFeatureActive()) {
$sql .= ' AND sw.`id_banner` IN (
SELECT sa.`id_banner`
FROM `' . _DB_PREFIX_ . 'an_banners_shop` sa
WHERE sa.id_shop IN (' . implode(', ', Shop::getContextListShopID()) . ')
)';
}
$sql .= ' ORDER BY sw.`position`';
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
if ($forExport){
return $result;
}
$banners = [];
foreach ($result as $id => $banner){
$obj = new anBanners($banner['id_banner'], $context->language->id);
$banners[$banner['id_banner']] = (array) $obj;
}
return $banners;
}
public static function getListTpl()
{
$list = [];
$tplsTheme = glob(self::tplsThemeDir . '*.tpl');
foreach ($tplsTheme as $tpl){
$list[] = str_replace('.tpl', '', basename($tpl));
}
$tplsMod = glob(self::tplsDir . '*.tpl');
foreach ($tplsMod as $tpl){
$list[] = str_replace('.tpl', '', basename($tpl));
}
$list = array_unique($list);
$return = [];
foreach ($list as $item){
$return[]['file'] = $item;
}
return $return;
}
public function delete()
{
foreach ($this->image as $imgName){
@unlink(self::imgDir . $imgName);
}
return parent::delete();
}
public static function exportJsonBanners()
{
$banners = self::getBanners('all', true, true);
foreach ($banners as $key => $hc){
$banners[$key]['link'] = '#';
}
@file_put_contents(self::fileJsonBanners, json_encode($banners));
}
public static function importJsonBanners()
{
$data = json_decode(Tools::file_get_contents(self::fileJsonBanners), true);
$context = Context::getContext();
$languages = Language::getLanguages();
$hooks = [];
if ($data){
foreach ($data as $item){
$bannerObj = new anBanners();
$bannerObj->col = $item['col'];
$bannerObj->active = $item['active'];
$bannerObj->position = $item['position'];
$bannerObj->hook = $item['hook'];
$bannerObj->special_id_banner = $item['special_id_banner'];
$bannerObj->template = $item['template'];
$bannerObj->image = [];
foreach ($languages as $language) {
$bannerObj->title[$language['id_lang']] = $item['title'];
$bannerObj->text[$language['id_lang']] = $item['text'];
$bannerObj->link[$language['id_lang']] = $item['link'];
if (!isset($bannerObj->image[$language['id_lang']]) &&
isset($item['imagesLang'][$language['id_lang']]) &&
$item['imagesLang'][$language['id_lang']] != $item['image']){
$bannerObj->image[$language['id_lang']] = $item['imagesLang'][$language['id_lang']];
} else {
$nameImage = $item['image'];
if (!Tools::file_exists_no_cache(self::imgDir . $nameImage)){
$nameImage = '';
}
if ($nameImage!='' && (in_array($item['image'], $bannerObj->image) || Shop::isFeatureActive()) ){
$nameImage = $language['id_lang'] . '_' . $item['image'];
$nameImage = self::generateName($nameImage, $language['id_lang']);
Tools::copy(self::imgDir . $item['image'], self::imgDir . $nameImage);
}
$bannerObj->image[$language['id_lang']] = $nameImage;
}
}
$bannerObj->save();
$hooks[] = $item['hook'];
}
}
return $hooks;
}
public static function generateName($name, $id_lang)
{
$ext = substr($name, strrpos($name, '.') + 1);
$nameImage = $id_lang . '_' . md5(uniqid()) .'.'.$ext;
return 'new_'.$nameImage;
}
}

View File

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>an_banners</name>
<displayName><![CDATA[Banners, Simple text and others for theme]]></displayName>
<version><![CDATA[1.0.8]]></version>
<description><![CDATA[Banners, Simple Text and others for themes y Anvanto]]></description>
<author><![CDATA[Anvanto]]></author>
<tab><![CDATA[others]]></tab>
<confirmUninstall><![CDATA[Are you sure you want to uninstall the module?]]></confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
</module>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>an_banners</name>
<displayName><![CDATA[Banners, Simple text and others for theme]]></displayName>
<version><![CDATA[1.0.8]]></version>
<description><![CDATA[Banners, Simple Text and others for themes y Anvanto]]></description>
<author><![CDATA[Anvanto]]></author>
<tab><![CDATA[others]]></tab>
<confirmUninstall><![CDATA[Are you sure you want to uninstall the module?]]></confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,459 @@
<?php
/**
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
require_once _PS_MODULE_DIR_ . 'an_banners/classes/anBanners.php';
class AdminAnBannersController extends ModuleAdminController
{
protected $_module = null;
protected $position_identifier = 'position';
protected $_defaultOrderBy = 'position';
protected $_defaultOrderWay = 'ASC';
public function __construct()
{
$this->bootstrap = true;
$this->context = Context::getContext();
$this->table = 'an_banners';
$this->identifier = 'id_banner';
$this->className = 'anBanners';
$this->lang = true;
$this->addRowAction('edit');
$this->addRowAction('delete');
$this->name = 'AdminAnBannersController';
parent::__construct();
$this->fields_list = [
'id_banner' => [
'title' => $this->l('ID'),
'width' => 25,
'search' => false,
],
'image' => [
'title' => $this->l('Image'),
'search' => false,
'type' => 'image',
],
'title' => [
'title' => $this->l('Title'),
'search' => false,
],
'col' => [
'title' => $this->l('Col'),
'search' => false,
],
'hook' => [
'title' => $this->l('Hook'),
'search' => false,
],
'position' => [
'title' => $this->l('Position'),
'search' => false,
'type' => 'position',
],
'active' => [
'title' => $this->l('Status'),
'width' => 40,
'active' => 'update',
'align' => 'center',
'type' => 'bool',
'search' => false,
'orderby' => false
]
];
if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL) {
$this->_where .= ' AND a.' . $this->identifier . ' IN (
SELECT sa.' . $this->identifier . '
FROM `' . _DB_PREFIX_ . $this->table . '_shop` sa
WHERE sa.id_shop IN (' . implode(', ', Shop::getContextListShopID()) . ')
)';
}
}
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
{
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
foreach ($this->_list as &$list) {
if ($list['image'] !='' && Tools::file_exists_no_cache(anBanners::imgDir.$list['image'])) {
$list['image'] = anBanners::imgUrl.$list['image'];
}
$this->context->smarty->assign([
'image' => $list['image'],
]);
$list['image'] = $this->module->display(_PS_MODULE_DIR_.'an_banners', 'views/templates/admin/list-img.tpl');
}
}
public function setMedia($isNewTheme = false)
{
parent::setMedia($isNewTheme);
$this->addJquery();
$this->js_files[] = _MODULE_DIR_ . 'an_banners/views/js/Sortable.min.js';
$this->js_files[] = _MODULE_DIR_ . 'an_banners/views/js/sorting.js';
}
public function renderList()
{
return parent::renderList() . $this->module->topPromo();
}
public function initToolBarTitle()
{
$this->toolbar_title[] = $this->l('Banners');
}
public function initHeader()
{
parent::initHeader();
}
public function renderForm()
{
$this->initToolbar();
if (!$this->loadObject(true)) {
return;
}
$this->fields_form = array(
'tinymce' => false,
'legend' => ['title' => $this->l('Banners')],
'input' => [],
'buttons' => [
[
'type' => 'submit',
'title' => $this->l('Save'),
'icon' => 'process-icon-save',
'class' => 'pull-right',
'name' => 'submit'.$this->table
],
[
'type' => 'submit',
'title' => $this->l('Save and stay'),
'icon' => 'process-icon-save',
'class' => 'pull-right',
'name' => 'submit'.$this->table.'AndStay'
],
],
);
$this->fields_form['input'][] = [
'type' => 'switch',
'name' => 'active',
'label' => $this->l('Active'),
'values' => [
[
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
],
[
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
]
],
];
$bannerTpls = anBanners::getListTpl();
if (count($bannerTpls) > 1){
$this->fields_form['input'][] = [
'type' => 'select',
'label' => $this->module->l('Template'),
'name' => 'template',
'options' => [
'query' => array_merge(
anBanners::getListTpl()
),
'id' => 'file',
'name' => 'file',
],
];
}
$this->fields_form['input'][] = [
'col' => 6,
'type' => 'select',
'name' => 'hook',
'label' => $this->module->l('Select hook'),
'options' => [
'query' => $this->module->getHooksQuery(),
'id' => 'name',
'name' => 'name'
],
];
$listCols = [];
for ($i=3; $i <= 12; $i++){
$listCols[] = ['id' => $i, 'name' => $i];
}
$this->fields_form['input'][] = [
'type' => 'select',
'label' => $this->module->l('Col'),
'name' => 'col',
'options' => [
'query' => array_merge(
[ ['id' => 'div', 'name' => 'div'],
['id' => '2', 'name' => '2'],
],
$listCols
),
'id' => 'id',
'name' => 'name',
],
];
$this->fields_form['input'][] = [
'type' => 'file_lang',
'label' => $this->l('Image'),
'lang' => true,
'name' => 'image',
'display_image' => true,
'delete_url' => '',
];
$this->fields_form['input'][] = [
'type' => 'text',
'name' => 'link',
'label' => $this->l('Link'),
'lang' => true,
];
$this->fields_form['input'][] = [
'type' => 'text',
'name' => 'title',
'label' => $this->l('Title'),
'lang' => true,
];
$this->fields_form['input'][] = [
'type' => 'textarea',
'class' => 'autoload_rte',
'name' => 'text',
'label' => $this->l('Text'),
'lang' => true,
];
if (Shop::isFeatureActive()) {
$this->fields_form['input'][] = [
'required' => true,
'type' => 'shop',
'label' => $this->l('Shop association'),
'name' => 'checkBoxShopAsso',
];
}
return parent::renderForm();
}
public function processSave()
{
$languages = Language::getLanguages(false);
$isUpdateImage = false;
foreach ($languages as $lang) {
if (isset($_FILES['image_'.$lang['id_lang']]) && isset($_FILES['image_'.$lang['id_lang']]['tmp_name'])
&& !empty($_FILES['image_'.$lang['id_lang']]['tmp_name'])) {
if ($error = $this->validateUpload($_FILES['image_'.$lang['id_lang']])) {
$this->errors[] = $error;
}
}
}
if (!empty($this->errors)) {
$this->display = 'edit';
return false;
}
$object = parent::processSave();
if (isset($object->id) && $object->id) {
$this->module->registerHook($object->hook);
$deleteImage = Tools::getValue('delete_image');
if ($deleteImage && is_array($deleteImage)){
foreach ($deleteImage as $id){
@unlink(anBanners::imgDir . $object->image[$id]);
$object->image[$id] = '';
}
$isUpdateImage = true;
}
foreach ($languages as $lang) {
if (isset($_FILES['image_'.$lang['id_lang']]) && isset($_FILES['image_'.$lang['id_lang']]['tmp_name'])
&& !empty($_FILES['image_'.$lang['id_lang']]['tmp_name'])) {
$ext = substr($_FILES['image_'.$lang['id_lang']]['name'], strrpos($_FILES['image_'.$lang['id_lang']]['name'], '.') + 1);
$fileName = md5(uniqid()) . '_' . $lang['id_lang'] . '.' . $ext;
if (!move_uploaded_file($_FILES['image_'.$lang['id_lang']]['tmp_name'], anBanners::imgDir . $fileName)) {
}
if (isset($object->image[$lang['id_lang']]) && $object->image[$lang['id_lang']] !=''){
@unlink(anBanners::imgDir . $object->image[$lang['id_lang']]);
}
$object->image[$lang['id_lang']] = $fileName;
$isUpdateImage = true;
}
}
if ($isUpdateImage){
$object->save();
}
}
anBanners::exportJsonBanners();
if (Tools::getIsset('submit'.$this->table.'AndStay')) {
$this->redirect_after = $this->context->link->getAdminLink($this->controller_name).'&conf=4&updatean_homeproducts_banners&token='.$this->token.'&id_banner='.$object->id;
}
return $object;
}
public function validateUpload($file)
{
$maxFileSize = 4000000;
$types = ['gif', 'jpg', 'jpeg', 'jpe', 'png', 'svg', 'webp'];
if ((int) $maxFileSize > 0 && $file['size'] > (int) $maxFileSize) {
return Context::getContext()->getTranslator()->trans('Image is too large (%1$d kB). Maximum allowed: %2$d kB', [$file['size'] / 1024, $maxFileSize / 1024], 'Admin.Notifications.Error');
}
if (!ImageManager::isCorrectImageFileExt($file['name'], $types) || preg_match('/\%00/', $file['name'])) {
return Context::getContext()->getTranslator()->trans('Image format not recognized, allowed formats are: .gif, .jpg, .png, .svg', [], 'Admin.Notifications.Error');
}
if ($file['error']) {
return Context::getContext()->getTranslator()->trans('Error while uploading image; please change your server\'s settings. (Error code: %s)', [$file['error']], 'Admin.Notifications.Error');
}
return false;
}
public function processDelete()
{
$object = parent::processDelete();
anBanners::exportJsonBanners();
return $object;
}
public function ajaxProcessUpdatePositions()
{
$status = false;
$position = 1;
$positions = array_map('intval', (array)Tools::getValue('positions'));
foreach ($positions as $pos){
$sql = 'UPDATE `' . _DB_PREFIX_ . 'an_banners` SET position="'.(int)$position.'" WHERE `id_banner`="'.(int)$pos.'" ';
Db::getInstance(_PS_USE_SQL_SLAVE_)->execute($sql);
$position++;
}
$status = true;
return $this->setJsonResponse(array(
'success' => $status,
'message' => $this->l($status ? 'Blocks reordered successfully' : 'An error occurred')
));
}
protected function setJsonResponse($response)
{
header('Content-Type: application/json; charset=utf8');
print(json_encode($response));
exit;
}
protected function updateAssoShop($id_object)
{
if (!Shop::isFeatureActive()) {
return;
}
$assos_data = $this->getSelectedAssoShop($this->table, $id_object);
$exclude_ids = $assos_data;
foreach (Db::getInstance()->executeS('SELECT id_shop FROM ' . _DB_PREFIX_ . 'shop') as $row) {
if (!$this->context->employee->hasAuthOnShop($row['id_shop'])) {
$exclude_ids[] = $row['id_shop'];
}
}
Db::getInstance()->delete($this->table . '_shop', '`' . $this->identifier . '` = ' . (int) $id_object . ($exclude_ids ? ' AND id_shop NOT IN (' . implode(', ', $exclude_ids) . ')' : ''));
$insert = array();
foreach ($assos_data as $id_shop) {
$insert[] = array(
$this->identifier => $id_object,
'id_shop' => (int) $id_shop,
);
}
return Db::getInstance()->insert($this->table . '_shop', $insert, false, true, Db::INSERT_IGNORE);
}
protected function getSelectedAssoShop($table)
{
if (!Shop::isFeatureActive()) {
return array();
}
$shops = Shop::getShops(true, null, true);
if (count($shops) == 1 && isset($shops[0])) {
return array($shops[0], 'shop');
}
$assos = array();
if (Tools::isSubmit('checkBoxShopAsso_' . $table)) {
foreach (Tools::getValue('checkBoxShopAsso_' . $table) as $id_shop => $value) {
$assos[] = (int) $id_shop;
}
} else if (Shop::getTotalShops(false) == 1) {
// if we do not have the checkBox multishop, we can have an admin with only one shop and being in multishop
$assos[] = (int) Shop::getContextShopID();
}
return $assos;
}
}

View File

View File

@@ -0,0 +1,70 @@
<?php
/**
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
return array(
'displayAdditionalCustomerAddressFields',
'displayAfterBodyOpeningTag',
'displayAfterCarrier',
'displayAfterProductThumbs',
'displayAttributeForm',
'displayAttributeGroupForm',
'displayAttributeGroupPostProcess',
'displayAttributeForm',
'displayAttributeGroupForm',
'displayAttributeGroupPostProcess',
'displayAuthenticateFormBottom',
'displayBeforeBodyClosingTag',
'displayBeforeCarrier',
'displayCarrierExtraContent',
'displayCarrierList',
'displayCartExtraProductActions',
'displayCreateAccountEmailFormBottom',
'displayCrossSellingShoppingCart',
'displayCustomerAccount',
'displayCustomerAccountForm',
'displayCustomerAccountFormTop',
'displayCustomerLoginFormAfter',
'displayDashboardToolbarIcons',
'displayDashboardToolbarTopMenu',
'displayDashboardTop',
'displayFeatureForm',
'displayFeaturePostProcess',
'displayFeatureValueForm',
'displayFeatureValuePostProcess',
'displayGDPRConsent',
'displayInvoice',
'displayInvoiceLegalFreeText',
'displayLogo',
'displayMobileMenu',
'displayNav',
'displayNav1',
'displayNav2',
'displayNavFullWidth',
'displayOrderConfirmation',
'displayOrderConfirmation2',
'displayOrderDetail',
'displayOverrideTemplate',
'displayPaymentByBinaries',
'displayPaymentReturn',
'displayPaymentTop',
'displayPDFInvoice',
'displayProductActions',
'displayProductAdditionalInfo',
'displayProductListFunctionalButtons',
'displayProductPageDrawer',
'displayReassurance',
'displaySearch',
'displayTop',
'displayTop2',
'displayTopColumn',
);

Binary file not shown.

After

Width:  |  Height:  |  Size: 876 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 999 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 935 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

View File

BIN
modules/an_banners/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

View File

@@ -0,0 +1,47 @@
<?php
/**
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
$sql = [];
$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'an_banners` (
`id_banner` int(10) unsigned NOT NULL AUTO_INCREMENT,
`special_id_banner` varchar(50) NOT NULL,
`hook` varchar(255) NOT NULL,
`col` varchar(255) NOT NULL,
`active` tinyint(1) unsigned NOT NULL DEFAULT 1,
`position` int(10) NOT NULL,
`template` varchar(255) NOT NULL,
PRIMARY KEY(`id_banner`)
) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET = utf8';
$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'an_banners_lang` (
`id_banner` int(10) unsigned NOT NULL,
`title` varchar(255) NOT NULL,
`text` text,
`link` varchar(255) NOT NULL,
`image` varchar(255) NOT NULL,
`id_lang` varchar(255) NOT NULL,
PRIMARY KEY(`id_banner`, `id_lang`)
) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET = utf8';
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'an_banners_shop` (
`id_banner` int(10) unsigned NOT NULL,
`id_shop` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_banner`, `id_shop`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;';
return $sql;

View File

@@ -0,0 +1,26 @@
<?php
/**
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
$sql = [];
$sql[] = 'DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'an_banners`';
$sql[] = 'DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'an_banners_lang`';
$sql[] = 'DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'an_banners_shop`';
return $sql;

View File

View File

@@ -0,0 +1,12 @@
/**
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

View File

View File

File diff suppressed because one or more lines are too long

View File

View File

@@ -0,0 +1,51 @@
/**
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
! function(t) {
"use strict";
var n = t.when(),
e = "undefined" != typeof baseAdminDir ? location.origin + baseAdminDir + currentIndex + "&token=" + token : location.href,
o = e + "&ajax";
t(document).ready(function() {
var e = t("#table-banner tbody")[0];
return "undefined" != typeof e && void new Sortable(e, {
group: "name",
sort: !0,
handle: '.handle',
delay: 0,
disabled: !1,
draggable: "tr",
store: null,
animation: 150,
setData: function(t, n) {
t.setData("Text", n.textContent)
},
onStart: function(t) {},
onEnd: function(t) {},
onSort: function(e) {
n = n.then(function() {
return t.post(o, {
action: "updatePositions",
positions: t("#table-banner tbody tr").toArray().map(function(n) {
return parseInt(t(n).children("td").eq(1).html()) || 0
})
})
}).then(function(n) {
var e = 1;
n.success ? (t("#table-banner tbody tr").each(function() {
t(t(this).children("td")[6]).find('span').html(e++)
}), showSuccessMessage(n.message)) : showErrorMessage(n.message)
})
}
})
})
}(jQuery);

View File

@@ -0,0 +1,149 @@
{*
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}
{extends file="helpers/form/form.tpl"}
{block name="input"}
{if $input.type == 'number'}
<input type="number"
id="{if isset($input.id)}{$input.id}{else}{$input.name}{/if}"
name="{$input.name}"
class="form-control {if isset($input.class)} {$input.class} {/if}"
onkeyup="return (function (el, e) {
if (e.keyCode == 8) return true;
jQuery(el).val((parseInt(jQuery(el).val()) || 0));
if (jQuery(el).val() < (parseInt(jQuery(el).attr('min')) || 0)) {
jQuery(el).val((parseInt(jQuery(el).attr('min')) || 0));
} else if (jQuery(el).val() > (parseInt(jQuery(el).attr('max')) || 0)) {
jQuery(el).val((parseInt(jQuery(el).attr('max')) || 0));
}
})(this, event);"
value="{$fields_value[$input.name]|escape:'html':'UTF-8'}"
{if isset($input.size)} size="{$input.size}"{/if}
{if isset($input.maxchar) && $input.maxchar} data-maxchar="{$input.maxchar|intval}"{/if}
{if isset($input.maxlength) && $input.maxlength} maxlength="{$input.maxlength|intval}"{/if}
{if isset($input.readonly) && $input.readonly} readonly="readonly"{/if}
{if isset($input.disabled) && $input.disabled} disabled="disabled"{/if}
{if isset($input.autocomplete) && !$input.autocomplete} autocomplete="off"{/if}
{if isset($input.required) && $input.required} required="required" {/if}
{if isset($input.max)} max="{$input.max|intval}"{/if}
{if isset($input.min)} min="{$input.min|intval}"{/if}
{if isset($input.placeholder) && $input.placeholder} placeholder="{$input.placeholder}"{/if} />
{if isset($input.suffix)}
<span class="input-group-addon">
{$input.suffix}
</span>
{/if}
{elseif $input.type == 'file_lang'}
{foreach from=$languages item=language}
{if $languages|count > 1}
<div class="translatable-field lang-{$language.id_lang}" {if $language.id_lang != $defaultFormLanguage}style="display:none"{/if}>
{/if}
<div class="form-group-image">
{if isset($fields_value[$input.name][$language.id_lang]) && $fields_value[$input.name][$language.id_lang] != ''}
<div class="form-group">
<div id="{$input.name}-{$language.id_lang}-images-thumbnails" class="col-lg-12">
<img src="../modules/an_banners/img/{$fields_value[$input.name][$language.id_lang]}"
class="img-thumbnail"
style="max-height: 150px; max-width: 150px;"
/>
</div>
</div>
<div class="form-group">
<div id="{$input.name}-{$language.id_lang}-images-delete" class="col-lg-12">
<span id="{$input.name}_{$language.id_lang}-deletebutton" type="button" name="submitDeleteAttachments"
class="btn btn-default an-image-deletebutton an-image-deletebutton-{$language.id_lang}">
<i class="icon-trash"></i> {l s='Delete' mod='an_banners'}
</span>
</div>
</div>
{/if}
</div>
<div class="form-group">
<div class="col-lg-9">
<input id="{$input.name}_{$language.id_lang}" type="file" name="{$input.name}_{$language.id_lang}" class="hide" />
<div class="dummyfile input-group">
<span class="input-group-addon"><i class="icon-file"></i></span>
<input id="{$input.name}_{$language.id_lang}-name" type="text" class="disabled" name="filename" readonly />
<span class="input-group-btn">
<button id="{$input.name}_{$language.id_lang}-selectbutton" type="button" name="submitAddAttachments" class="btn btn-default">
<i class="icon-folder-open"></i> {l s='Choose a file' mod='an_banners'}
</button>
</span>
</div>
</div>
{if $languages|count > 1}
<div class="col-lg-2">
<button type="button" class="btn btn-default dropdown-toggle" tabindex="-1" data-toggle="dropdown">
{$language.iso_code}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{foreach from=$languages item=lang}
<li><a href="javascript:hideOtherLanguage({$lang.id_lang});" tabindex="-1">{$lang.name}</a></li>
{/foreach}
</ul>
</div>
{/if}
</div>
{if $languages|count > 1}
</div>
{/if}
<script>
$(document).ready(function(){
$('.an-image-deletebutton-{$language.id_lang}').click(function(e){
if (confirm('Are you sure?') ) {
var formGroupImage = $(this).closest('.form-group-image');
$(formGroupImage).append('<input type="hidden" name="delete_{$input.name}[{$language.id_lang}]" value="{$language.id_lang}" /> ');
$(formGroupImage).find('.form-group').fadeOut(function () {
$(this).remove();
});
}
});
$('#{$input.name}_{$language.id_lang}-selectbutton').click(function(e){
$('#{$input.name}_{$language.id_lang}').trigger('click');
});
$('#{$input.name}_{$language.id_lang}').change(function(e){
var val = $(this).val();
var file = val.split(/[\\/]/);
$('#{$input.name}_{$language.id_lang}-name').val(file[file.length-1]);
});
});
</script>
{/foreach}
{if isset($input.desc) && !empty($input.desc)}
<p class="help-block">
{$input.desc}
</p>
{/if}
{elseif $input.type == 'html'}
{if isset($input.html_content)}
{if $input.html_content == 'hr'}
<hr />
{else}
{$input.html_content}
{/if}
{else}
{$input.name|escape:'htmlall':'UTF-8'}
{/if}
{else}
{$smarty.block.parent}
{/if}
{/block}

View File

@@ -0,0 +1,207 @@
{*
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}
{capture name='tr_count'}{counter name='tr_count'}{/capture}
<tbody>
{if count($list)}
{foreach $list AS $index => $tr}
<tr{if $position_identifier} id="tr_{$position_group_identifier}_{$tr.$identifier}_{if isset($tr.position['position'])}{$tr.position['position']}{else}0{/if}"{/if} class="{if isset($tr.class)}{$tr.class}{/if} {if $tr@iteration is odd by 1}odd{/if}"{if isset($tr.color) && $color_on_bg} style="background-color: {$tr.color}"{/if} >
{if $bulk_actions && $has_bulk_actions}
<td class="row-selector text-center">
{if isset($list_skip_actions.delete)}
{if !in_array($tr.$identifier, $list_skip_actions.delete)}
<input type="checkbox" name="{$list_id}Box[]" value="{$tr.$identifier}"{if isset($checked_boxes) && is_array($checked_boxes) && in_array({$tr.$identifier}, $checked_boxes)} checked="checked"{/if} class="noborder" />
{/if}
{else}
<input type="checkbox" name="{$list_id}Box[]" value="{$tr.$identifier}"{if isset($checked_boxes) && is_array($checked_boxes) && in_array({$tr.$identifier}, $checked_boxes)} checked="checked"{/if} class="noborder" />
{/if}
</td>
{/if}
{foreach $fields_display AS $key => $params}
{block name="open_td"}
<td
{if isset($params.position)}
id="td_{if !empty($position_group_identifier)}{$position_group_identifier}{else}0{/if}_{$tr.$identifier}{if $smarty.capture.tr_count > 1}_{($smarty.capture.tr_count - 1)|intval}{/if}"
{/if}
class="{strip}{if !$no_link}pointer{/if}
{if isset($key)} column-{$key|lower}{/if}
{if isset($params.position) && $order_by == 'position' && $order_way != 'DESC'} dragHandle{/if}
{if isset($params.class)} {$params.class}{/if}
{if isset($params.align)} {$params.align}{/if}{/strip}"
{if (!isset($params.position) && !$no_link && !isset($params.remove_onclick))}
{if isset($tr.link) }
onclick="document.location = '{$tr.link|addslashes|escape:'html':'UTF-8'}'">
{else}
onclick="document.location = '{$current_index|addslashes|escape:'html':'UTF-8'}&amp;{$identifier|escape:'html':'UTF-8'}={$tr.$identifier|escape:'html':'UTF-8'}{if $view}&amp;view{else}&amp;update{/if}{$table|escape:'html':'UTF-8'}{if $page > 1}&amp;page={$page|intval}{/if}&amp;token={$token|escape:'html':'UTF-8'}'">
{/if}
{else}
>
{/if}
{/block}
{block name="td_content"}
{if isset($params.prefix)}{$params.prefix}{/if}
{if isset($params.badge_success) && $params.badge_success && isset($tr.badge_success) && $tr.badge_success == $params.badge_success}<span class="badge badge-success">{/if}
{if isset($params.badge_warning) && $params.badge_warning && isset($tr.badge_warning) && $tr.badge_warning == $params.badge_warning}<span class="badge badge-warning">{/if}
{if isset($params.badge_danger) && $params.badge_danger && isset($tr.badge_danger) && $tr.badge_danger == $params.badge_danger}<span class="badge badge-danger">{/if}
{if isset($params.color) && isset($tr[$params.color])}
<span class="label color_field" style="background-color:{$tr[$params.color]};color:{if !Tools::isBright($tr[$params.color])}white{else}#383838{/if}">
{/if}
{if isset($tr.$key)}
{if isset($params.active)}
{$tr.$key}
{elseif isset($params.callback)}
{if isset($params.maxlength) && Tools::strlen($tr.$key) > $params.maxlength}
<span title="{$tr.$key}">{$tr.$key|truncate:$params.maxlength:'...'}</span>
{else}
{$tr.$key}
{/if}
{elseif isset($params.activeVisu)}
{if $tr.$key}
<i class="icon-check-ok"></i> {l s='Enabled' d='Admin.Global'}
{else}
<i class="icon-remove"></i> {l s='Disabled' d='Admin.Global'}
{/if}
{elseif isset($params.position)}
{if !$filters_has_value && $order_by == 'position' && $order_way != 'DESC'}
<div class="dragGroup">
<div class="positions">
{$tr.$key.position + 1}
</div>
</div>
{else}
{$tr.$key.position + 1}
{/if}
{elseif isset($params.image)}
{$tr.$key}
{elseif isset($params.icon)}
{if is_array($tr[$key])}
{if isset($tr[$key]['class'])}
<i class="{$tr[$key]['class']}"></i>
{else}
<img src="../img/admin/{$tr[$key]['src']}" alt="{$tr[$key]['alt']}" title="{$tr[$key]['alt']}" />
{/if}
{/if}
{elseif isset($params.type) && $params.type == 'image'}
{$tr.$key nofilter}
{elseif isset($params.type) && $params.type == 'position'}
<div style='display: table; width: auto; cursor: pointer' class='form-control handle'><i class='icon-move'></i>&nbsp;&nbsp;<span>{$tr.$key nofilter}</span></div>
{elseif isset($params.type) && $params.type == 'price'}
{if isset($tr.id_currency)}
{displayPrice price=$tr.$key currency=$tr.id_currency}
{else}
{displayPrice price=$tr.$key}
{/if}
{elseif isset($params.float)}
{$tr.$key}
{elseif isset($params.type) && $params.type == 'date'}
{dateFormat date=$tr.$key full=0}
{elseif isset($params.type) && $params.type == 'datetime'}
{dateFormat date=$tr.$key full=1}
{elseif isset($params.type) && $params.type == 'decimal'}
{$tr.$key|string_format:"%.2f"}
{elseif isset($params.type) && $params.type == 'percent'}
{$tr.$key} {l s='%'}
{elseif isset($params.type) && $params.type == 'bool'}
{if $tr.$key == 1}
{l s='Yes' d='Admin.Global'}
{elseif $tr.$key == 0 && $tr.$key != ''}
{l s='No' d='Admin.Global'}
{/if}
{* If type is 'editable', an input is created *}
{elseif isset($params.type) && $params.type == 'editable' && isset($tr.id)}
<input type="text" name="{$key}_{$tr.id}" value="{$tr.$key|escape:'html':'UTF-8'}" class="{$key}" />
{elseif $key == 'color'}
{if !is_array($tr.$key)}
<div style="background-color: {$tr.$key};" class="attributes-color-container"></div>
{else} {*TEXTURE*}
<img src="{$tr.$key.texture}" alt="{$tr.name}" class="attributes-color-container" />
{/if}
{elseif isset($params.maxlength) && Tools::strlen($tr.$key) > $params.maxlength}
<span title="{$tr.$key|escape:'html':'UTF-8'}">{$tr.$key|truncate:$params.maxlength:'...'|escape:'html':'UTF-8'}</span>
{else}
{$tr.$key|escape:'html':'UTF-8'}
{/if}
{else}
{block name="default_field"}--{/block}
{/if}
{if isset($params.suffix)}{$params.suffix}{/if}
{if isset($params.color) && isset($tr.color)}
</span>
{/if}
{if isset($params.badge_danger) && $params.badge_danger && isset($tr.badge_danger) && $tr.badge_danger == $params.badge_danger}</span>{/if}
{if isset($params.badge_warning) && $params.badge_warning && isset($tr.badge_warning) && $tr.badge_warning == $params.badge_warning}</span>{/if}
{if isset($params.badge_success) && $params.badge_success && isset($tr.badge_success) && $tr.badge_success == $params.badge_success}</span>{/if}
{/block}
{block name="close_td"}
</td>
{/block}
{/foreach}
{if $multishop_active && $shop_link_type}
<td title="{$tr.shop_name}">
{if isset($tr.shop_short_name)}
{$tr.shop_short_name}
{else}
{$tr.shop_name}
{/if}
</td>
{/if}
{if $has_actions}
<td class="text-right">
{assign var='compiled_actions' value=array()}
{foreach $actions AS $key => $action}
{if isset($tr.$action)}
{if $key == 0}
{assign var='action' value=$action}
{/if}
{if $action == 'delete' && $actions|@count > 2}
{$compiled_actions[] = 'divider'}
{/if}
{$compiled_actions[] = $tr.$action}
{/if}
{/foreach}
{if $compiled_actions|count > 0}
{if $compiled_actions|count > 1}<div class="btn-group-action">{/if}
<div class="btn-group pull-right">
{$compiled_actions[0]}
{if $compiled_actions|count > 1}
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="icon-caret-down"></i>
</button>
<ul class="dropdown-menu">
{foreach $compiled_actions AS $key => $action}
{if $key != 0}
<li{if $action == 'divider' && $compiled_actions|count > 3} class="divider"{/if}>
{if $action != 'divider'}{$action}{/if}
</li>
{/if}
{/foreach}
</ul>
{/if}
</div>
{if $compiled_actions|count > 1}</div>{/if}
{/if}
</td>
{/if}
</tr>
{/foreach}
{else}
<tr>
<td class="list-empty" colspan="{count($fields_display)+1}">
<div class="list-empty-msg">
<i class="icon-warning-sign list-empty-icon"></i>
{l s='No records found'}
</div>
</td>
</tr>
{/if}
</tbody>

View File

@@ -0,0 +1,13 @@
{*
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}
<img class="an_trust_badges-list-img" src="{$image nofilter}" alt="" class="" style="max-width: 50px; max-height: 50px;" />

View File

@@ -0,0 +1,202 @@
{*
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}
{$contact_us = '#'}
{$rate_url = '#'}
{$anvanto_url = 'https://bit.ly/2TH0AJ6'}
{if isset($theme.url_contact_us)}
{$contact_us = $theme.url_contact_us}
{/if}
{if isset($theme.url_rate)}
{$rate_url = $theme.url_rate}
{/if}
<link href="https://fonts.googleapis.com/css?family=Ubuntu:400,700&display=swap" rel="stylesheet">
<style>
.an_panel {
border-radius: 5px;
margin: 0 4px 39px;
font-family: 'Ubuntu', sans-serif;
}
.an_panel-link {
text-decoration: underline!important;
}
.an_panel_info {
font-family: 'Ubuntu', sans-serif;
display: flex;
margin-bottom: 0px;
}
.an_panel_info-item {
background: #fff;
box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.1);
border-radius: 2px;
padding: 12px 16px 12px 16px;
max-width: 330px;
width: 100%;
margin-right: 20px;
margin-bottom: 20px;
}
.an_panel_info-item:last-child {
margin-right: 0;
}
.an_panel_info-item-contact {
border-left: 3px solid #21a6cb;
}
.an_panel_info-item-rate {
border-left: 3px solid #fed500;
}
.an_panel_info-item-docs {
border-left: 3px solid #e56b93;
}
.an_panel_info-item-ad {
border-left: 3px solid #0ca300;
}
.an_panel_info-item h2 {
font-size: 16px;
font-family: 'Ubuntu', sans-serif;
font-weight: bold;
margin: 0 0 4px;
}
.an_panel_info-item p {
font-size: 14px;
line-height: 20px;
margin: 0;
}
.an_panel_info .grade {
display: flex;
flex-direction: row-reverse;
justify-content: flex-end;
margin-top: 13px;
}
.an_panel_info-stars {
transition: all .2s;
padding-right: 3px;
}
.an_panel_info-stars path {
fill: #e0e0e0;
}
.an_panel_info-stars:nth-of-type(1):hover path,
.an_panel_info-stars:nth-of-type(2):hover path,
.an_panel_info-stars:nth-of-type(3):hover path,
.an_panel_info-stars:nth-of-type(4):hover path,
.an_panel_info-stars:nth-of-type(5):hover path,
.an_panel_info-stars:nth-of-type(1):hover ~ .an_panel_info-stars:nth-of-type(n+1) path,
.an_panel_info-stars:nth-of-type(2):hover ~ .an_panel_info-stars:nth-of-type(n+2) path,
.an_panel_info-stars:nth-of-type(3):hover ~ .an_panel_info-stars:nth-of-type(n+3) path,
.an_panel_info-stars:nth-of-type(4):hover ~ .an_panel_info-stars:nth-of-type(n+4) path,
.an_panel_info-stars:nth-of-type(5):hover ~ .an_panel_info-stars:nth-of-type(n+5) path {
fill: #fed500;
}
@media (max-width: 1366px) {
.an_panel_info-item {
max-width: 50%;
}
}
@media (max-width: 767px) {
.an_panel_info-item {
max-width: 100%;
margin-right: 0;
}
.an_panel_info {
flex-direction: column;
}
}
@media (max-width: 480px) {
.an_panel_info-item {
margin-right: 0;
}
.an_panel_modules-item {
flex-direction: column;
padding: 20px 0;
position: relative;
}
.an_panel_modules-item-title {
position: static;
}
.an_panel_modules-disabled-flag {
top: 20px;
}
}
</style>
<div class="an_panel_info">
<div class="an_panel_info-item an_panel_info-item-contact">
<h2>Contact Us</h2>
<p><a class="an_panel-link" href="{$contact_us}" target="_blank">Contact us</a> on any question or problem with the module</p>
</div>
{if $rate_url <> ''}
<div class="an_panel_info-item an_panel_info-item-rate">
<h2>Rate{if isset($theme.name) AND $theme.name != ''} "{$theme.name}"{/if}</h2>
<div class="grade">
<a href="{$rate_url}" target="_blank" id="star5" class="an_panel_info-stars">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="21px" height="20px">
<path fill-rule="evenodd" fill="rgb(254, 213, 0)"
d="M20.495,9.068 C20.889,8.667 21.028,8.079 20.858,7.532 C20.688,6.985 20.245,6.595 19.701,6.512 L14.860,5.778 C14.654,5.746 14.476,5.611 14.384,5.416 L12.220,0.833 C11.977,0.318 11.484,-0.002 10.934,-0.002 C10.386,-0.002 9.892,0.318 9.649,0.833 L7.485,5.416 C7.393,5.612 7.214,5.746 7.008,5.778 L2.168,6.513 C1.624,6.595 1.181,6.986 1.011,7.532 C0.841,8.079 0.980,8.667 1.373,9.068 L4.875,12.635 C5.025,12.787 5.093,13.006 5.058,13.220 L4.232,18.257 C4.158,18.700 4.270,19.131 4.544,19.472 C4.971,20.002 5.716,20.163 6.312,19.836 L10.640,17.458 C10.821,17.359 11.049,17.359 11.229,17.458 L15.558,19.836 C15.769,19.952 15.993,20.010 16.225,20.010 C16.648,20.010 17.049,19.814 17.325,19.472 C17.600,19.131 17.711,18.699 17.638,18.257 L16.811,13.220 C16.776,13.006 16.844,12.787 16.993,12.635 L20.495,9.068 Z"/>
</svg>
</a>
<a href="{$contact_us}" target="_blank" id="star4" class="an_panel_info-stars">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="21px" height="20px">
<path fill-rule="evenodd" fill="rgb(254, 213, 0)"
d="M20.495,9.068 C20.889,8.667 21.028,8.079 20.858,7.532 C20.688,6.985 20.245,6.595 19.701,6.512 L14.860,5.778 C14.654,5.746 14.476,5.611 14.384,5.416 L12.220,0.833 C11.977,0.318 11.484,-0.002 10.934,-0.002 C10.386,-0.002 9.892,0.318 9.649,0.833 L7.485,5.416 C7.393,5.612 7.214,5.746 7.008,5.778 L2.168,6.513 C1.624,6.595 1.181,6.986 1.011,7.532 C0.841,8.079 0.980,8.667 1.373,9.068 L4.875,12.635 C5.025,12.787 5.093,13.006 5.058,13.220 L4.232,18.257 C4.158,18.700 4.270,19.131 4.544,19.472 C4.971,20.002 5.716,20.163 6.312,19.836 L10.640,17.458 C10.821,17.359 11.049,17.359 11.229,17.458 L15.558,19.836 C15.769,19.952 15.993,20.010 16.225,20.010 C16.648,20.010 17.049,19.814 17.325,19.472 C17.600,19.131 17.711,18.699 17.638,18.257 L16.811,13.220 C16.776,13.006 16.844,12.787 16.993,12.635 L20.495,9.068 Z"/>
</svg>
</a>
<a href="{$contact_us}" target="_blank" class="an_panel_info-stars">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="21px" height="20px">
<path fill-rule="evenodd" fill="rgb(254, 213, 0)"
d="M20.495,9.068 C20.889,8.667 21.028,8.079 20.858,7.532 C20.688,6.985 20.245,6.595 19.701,6.512 L14.860,5.778 C14.654,5.746 14.476,5.611 14.384,5.416 L12.220,0.833 C11.977,0.318 11.484,-0.002 10.934,-0.002 C10.386,-0.002 9.892,0.318 9.649,0.833 L7.485,5.416 C7.393,5.612 7.214,5.746 7.008,5.778 L2.168,6.513 C1.624,6.595 1.181,6.986 1.011,7.532 C0.841,8.079 0.980,8.667 1.373,9.068 L4.875,12.635 C5.025,12.787 5.093,13.006 5.058,13.220 L4.232,18.257 C4.158,18.700 4.270,19.131 4.544,19.472 C4.971,20.002 5.716,20.163 6.312,19.836 L10.640,17.458 C10.821,17.359 11.049,17.359 11.229,17.458 L15.558,19.836 C15.769,19.952 15.993,20.010 16.225,20.010 C16.648,20.010 17.049,19.814 17.325,19.472 C17.600,19.131 17.711,18.699 17.638,18.257 L16.811,13.220 C16.776,13.006 16.844,12.787 16.993,12.635 L20.495,9.068 Z"/>
</svg>
</a>
<a href="{$contact_us}" target="_blank" class="an_panel_info-stars">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="21px" height="20px">
<path fill-rule="evenodd" fill="rgb(254, 213, 0)"
d="M20.495,9.068 C20.889,8.667 21.028,8.079 20.858,7.532 C20.688,6.985 20.245,6.595 19.701,6.512 L14.860,5.778 C14.654,5.746 14.476,5.611 14.384,5.416 L12.220,0.833 C11.977,0.318 11.484,-0.002 10.934,-0.002 C10.386,-0.002 9.892,0.318 9.649,0.833 L7.485,5.416 C7.393,5.612 7.214,5.746 7.008,5.778 L2.168,6.513 C1.624,6.595 1.181,6.986 1.011,7.532 C0.841,8.079 0.980,8.667 1.373,9.068 L4.875,12.635 C5.025,12.787 5.093,13.006 5.058,13.220 L4.232,18.257 C4.158,18.700 4.270,19.131 4.544,19.472 C4.971,20.002 5.716,20.163 6.312,19.836 L10.640,17.458 C10.821,17.359 11.049,17.359 11.229,17.458 L15.558,19.836 C15.769,19.952 15.993,20.010 16.225,20.010 C16.648,20.010 17.049,19.814 17.325,19.472 C17.600,19.131 17.711,18.699 17.638,18.257 L16.811,13.220 C16.776,13.006 16.844,12.787 16.993,12.635 L20.495,9.068 Z"/>
</svg>
</a>
<a href="{$contact_us}" target="_blank" class="an_panel_info-stars">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="21px" height="20px">
<path fill-rule="evenodd" fill="rgb(254, 213, 0)"
d="M20.495,9.068 C20.889,8.667 21.028,8.079 20.858,7.532 C20.688,6.985 20.245,6.595 19.701,6.512 L14.860,5.778 C14.654,5.746 14.476,5.611 14.384,5.416 L12.220,0.833 C11.977,0.318 11.484,-0.002 10.934,-0.002 C10.386,-0.002 9.892,0.318 9.649,0.833 L7.485,5.416 C7.393,5.612 7.214,5.746 7.008,5.778 L2.168,6.513 C1.624,6.595 1.181,6.986 1.011,7.532 C0.841,8.079 0.980,8.667 1.373,9.068 L4.875,12.635 C5.025,12.787 5.093,13.006 5.058,13.220 L4.232,18.257 C4.158,18.700 4.270,19.131 4.544,19.472 C4.971,20.002 5.716,20.163 6.312,19.836 L10.640,17.458 C10.821,17.359 11.049,17.359 11.229,17.458 L15.558,19.836 C15.769,19.952 15.993,20.010 16.225,20.010 C16.648,20.010 17.049,19.814 17.325,19.472 C17.600,19.131 17.711,18.699 17.638,18.257 L16.811,13.220 C16.776,13.006 16.844,12.787 16.993,12.635 L20.495,9.068 Z"/>
</svg>
</a>
</div>
</div>
{/if}
<div class="an_panel_info-item an_panel_info-item-docs">
<h2><a class="an_panel-link" href="{$anvanto_url}" target="_blank">What's next?</a></h2>
<p>Find out how to improve your shop with <a href="{$anvanto_url}" class="suggestions-link" target="_blank">other modules and themes</a> made by Anvanto.</p>
</div>
{*
<div class="an_panel_info-item an_panel_info-item-ad">
<h2><a class="an_panel-link" href="{$theme.url_doc}" target="_blank">New 4th block</a></h2>
<p>New next for this block</p>
</div>
*}
</div>

View File

@@ -0,0 +1,13 @@
{*
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}
{include file='./suggestions.tpl'}

View File

@@ -0,0 +1,20 @@
{*
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}
{if count($banners) > 0}
<div class="row{if isset($class)} {$class|escape:'htmlall':'UTF-8'}{/if}">
{foreach from=$banners item=banner}
{include file=$banner.tplFilePath}
{/foreach}
</div>
{/if}

View File

@@ -0,0 +1,24 @@
{*
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}
<div{if $banner.col != 'div'} class="an_homeproducts-banner {if $banner.imgUrlFile != ''}an_homeproducts-banner-overlay{else}an_homeproducts-banner-noimg{/if} col-sm-{$banner.col|intval}"{/if}>
{if $banner.imgUrlFile !=''}
<img src="{$banner.imgUrlFile}"/>
{/if}
<div class="an_homeproducts-banner-content">
<p class="an_homeproducts-banner-title h1 {if $banner.text != ''}an_homeproducts-banner-title-margin{/if}">{$banner.title|escape:'htmlall':'UTF-8'}</p>
{$banner.text nofilter}
</div>
{if $banner.link !=''}
<a href="{$banner.link|escape:'htmlall':'UTF-8'}" class="an_homeproducts-banner-link"></a>
{/if}
</div>

View File

@@ -0,0 +1,27 @@
{*
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}
<div{if $banner.col != 'div'} class="col-sm-{$banner.col|intval}"{/if}>
{if $banner.link !=''}
<a href="{$banner.link|escape:'htmlall':'UTF-8'}" class="an_homeproducts-banner-link">
{/if}
{if $banner.imgUrlFile !=''}
<img src="{$banner.imgUrlFile}"/>
{/if}
<div>
<p class="h2">{$banner.title|escape:'htmlall':'UTF-8'}</p>
{$banner.text nofilter}
</div>
{if $banner.link !=''}
</a>
{/if}
</div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -292,6 +292,7 @@ body.compact-cart #tc-container .product-line-actions {
} }
@media (max-width: 767px) { @media (max-width: 767px) {
.product-line-qty, .product-line-qty,
.product-line-price, .product-line-price,
.product-line-delete { .product-line-delete {
@@ -439,3 +440,13 @@ body#product {
font-size: 16px; font-size: 16px;
text-decoration: underline; text-decoration: underline;
} }
#banner-img-12 {
text-align: center;
img {
width: 100%;
height: auto;
max-width: 750px;
}
}

View File

@@ -17,7 +17,7 @@
{/if} {/if}
<div class="an_banner-border"></div> <div class="an_banner-border"></div>
{if $banner.imgUrlFile !=''} {if $banner.imgUrlFile !=''}
<div class="an_banner-img"> <div class="an_banner-img" id="banner-img-{$banner.id_banner|intval}">
<img class="{if Module::getInstanceByName('an_theme')->getParam('product_lazyLoad')}b-lazy{/if}" <img class="{if Module::getInstanceByName('an_theme')->getParam('product_lazyLoad')}b-lazy{/if}"
{if Module::getInstanceByName('an_theme')->getParam('product_lazyLoad')} {if Module::getInstanceByName('an_theme')->getParam('product_lazyLoad')}
src="{$banner.imgUrlFile}" src="{$banner.imgUrlFile}"

View File

@@ -57,7 +57,8 @@
{block name='stylesheets'} {block name='stylesheets'}
{include file="_partials/stylesheets.tpl" stylesheets=$stylesheets} {include file="_partials/stylesheets.tpl" stylesheets=$stylesheets}
{/block} {/block}
<link rel="stylesheet" href="/themes/charme/assets/css/custom.css?ver=1.10030"> {assign var=custom_css_file value=$smarty.const._PS_THEME_DIR_|cat:'assets/css/custom.css'}
<link rel="stylesheet" href="/themes/charme/assets/css/custom.css?ver={$custom_css_file|filemtime}">
{block name='javascript_head'} {block name='javascript_head'}
{include file="_partials/javascript.tpl" javascript=$javascript.head vars=$js_custom_vars} {include file="_partials/javascript.tpl" javascript=$javascript.head vars=$js_custom_vars}