diff --git a/.vscode/ftp-kr.sync.cache.json b/.vscode/ftp-kr.sync.cache.json index efd519dc..4c9eb5c9 100644 --- a/.vscode/ftp-kr.sync.cache.json +++ b/.vscode/ftp-kr.sync.cache.json @@ -3,6 +3,12 @@ "migracja": { "public_html": { "wyczarujprezent.pl": { + ".env": { + "type": "-", + "size": 107, + "lmtime": 1775661148644, + "modified": false + }, ".gitignore": { "type": "-", "size": 9, @@ -484,6 +490,22 @@ "lmtime": 0, "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": { "type": "-", "size": 271, @@ -622,7 +644,15 @@ "lmtime": 0, "modified": false }, - "zamowienie": {} + "zamowienie": {}, + "backups": { + "orphan_images_backup_20260408_183822.tar.gz": { + "type": "-", + "size": 0, + "lmtime": 1775666548551, + "modified": false + } + } } } } diff --git a/modules/an_banners/an_banners.php b/modules/an_banners/an_banners.php new file mode 100644 index 00000000..501f38a0 --- /dev/null +++ b/modules/an_banners/an_banners.php @@ -0,0 +1,278 @@ + +* @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; + } +} diff --git a/modules/an_banners/banners.json b/modules/an_banners/banners.json new file mode 100644 index 00000000..3d3e2e21 --- /dev/null +++ b/modules/an_banners/banners.json @@ -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"}] \ No newline at end of file diff --git a/modules/an_banners/classes/anBanners.php b/modules/an_banners/classes/anBanners.php new file mode 100644 index 00000000..bbefee71 --- /dev/null +++ b/modules/an_banners/classes/anBanners.php @@ -0,0 +1,265 @@ + +* @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; + } +} \ No newline at end of file diff --git a/modules/an_banners/classes/index.php b/modules/an_banners/classes/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/config.xml b/modules/an_banners/config.xml new file mode 100644 index 00000000..62180939 --- /dev/null +++ b/modules/an_banners/config.xml @@ -0,0 +1,12 @@ + + + an_banners + + + + + + + 1 + 0 + \ No newline at end of file diff --git a/modules/an_banners/config_pl.xml b/modules/an_banners/config_pl.xml new file mode 100644 index 00000000..8e876fc7 --- /dev/null +++ b/modules/an_banners/config_pl.xml @@ -0,0 +1,13 @@ + + + an_banners + + + + + + + 1 + 0 + + \ No newline at end of file diff --git a/modules/an_banners/controllers/admin/AdminAnBanners.php b/modules/an_banners/controllers/admin/AdminAnBanners.php new file mode 100644 index 00000000..aaef8cec --- /dev/null +++ b/modules/an_banners/controllers/admin/AdminAnBanners.php @@ -0,0 +1,459 @@ + +* @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; + } + +} diff --git a/modules/an_banners/controllers/admin/index.php b/modules/an_banners/controllers/admin/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/controllers/index.php b/modules/an_banners/controllers/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/hooks_ignore.php b/modules/an_banners/hooks_ignore.php new file mode 100644 index 00000000..94312428 --- /dev/null +++ b/modules/an_banners/hooks_ignore.php @@ -0,0 +1,70 @@ + +* @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', +); diff --git a/modules/an_banners/img/0c543039a5c020ec0a10e816166d402e_1.png b/modules/an_banners/img/0c543039a5c020ec0a10e816166d402e_1.png new file mode 100644 index 00000000..b2441bbc Binary files /dev/null and b/modules/an_banners/img/0c543039a5c020ec0a10e816166d402e_1.png differ diff --git a/modules/an_banners/img/0c543039a5c020ec0a10e816166d402e_1.webp b/modules/an_banners/img/0c543039a5c020ec0a10e816166d402e_1.webp new file mode 100644 index 00000000..a5411217 Binary files /dev/null and b/modules/an_banners/img/0c543039a5c020ec0a10e816166d402e_1.webp differ diff --git a/modules/an_banners/img/158f0d8335b5d9d5ce134b2dd91878eb_9.webp b/modules/an_banners/img/158f0d8335b5d9d5ce134b2dd91878eb_9.webp new file mode 100644 index 00000000..8a06246a Binary files /dev/null and b/modules/an_banners/img/158f0d8335b5d9d5ce134b2dd91878eb_9.webp differ diff --git a/modules/an_banners/img/1894779d182100a59ad0a385decd4bf0_10.webp b/modules/an_banners/img/1894779d182100a59ad0a385decd4bf0_10.webp new file mode 100644 index 00000000..d4348a0d Binary files /dev/null and b/modules/an_banners/img/1894779d182100a59ad0a385decd4bf0_10.webp differ diff --git a/modules/an_banners/img/1f289e453e653517ee55ef68e01c157b_8.webp b/modules/an_banners/img/1f289e453e653517ee55ef68e01c157b_8.webp new file mode 100644 index 00000000..d4348a0d Binary files /dev/null and b/modules/an_banners/img/1f289e453e653517ee55ef68e01c157b_8.webp differ diff --git a/modules/an_banners/img/1f2f57c9942475824605db7fb8002845_1.png b/modules/an_banners/img/1f2f57c9942475824605db7fb8002845_1.png new file mode 100644 index 00000000..77ac5880 Binary files /dev/null and b/modules/an_banners/img/1f2f57c9942475824605db7fb8002845_1.png differ diff --git a/modules/an_banners/img/23d8bbd7db86422dccc6129e97b921db_1.png b/modules/an_banners/img/23d8bbd7db86422dccc6129e97b921db_1.png new file mode 100644 index 00000000..bdc4a368 Binary files /dev/null and b/modules/an_banners/img/23d8bbd7db86422dccc6129e97b921db_1.png differ diff --git a/modules/an_banners/img/23d8bbd7db86422dccc6129e97b921db_1.webp b/modules/an_banners/img/23d8bbd7db86422dccc6129e97b921db_1.webp new file mode 100644 index 00000000..2b28780c Binary files /dev/null and b/modules/an_banners/img/23d8bbd7db86422dccc6129e97b921db_1.webp differ diff --git a/modules/an_banners/img/35b49dd58de6c7352f9b067d12d29658_10.webp b/modules/an_banners/img/35b49dd58de6c7352f9b067d12d29658_10.webp new file mode 100644 index 00000000..8a06246a Binary files /dev/null and b/modules/an_banners/img/35b49dd58de6c7352f9b067d12d29658_10.webp differ diff --git a/modules/an_banners/img/3cbc04ed432ded508f6181475aaf3be8_5.webp b/modules/an_banners/img/3cbc04ed432ded508f6181475aaf3be8_5.webp new file mode 100644 index 00000000..d4348a0d Binary files /dev/null and b/modules/an_banners/img/3cbc04ed432ded508f6181475aaf3be8_5.webp differ diff --git a/modules/an_banners/img/68c738d264898756a2d704739aa5c5f3_1.png b/modules/an_banners/img/68c738d264898756a2d704739aa5c5f3_1.png new file mode 100644 index 00000000..0a97333f Binary files /dev/null and b/modules/an_banners/img/68c738d264898756a2d704739aa5c5f3_1.png differ diff --git a/modules/an_banners/img/68c738d264898756a2d704739aa5c5f3_1.webp b/modules/an_banners/img/68c738d264898756a2d704739aa5c5f3_1.webp new file mode 100644 index 00000000..f6222ab4 Binary files /dev/null and b/modules/an_banners/img/68c738d264898756a2d704739aa5c5f3_1.webp differ diff --git a/modules/an_banners/img/6b91a14039a6b640fa273d97f24d3cf4_1.webp b/modules/an_banners/img/6b91a14039a6b640fa273d97f24d3cf4_1.webp new file mode 100644 index 00000000..1547d215 Binary files /dev/null and b/modules/an_banners/img/6b91a14039a6b640fa273d97f24d3cf4_1.webp differ diff --git a/modules/an_banners/img/6bc1610c0c3f7bd7426223e2caca289c_1.png b/modules/an_banners/img/6bc1610c0c3f7bd7426223e2caca289c_1.png new file mode 100644 index 00000000..9541571a Binary files /dev/null and b/modules/an_banners/img/6bc1610c0c3f7bd7426223e2caca289c_1.png differ diff --git a/modules/an_banners/img/6bc1610c0c3f7bd7426223e2caca289c_1.webp b/modules/an_banners/img/6bc1610c0c3f7bd7426223e2caca289c_1.webp new file mode 100644 index 00000000..5cb3e2fc Binary files /dev/null and b/modules/an_banners/img/6bc1610c0c3f7bd7426223e2caca289c_1.webp differ diff --git a/modules/an_banners/img/70f1166378d57f87628f4a1d36719448_11.webp b/modules/an_banners/img/70f1166378d57f87628f4a1d36719448_11.webp new file mode 100644 index 00000000..8a06246a Binary files /dev/null and b/modules/an_banners/img/70f1166378d57f87628f4a1d36719448_11.webp differ diff --git a/modules/an_banners/img/73d10afbc55e8ef44938978ecef3e12f_1.webp b/modules/an_banners/img/73d10afbc55e8ef44938978ecef3e12f_1.webp new file mode 100644 index 00000000..ae1c7129 Binary files /dev/null and b/modules/an_banners/img/73d10afbc55e8ef44938978ecef3e12f_1.webp differ diff --git a/modules/an_banners/img/81cdba8fdd9da8133400c0a22a99bba0_3.webp b/modules/an_banners/img/81cdba8fdd9da8133400c0a22a99bba0_3.webp new file mode 100644 index 00000000..8a06246a Binary files /dev/null and b/modules/an_banners/img/81cdba8fdd9da8133400c0a22a99bba0_3.webp differ diff --git a/modules/an_banners/img/8959c94254f975c5bb72e49d5975000e_1.webp b/modules/an_banners/img/8959c94254f975c5bb72e49d5975000e_1.webp new file mode 100644 index 00000000..bc9e7d92 Binary files /dev/null and b/modules/an_banners/img/8959c94254f975c5bb72e49d5975000e_1.webp differ diff --git a/modules/an_banners/img/8d5a48254ff239f1655a12ef98571c2f_1.webp b/modules/an_banners/img/8d5a48254ff239f1655a12ef98571c2f_1.webp new file mode 100644 index 00000000..eed1f6f3 Binary files /dev/null and b/modules/an_banners/img/8d5a48254ff239f1655a12ef98571c2f_1.webp differ diff --git a/modules/an_banners/img/9303c4555e10cc43e61325bebbf1809a_1.webp b/modules/an_banners/img/9303c4555e10cc43e61325bebbf1809a_1.webp new file mode 100644 index 00000000..eed1f6f3 Binary files /dev/null and b/modules/an_banners/img/9303c4555e10cc43e61325bebbf1809a_1.webp differ diff --git a/modules/an_banners/img/9f615ae384f5e46bfa924b62c4a2c7d5_5.webp b/modules/an_banners/img/9f615ae384f5e46bfa924b62c4a2c7d5_5.webp new file mode 100644 index 00000000..a0b62264 Binary files /dev/null and b/modules/an_banners/img/9f615ae384f5e46bfa924b62c4a2c7d5_5.webp differ diff --git a/modules/an_banners/img/a012a550d18bfd6db764898490af26f0_8.webp b/modules/an_banners/img/a012a550d18bfd6db764898490af26f0_8.webp new file mode 100644 index 00000000..8a06246a Binary files /dev/null and b/modules/an_banners/img/a012a550d18bfd6db764898490af26f0_8.webp differ diff --git a/modules/an_banners/img/a06772cdcd691ae98d40b0e5f4a2c0fd_11.webp b/modules/an_banners/img/a06772cdcd691ae98d40b0e5f4a2c0fd_11.webp new file mode 100644 index 00000000..a0b62264 Binary files /dev/null and b/modules/an_banners/img/a06772cdcd691ae98d40b0e5f4a2c0fd_11.webp differ diff --git a/modules/an_banners/img/b14588d0f178d58a56a5f162bd6b829f_3.webp b/modules/an_banners/img/b14588d0f178d58a56a5f162bd6b829f_3.webp new file mode 100644 index 00000000..a0b62264 Binary files /dev/null and b/modules/an_banners/img/b14588d0f178d58a56a5f162bd6b829f_3.webp differ diff --git a/modules/an_banners/img/b48be74beecad20e6975fc01bf8eee21_1.png b/modules/an_banners/img/b48be74beecad20e6975fc01bf8eee21_1.png new file mode 100644 index 00000000..c898dfa1 Binary files /dev/null and b/modules/an_banners/img/b48be74beecad20e6975fc01bf8eee21_1.png differ diff --git a/modules/an_banners/img/b48be74beecad20e6975fc01bf8eee21_1.webp b/modules/an_banners/img/b48be74beecad20e6975fc01bf8eee21_1.webp new file mode 100644 index 00000000..20c5dc6e Binary files /dev/null and b/modules/an_banners/img/b48be74beecad20e6975fc01bf8eee21_1.webp differ diff --git a/modules/an_banners/img/bf5d3f97dbb4c6283305d9f6b0447cc3_10.webp b/modules/an_banners/img/bf5d3f97dbb4c6283305d9f6b0447cc3_10.webp new file mode 100644 index 00000000..a0b62264 Binary files /dev/null and b/modules/an_banners/img/bf5d3f97dbb4c6283305d9f6b0447cc3_10.webp differ diff --git a/modules/an_banners/img/c584836401b44f9da10bfe3086305b33_1.jpg b/modules/an_banners/img/c584836401b44f9da10bfe3086305b33_1.jpg new file mode 100644 index 00000000..6c3a2e13 Binary files /dev/null and b/modules/an_banners/img/c584836401b44f9da10bfe3086305b33_1.jpg differ diff --git a/modules/an_banners/img/ca0f7e8439a85f0c9b56f9ca1525b70b_1.png b/modules/an_banners/img/ca0f7e8439a85f0c9b56f9ca1525b70b_1.png new file mode 100644 index 00000000..7b6f09d9 Binary files /dev/null and b/modules/an_banners/img/ca0f7e8439a85f0c9b56f9ca1525b70b_1.png differ diff --git a/modules/an_banners/img/ca0f7e8439a85f0c9b56f9ca1525b70b_1.webp b/modules/an_banners/img/ca0f7e8439a85f0c9b56f9ca1525b70b_1.webp new file mode 100644 index 00000000..65788bc2 Binary files /dev/null and b/modules/an_banners/img/ca0f7e8439a85f0c9b56f9ca1525b70b_1.webp differ diff --git a/modules/an_banners/img/cbe8f13d15f6a69c2be11648bc85953c_9.webp b/modules/an_banners/img/cbe8f13d15f6a69c2be11648bc85953c_9.webp new file mode 100644 index 00000000..a0b62264 Binary files /dev/null and b/modules/an_banners/img/cbe8f13d15f6a69c2be11648bc85953c_9.webp differ diff --git a/modules/an_banners/img/cf7cb9245a9a6874135e7c835497a03c_1.png b/modules/an_banners/img/cf7cb9245a9a6874135e7c835497a03c_1.png new file mode 100644 index 00000000..d77a884c Binary files /dev/null and b/modules/an_banners/img/cf7cb9245a9a6874135e7c835497a03c_1.png differ diff --git a/modules/an_banners/img/cf7cb9245a9a6874135e7c835497a03c_1.webp b/modules/an_banners/img/cf7cb9245a9a6874135e7c835497a03c_1.webp new file mode 100644 index 00000000..1b9db37a Binary files /dev/null and b/modules/an_banners/img/cf7cb9245a9a6874135e7c835497a03c_1.webp differ diff --git a/modules/an_banners/img/dff4e044aae59a0bb26a621bd7f4b6b6_8.webp b/modules/an_banners/img/dff4e044aae59a0bb26a621bd7f4b6b6_8.webp new file mode 100644 index 00000000..a0b62264 Binary files /dev/null and b/modules/an_banners/img/dff4e044aae59a0bb26a621bd7f4b6b6_8.webp differ diff --git a/modules/an_banners/img/ee6e906fc612e729e5775a2369e539ef_5.webp b/modules/an_banners/img/ee6e906fc612e729e5775a2369e539ef_5.webp new file mode 100644 index 00000000..8a06246a Binary files /dev/null and b/modules/an_banners/img/ee6e906fc612e729e5775a2369e539ef_5.webp differ diff --git a/modules/an_banners/img/ef8f785066e1f317998dbcc5aeaa05ce_11.webp b/modules/an_banners/img/ef8f785066e1f317998dbcc5aeaa05ce_11.webp new file mode 100644 index 00000000..d4348a0d Binary files /dev/null and b/modules/an_banners/img/ef8f785066e1f317998dbcc5aeaa05ce_11.webp differ diff --git a/modules/an_banners/img/f0ddec4a54d395db9564bd00a5a6e9d3_3.webp b/modules/an_banners/img/f0ddec4a54d395db9564bd00a5a6e9d3_3.webp new file mode 100644 index 00000000..d4348a0d Binary files /dev/null and b/modules/an_banners/img/f0ddec4a54d395db9564bd00a5a6e9d3_3.webp differ diff --git a/modules/an_banners/img/f12e21abd7863cef892dbf5a1955e352_9.webp b/modules/an_banners/img/f12e21abd7863cef892dbf5a1955e352_9.webp new file mode 100644 index 00000000..d4348a0d Binary files /dev/null and b/modules/an_banners/img/f12e21abd7863cef892dbf5a1955e352_9.webp differ diff --git a/modules/an_banners/img/index.php b/modules/an_banners/img/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/index.php b/modules/an_banners/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/logo.png b/modules/an_banners/logo.png new file mode 100644 index 00000000..c0ee79d5 Binary files /dev/null and b/modules/an_banners/logo.png differ diff --git a/modules/an_banners/logo.webp b/modules/an_banners/logo.webp new file mode 100644 index 00000000..de48cf29 Binary files /dev/null and b/modules/an_banners/logo.webp differ diff --git a/modules/an_banners/sql/index.php b/modules/an_banners/sql/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/sql/install.php b/modules/an_banners/sql/install.php new file mode 100644 index 00000000..0461ed26 --- /dev/null +++ b/modules/an_banners/sql/install.php @@ -0,0 +1,47 @@ + +* @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; \ No newline at end of file diff --git a/modules/an_banners/sql/uninstall.php b/modules/an_banners/sql/uninstall.php new file mode 100644 index 00000000..422bbafa --- /dev/null +++ b/modules/an_banners/sql/uninstall.php @@ -0,0 +1,26 @@ + +* @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; \ No newline at end of file diff --git a/modules/an_banners/translations/pl.php b/modules/an_banners/translations/pl.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/views/css/front.css b/modules/an_banners/views/css/front.css new file mode 100644 index 00000000..84c0e780 --- /dev/null +++ b/modules/an_banners/views/css/front.css @@ -0,0 +1,12 @@ +/** +* 2022 Anvanto +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* +* @author Anvanto +* @copyright 2022 Anvanto +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +*/ + diff --git a/modules/an_banners/views/css/index.php b/modules/an_banners/views/css/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/views/index.php b/modules/an_banners/views/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/views/js/Sortable.min.js b/modules/an_banners/views/js/Sortable.min.js new file mode 100644 index 00000000..0032346f --- /dev/null +++ b/modules/an_banners/views/js/Sortable.min.js @@ -0,0 +1,13 @@ +/** +* 2022 Anvanto +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* +* @author Anvanto +* @copyright 2022 Anvanto +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +*/ +/*! Sortable 1.4.2 - MIT | git://github.com/rubaxa/Sortable.git */ +!function(a){"use strict";"function"==typeof define&&define.amd?define(a):"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=a():"undefined"!=typeof Package?Sortable=a():window.Sortable=a()}(function(){"use strict";function a(a,b){if(!a||!a.nodeType||1!==a.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(a);this.el=a,this.options=b=r({},b),a[L]=this;var c={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(a.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",ignore:"a, img",filter:null,animation:0,setData:function(a,b){a.setData("Text",b.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1};for(var d in c)!(d in b)&&(b[d]=c[d]);V(b);for(var f in this)"_"===f.charAt(0)&&(this[f]=this[f].bind(this));this.nativeDraggable=b.forceFallback?!1:P,e(a,"mousedown",this._onTapStart),e(a,"touchstart",this._onTapStart),this.nativeDraggable&&(e(a,"dragover",this),e(a,"dragenter",this)),T.push(this._onDragOver),b.store&&this.sort(b.store.get(this))}function b(a){v&&v.state!==a&&(h(v,"display",a?"none":""),!a&&v.state&&w.insertBefore(v,s),v.state=a)}function c(a,b,c){if(a){c=c||N,b=b.split(".");var d=b.shift().toUpperCase(),e=new RegExp("\\s("+b.join("|")+")(?=\\s)","g");do if(">*"===d&&a.parentNode===c||(""===d||a.nodeName.toUpperCase()==d)&&(!b.length||((" "+a.className+" ").match(e)||[]).length==b.length))return a;while(a!==c&&(a=a.parentNode))}return null}function d(a){a.dataTransfer&&(a.dataTransfer.dropEffect="move"),a.preventDefault()}function e(a,b,c){a.addEventListener(b,c,!1)}function f(a,b,c){a.removeEventListener(b,c,!1)}function g(a,b,c){if(a)if(a.classList)a.classList[c?"add":"remove"](b);else{var d=(" "+a.className+" ").replace(K," ").replace(" "+b+" "," ");a.className=(d+(c?" "+b:"")).replace(K," ")}}function h(a,b,c){var d=a&&a.style;if(d){if(void 0===c)return N.defaultView&&N.defaultView.getComputedStyle?c=N.defaultView.getComputedStyle(a,""):a.currentStyle&&(c=a.currentStyle),void 0===b?c:c[b];b in d||(b="-webkit-"+b),d[b]=c+("string"==typeof c?"":"px")}}function i(a,b,c){if(a){var d=a.getElementsByTagName(b),e=0,f=d.length;if(c)for(;f>e;e++)c(d[e],e);return d}return[]}function j(a,b,c,d,e,f,g){var h=N.createEvent("Event"),i=(a||b[L]).options,j="on"+c.charAt(0).toUpperCase()+c.substr(1);h.initEvent(c,!0,!0),h.to=b,h.from=e||b,h.item=d||b,h.clone=v,h.oldIndex=f,h.newIndex=g,b.dispatchEvent(h),i[j]&&i[j].call(a,h)}function k(a,b,c,d,e,f){var g,h,i=a[L],j=i.options.onMove;return g=N.createEvent("Event"),g.initEvent("move",!0,!0),g.to=b,g.from=a,g.dragged=c,g.draggedRect=d,g.related=e||b,g.relatedRect=f||b.getBoundingClientRect(),a.dispatchEvent(g),j&&(h=j.call(i,g)),h}function l(a){a.draggable=!1}function m(){R=!1}function n(a,b){var c=a.lastElementChild,d=c.getBoundingClientRect();return(b.clientY-(d.top+d.height)>5||b.clientX-(d.right+d.width)>5)&&c}function o(a){for(var b=a.tagName+a.className+a.src+a.href+a.textContent,c=b.length,d=0;c--;)d+=b.charCodeAt(c);return d.toString(36)}function p(a){var b=0;if(!a||!a.parentNode)return-1;for(;a&&(a=a.previousElementSibling);)"TEMPLATE"!==a.nodeName.toUpperCase()&&b++;return b}function q(a,b){var c,d;return function(){void 0===c&&(c=arguments,d=this,setTimeout(function(){1===c.length?a.call(d,c[0]):a.apply(d,c),c=void 0},b))}}function r(a,b){if(a&&b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}var s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J={},K=/\s+/g,L="Sortable"+(new Date).getTime(),M=window,N=M.document,O=M.parseInt,P=!!("draggable"in N.createElement("div")),Q=function(a){return a=N.createElement("x"),a.style.cssText="pointer-events:auto","auto"===a.style.pointerEvents}(),R=!1,S=Math.abs,T=([].slice,[]),U=q(function(a,b,c){if(c&&b.scroll){var d,e,f,g,h=b.scrollSensitivity,i=b.scrollSpeed,j=a.clientX,k=a.clientY,l=window.innerWidth,m=window.innerHeight;if(z!==c&&(y=b.scroll,z=c,y===!0)){y=c;do if(y.offsetWidth=l-j)-(h>=j),g=(h>=m-k)-(h>=k),(f||g)&&(d=M)),(J.vx!==f||J.vy!==g||J.el!==d)&&(J.el=d,J.vx=f,J.vy=g,clearInterval(J.pid),d&&(J.pid=setInterval(function(){d===M?M.scrollTo(M.pageXOffset+f*i,M.pageYOffset+g*i):(g&&(d.scrollTop+=g*i),f&&(d.scrollLeft+=f*i))},24)))}},30),V=function(a){var b=a.group;b&&"object"==typeof b||(b=a.group={name:b}),["pull","put"].forEach(function(a){a in b||(b[a]=!0)}),a.groups=" "+b.name+(b.put.join?" "+b.put.join(" "):"")+" "};return a.prototype={constructor:a,_onTapStart:function(a){var b=this,d=this.el,e=this.options,f=a.type,g=a.touches&&a.touches[0],h=(g||a).target,i=h,k=e.filter;if(!("mousedown"===f&&0!==a.button||e.disabled)&&(h=c(h,e.draggable,d))){if(D=p(h),"function"==typeof k){if(k.call(this,a,h,this))return j(b,i,"filter",h,d,D),void a.preventDefault()}else if(k&&(k=k.split(",").some(function(a){return a=c(i,a.trim(),d),a?(j(b,a,"filter",h,d,D),!0):void 0})))return void a.preventDefault();(!e.handle||c(i,e.handle,d))&&this._prepareDragStart(a,g,h)}},_prepareDragStart:function(a,b,c){var d,f=this,h=f.el,j=f.options,k=h.ownerDocument;c&&!s&&c.parentNode===h&&(G=a,w=h,s=c,t=s.parentNode,x=s.nextSibling,F=j.group,d=function(){f._disableDelayedDrag(),s.draggable=!0,g(s,f.options.chosenClass,!0),f._triggerDragStart(b)},j.ignore.split(",").forEach(function(a){i(s,a.trim(),l)}),e(k,"mouseup",f._onDrop),e(k,"touchend",f._onDrop),e(k,"touchcancel",f._onDrop),j.delay?(e(k,"mouseup",f._disableDelayedDrag),e(k,"touchend",f._disableDelayedDrag),e(k,"touchcancel",f._disableDelayedDrag),e(k,"mousemove",f._disableDelayedDrag),e(k,"touchmove",f._disableDelayedDrag),f._dragStartTimer=setTimeout(d,j.delay)):d())},_disableDelayedDrag:function(){var a=this.el.ownerDocument;clearTimeout(this._dragStartTimer),f(a,"mouseup",this._disableDelayedDrag),f(a,"touchend",this._disableDelayedDrag),f(a,"touchcancel",this._disableDelayedDrag),f(a,"mousemove",this._disableDelayedDrag),f(a,"touchmove",this._disableDelayedDrag)},_triggerDragStart:function(a){a?(G={target:s,clientX:a.clientX,clientY:a.clientY},this._onDragStart(G,"touch")):this.nativeDraggable?(e(s,"dragend",this),e(w,"dragstart",this._onDragStart)):this._onDragStart(G,!0);try{N.selection?N.selection.empty():window.getSelection().removeAllRanges()}catch(b){}},_dragStarted:function(){w&&s&&(g(s,this.options.ghostClass,!0),a.active=this,j(this,w,"start",s,w,D))},_emulateDragOver:function(){if(H){if(this._lastX===H.clientX&&this._lastY===H.clientY)return;this._lastX=H.clientX,this._lastY=H.clientY,Q||h(u,"display","none");var a=N.elementFromPoint(H.clientX,H.clientY),b=a,c=" "+this.options.group.name,d=T.length;if(b)do{if(b[L]&&b[L].options.groups.indexOf(c)>-1){for(;d--;)T[d]({clientX:H.clientX,clientY:H.clientY,target:a,rootEl:b});break}a=b}while(b=b.parentNode);Q||h(u,"display","")}},_onTouchMove:function(b){if(G){a.active||this._dragStarted(),this._appendGhost();var c=b.touches?b.touches[0]:b,d=c.clientX-G.clientX,e=c.clientY-G.clientY,f=b.touches?"translate3d("+d+"px,"+e+"px,0)":"translate("+d+"px,"+e+"px)";I=!0,H=c,h(u,"webkitTransform",f),h(u,"mozTransform",f),h(u,"msTransform",f),h(u,"transform",f),b.preventDefault()}},_appendGhost:function(){if(!u){var a,b=s.getBoundingClientRect(),c=h(s),d=this.options;u=s.cloneNode(!0),g(u,d.ghostClass,!1),g(u,d.fallbackClass,!0),h(u,"top",b.top-O(c.marginTop,10)),h(u,"left",b.left-O(c.marginLeft,10)),h(u,"width",b.width),h(u,"height",b.height),h(u,"opacity","0.8"),h(u,"position","fixed"),h(u,"zIndex","100000"),h(u,"pointerEvents","none"),d.fallbackOnBody&&N.body.appendChild(u)||w.appendChild(u),a=u.getBoundingClientRect(),h(u,"width",2*b.width-a.width),h(u,"height",2*b.height-a.height)}},_onDragStart:function(a,b){var c=a.dataTransfer,d=this.options;this._offUpEvents(),"clone"==F.pull&&(v=s.cloneNode(!0),h(v,"display","none"),w.insertBefore(v,s)),b?("touch"===b?(e(N,"touchmove",this._onTouchMove),e(N,"touchend",this._onDrop),e(N,"touchcancel",this._onDrop)):(e(N,"mousemove",this._onTouchMove),e(N,"mouseup",this._onDrop)),this._loopId=setInterval(this._emulateDragOver,50)):(c&&(c.effectAllowed="move",d.setData&&d.setData.call(this,c,s)),e(N,"drop",this),setTimeout(this._dragStarted,0))},_onDragOver:function(a){var d,e,f,g=this.el,i=this.options,j=i.group,l=j.put,o=F===j,p=i.sort;if(void 0!==a.preventDefault&&(a.preventDefault(),!i.dragoverBubble&&a.stopPropagation()),I=!0,F&&!i.disabled&&(o?p||(f=!w.contains(s)):F.pull&&l&&(F.name===j.name||l.indexOf&&~l.indexOf(F.name)))&&(void 0===a.rootEl||a.rootEl===this.el)){if(U(a,i,this.el),R)return;if(d=c(a.target,i.draggable,g),e=s.getBoundingClientRect(),f)return b(!0),void(v||x?w.insertBefore(s,v||x):p||w.appendChild(s));if(0===g.children.length||g.children[0]===u||g===a.target&&(d=n(g,a))){if(d){if(d.animated)return;r=d.getBoundingClientRect()}b(o),k(w,g,s,e,d,r)!==!1&&(s.contains(g)||(g.appendChild(s),t=g),this._animate(e,s),d&&this._animate(r,d))}else if(d&&!d.animated&&d!==s&&void 0!==d.parentNode[L]){A!==d&&(A=d,B=h(d),C=h(d.parentNode));var q,r=d.getBoundingClientRect(),y=r.right-r.left,z=r.bottom-r.top,D=/left|right|inline/.test(B.cssFloat+B.display)||"flex"==C.display&&0===C["flex-direction"].indexOf("row"),E=d.offsetWidth>s.offsetWidth,G=d.offsetHeight>s.offsetHeight,H=(D?(a.clientX-r.left)/y:(a.clientY-r.top)/z)>.5,J=d.nextElementSibling,K=k(w,g,s,e,d,r);if(K!==!1){if(R=!0,setTimeout(m,30),b(o),1===K||-1===K)q=1===K;else if(D){var M=s.offsetTop,N=d.offsetTop;q=M===N?d.previousElementSibling===s&&!E||H&&E:N>M}else q=J!==s&&!G||H&&G;s.contains(g)||(q&&!J?g.appendChild(s):d.parentNode.insertBefore(s,q?J:d)),t=s.parentNode,this._animate(e,s),this._animate(r,d)}}}},_animate:function(a,b){var c=this.options.animation;if(c){var d=b.getBoundingClientRect();h(b,"transition","none"),h(b,"transform","translate3d("+(a.left-d.left)+"px,"+(a.top-d.top)+"px,0)"),b.offsetWidth,h(b,"transition","all "+c+"ms"),h(b,"transform","translate3d(0,0,0)"),clearTimeout(b.animated),b.animated=setTimeout(function(){h(b,"transition",""),h(b,"transform",""),b.animated=!1},c)}},_offUpEvents:function(){var a=this.el.ownerDocument;f(N,"touchmove",this._onTouchMove),f(a,"mouseup",this._onDrop),f(a,"touchend",this._onDrop),f(a,"touchcancel",this._onDrop)},_onDrop:function(b){var c=this.el,d=this.options;clearInterval(this._loopId),clearInterval(J.pid),clearTimeout(this._dragStartTimer),f(N,"mousemove",this._onTouchMove),this.nativeDraggable&&(f(N,"drop",this),f(c,"dragstart",this._onDragStart)),this._offUpEvents(),b&&(I&&(b.preventDefault(),!d.dropBubble&&b.stopPropagation()),u&&u.parentNode.removeChild(u),s&&(this.nativeDraggable&&f(s,"dragend",this),l(s),g(s,this.options.ghostClass,!1),g(s,this.options.chosenClass,!1),w!==t?(E=p(s),E>=0&&(j(null,t,"sort",s,w,D,E),j(this,w,"sort",s,w,D,E),j(null,t,"add",s,w,D,E),j(this,w,"remove",s,w,D,E))):(v&&v.parentNode.removeChild(v),s.nextSibling!==x&&(E=p(s),E>=0&&(j(this,w,"update",s,w,D,E),j(this,w,"sort",s,w,D,E)))),a.active&&((null===E||-1===E)&&(E=D),j(this,w,"end",s,w,D,E),this.save())),w=s=t=u=x=v=y=z=G=H=I=E=A=B=F=a.active=null)},handleEvent:function(a){var b=a.type;"dragover"===b||"dragenter"===b?s&&(this._onDragOver(a),d(a)):("drop"===b||"dragend"===b)&&this._onDrop(a)},toArray:function(){for(var a,b=[],d=this.el.children,e=0,f=d.length,g=this.options;f>e;e++)a=d[e],c(a,g.draggable,this.el)&&b.push(a.getAttribute(g.dataIdAttr)||o(a));return b},sort:function(a){var b={},d=this.el;this.toArray().forEach(function(a,e){var f=d.children[e];c(f,this.options.draggable,d)&&(b[a]=f)},this),a.forEach(function(a){b[a]&&(d.removeChild(b[a]),d.appendChild(b[a]))})},save:function(){var a=this.options.store;a&&a.set(this)},closest:function(a,b){return c(a,b||this.options.draggable,this.el)},option:function(a,b){var c=this.options;return void 0===b?c[a]:(c[a]=b,void("group"===a&&V(c)))},destroy:function(){var a=this.el;a[L]=null,f(a,"mousedown",this._onTapStart),f(a,"touchstart",this._onTapStart),this.nativeDraggable&&(f(a,"dragover",this),f(a,"dragenter",this)),Array.prototype.forEach.call(a.querySelectorAll("[draggable]"),function(a){a.removeAttribute("draggable")}),T.splice(T.indexOf(this._onDragOver),1),this._onDrop(),this.el=a=null}},a.utils={on:e,off:f,css:h,find:i,is:function(a,b){return!!c(a,b,a)},extend:r,throttle:q,closest:c,toggleClass:g,index:p},a.create=function(b,c){return new a(b,c)},a.version="1.4.2",a}); \ No newline at end of file diff --git a/modules/an_banners/views/js/index.php b/modules/an_banners/views/js/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/views/js/sorting.js b/modules/an_banners/views/js/sorting.js new file mode 100644 index 00000000..fc18a597 --- /dev/null +++ b/modules/an_banners/views/js/sorting.js @@ -0,0 +1,51 @@ +/** +* 2022 Anvanto +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* +* @author Anvanto +* @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); \ No newline at end of file diff --git a/modules/an_banners/views/templates/admin/an_banners/helpers/form/form.tpl b/modules/an_banners/views/templates/admin/an_banners/helpers/form/form.tpl new file mode 100644 index 00000000..08daa4e7 --- /dev/null +++ b/modules/an_banners/views/templates/admin/an_banners/helpers/form/form.tpl @@ -0,0 +1,149 @@ +{* +* 2022 Anvanto +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* +* @author Anvanto +* @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'} + + {if isset($input.suffix)} + + {$input.suffix} + + {/if} + {elseif $input.type == 'file_lang'} + + {foreach from=$languages item=language} + {if $languages|count > 1} +
+ {/if} +
+ {if isset($fields_value[$input.name][$language.id_lang]) && $fields_value[$input.name][$language.id_lang] != ''} +
+
+ +
+
+
+
+ + {l s='Delete' mod='an_banners'} + +
+
+ {/if} +
+
+
+ +
+ + + + + +
+ +
+ {if $languages|count > 1} +
+ + +
+ {/if} +
+ {if $languages|count > 1} +
+ {/if} + + {/foreach} + {if isset($input.desc) && !empty($input.desc)} +

+ {$input.desc} +

+ {/if} + + {elseif $input.type == 'html'} + {if isset($input.html_content)} + {if $input.html_content == 'hr'} +
+ {else} + {$input.html_content} + {/if} + {else} + {$input.name|escape:'htmlall':'UTF-8'} + {/if} + {else} + {$smarty.block.parent} + {/if} +{/block} \ No newline at end of file diff --git a/modules/an_banners/views/templates/admin/an_banners/helpers/form/index.php b/modules/an_banners/views/templates/admin/an_banners/helpers/form/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/views/templates/admin/an_banners/helpers/index.php b/modules/an_banners/views/templates/admin/an_banners/helpers/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/views/templates/admin/an_banners/helpers/list/index.php b/modules/an_banners/views/templates/admin/an_banners/helpers/list/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/views/templates/admin/an_banners/helpers/list/list_content.tpl b/modules/an_banners/views/templates/admin/an_banners/helpers/list/list_content.tpl new file mode 100644 index 00000000..b6e3c491 --- /dev/null +++ b/modules/an_banners/views/templates/admin/an_banners/helpers/list/list_content.tpl @@ -0,0 +1,207 @@ +{* +* 2022 Anvanto +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* +* @author Anvanto +* @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} + +{if count($list)} +{foreach $list AS $index => $tr} + + {if $bulk_actions && $has_bulk_actions} + + {if isset($list_skip_actions.delete)} + {if !in_array($tr.$identifier, $list_skip_actions.delete)} + + {/if} + {else} + + {/if} + + {/if} + {foreach $fields_display AS $key => $params} + {block name="open_td"} + + {else} + onclick="document.location = '{$current_index|addslashes|escape:'html':'UTF-8'}&{$identifier|escape:'html':'UTF-8'}={$tr.$identifier|escape:'html':'UTF-8'}{if $view}&view{else}&update{/if}{$table|escape:'html':'UTF-8'}{if $page > 1}&page={$page|intval}{/if}&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}{/if} + {if isset($params.badge_warning) && $params.badge_warning && isset($tr.badge_warning) && $tr.badge_warning == $params.badge_warning}{/if} + {if isset($params.badge_danger) && $params.badge_danger && isset($tr.badge_danger) && $tr.badge_danger == $params.badge_danger}{/if} + {if isset($params.color) && isset($tr[$params.color])} + + {/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} + {$tr.$key|truncate:$params.maxlength:'...'} + {else} + {$tr.$key} + {/if} + {elseif isset($params.activeVisu)} + {if $tr.$key} + {l s='Enabled' d='Admin.Global'} + {else} + {l s='Disabled' d='Admin.Global'} + {/if} + {elseif isset($params.position)} + {if !$filters_has_value && $order_by == 'position' && $order_way != 'DESC'} +
+
+ {$tr.$key.position + 1} +
+
+ {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'])} + + {else} + {$tr[$key]['alt']} + {/if} + {/if} + {elseif isset($params.type) && $params.type == 'image'} + {$tr.$key nofilter} + {elseif isset($params.type) && $params.type == 'position'} +
  {$tr.$key nofilter}
+ {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)} + + {elseif $key == 'color'} + {if !is_array($tr.$key)} +
+ {else} {*TEXTURE*} + {$tr.name} + {/if} + {elseif isset($params.maxlength) && Tools::strlen($tr.$key) > $params.maxlength} + {$tr.$key|truncate:$params.maxlength:'...'|escape:'html':'UTF-8'} + {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)} +
+ {/if} + {if isset($params.badge_danger) && $params.badge_danger && isset($tr.badge_danger) && $tr.badge_danger == $params.badge_danger}
{/if} + {if isset($params.badge_warning) && $params.badge_warning && isset($tr.badge_warning) && $tr.badge_warning == $params.badge_warning}
{/if} + {if isset($params.badge_success) && $params.badge_success && isset($tr.badge_success) && $tr.badge_success == $params.badge_success}
{/if} + {/block} + {block name="close_td"} + + {/block} + {/foreach} + + {if $multishop_active && $shop_link_type} + + {if isset($tr.shop_short_name)} + {$tr.shop_short_name} + {else} + {$tr.shop_name} + {/if} + + {/if} + {if $has_actions} + + {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}
{/if} +
+ {$compiled_actions[0]} + {if $compiled_actions|count > 1} + + + {/if} +
+ {if $compiled_actions|count > 1}
{/if} + {/if} + + {/if} + +{/foreach} +{else} + + +
+ + {l s='No records found'} +
+ + +{/if} + diff --git a/modules/an_banners/views/templates/admin/an_banners/index.php b/modules/an_banners/views/templates/admin/an_banners/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/views/templates/admin/index.php b/modules/an_banners/views/templates/admin/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/views/templates/admin/list-img.tpl b/modules/an_banners/views/templates/admin/list-img.tpl new file mode 100644 index 00000000..2ea052e0 --- /dev/null +++ b/modules/an_banners/views/templates/admin/list-img.tpl @@ -0,0 +1,13 @@ +{* +* 2022 Anvanto +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* +* @author Anvanto +* @copyright 2022 Anvanto +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +*} + + diff --git a/modules/an_banners/views/templates/admin/suggestions.tpl b/modules/an_banners/views/templates/admin/suggestions.tpl new file mode 100644 index 00000000..18e579c1 --- /dev/null +++ b/modules/an_banners/views/templates/admin/suggestions.tpl @@ -0,0 +1,202 @@ +{* +* 2022 Anvanto +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* +* @author Anvanto +* @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} + + + + +
+
+

Contact Us

+

Contact us on any question or problem with the module

+
+ {if $rate_url <> ''} +
+

Rate{if isset($theme.name) AND $theme.name != ''} "{$theme.name}"{/if}

+ +
+ {/if} +
+

What's next?

+

Find out how to improve your shop with other modules and themes made by Anvanto.

+
+ + {* +
+

New 4th block

+

New next for this block

+
+ *} +
\ No newline at end of file diff --git a/modules/an_banners/views/templates/admin/top.tpl b/modules/an_banners/views/templates/admin/top.tpl new file mode 100644 index 00000000..abf46d23 --- /dev/null +++ b/modules/an_banners/views/templates/admin/top.tpl @@ -0,0 +1,13 @@ +{* +* 2022 Anvanto +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* +* @author Anvanto +* @copyright 2022 Anvanto +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +*} + +{include file='./suggestions.tpl'} \ No newline at end of file diff --git a/modules/an_banners/views/templates/front/banners.tpl b/modules/an_banners/views/templates/front/banners.tpl new file mode 100644 index 00000000..0d395aa0 --- /dev/null +++ b/modules/an_banners/views/templates/front/banners.tpl @@ -0,0 +1,20 @@ +{* +* 2022 Anvanto +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* +* @author Anvanto +* @copyright 2022 Anvanto +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +*} + +{if count($banners) > 0} +
+{foreach from=$banners item=banner} + {include file=$banner.tplFilePath} +{/foreach} +
+{/if} + diff --git a/modules/an_banners/views/templates/front/banners/default.tpl b/modules/an_banners/views/templates/front/banners/default.tpl new file mode 100644 index 00000000..7d81ee07 --- /dev/null +++ b/modules/an_banners/views/templates/front/banners/default.tpl @@ -0,0 +1,24 @@ +{* +* 2022 Anvanto +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* +* @author Anvanto +* @copyright 2022 Anvanto +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +*} + + + {if $banner.imgUrlFile !=''} + + {/if} +
+

{$banner.title|escape:'htmlall':'UTF-8'}

+ {$banner.text nofilter} +
+ {if $banner.link !=''} + + {/if} + \ No newline at end of file diff --git a/modules/an_banners/views/templates/front/banners/index.php b/modules/an_banners/views/templates/front/banners/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/views/templates/front/banners/simple_text.tpl b/modules/an_banners/views/templates/front/banners/simple_text.tpl new file mode 100644 index 00000000..9ef28a13 --- /dev/null +++ b/modules/an_banners/views/templates/front/banners/simple_text.tpl @@ -0,0 +1,27 @@ +{* + * 2022 Anvanto + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * + * @author Anvanto + * @copyright 2022 Anvanto + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + *} + + + {if $banner.link !=''} + + {/if} + {if $banner.imgUrlFile !=''} + + {/if} +
+

{$banner.title|escape:'htmlall':'UTF-8'}

+ {$banner.text nofilter} +
+ {if $banner.link !=''} +
+ {/if} + \ No newline at end of file diff --git a/modules/an_banners/views/templates/front/index.php b/modules/an_banners/views/templates/front/index.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/an_banners/views/templates/index.php b/modules/an_banners/views/templates/index.php new file mode 100644 index 00000000..e69de29b diff --git a/themes/charme/assets/css/custom.css b/themes/charme/assets/css/custom.css index 2753098c..6450c417 100644 --- a/themes/charme/assets/css/custom.css +++ b/themes/charme/assets/css/custom.css @@ -1 +1 @@ -.an_banner{position:relative}.an_banner .an_banner-link{position:absolute;inset:0}#tc-container .text,#tc-container-mobile .text{position:static !important}#tc-container .form-group,#tc-container-mobile .form-group{margin-bottom:0;padding-right:5px}#tc-container .custom-checkbox span.label,#tc-container-mobile .custom-checkbox span.label{font-size:14px;display:block}#tc-container .field-label,#tc-container-mobile .field-label{font-size:14px}#tc-container .checkout-block,#tc-container-mobile .checkout-block{padding:0 15px}#tc-container #thecheckout-html-box-1,#tc-container-mobile #thecheckout-html-box-1{display:none !important}#tc-container #select-widget,#tc-container-mobile #select-widget{width:100% !important}#tc-container .delivery-options .row.delivery-option,#tc-container-mobile .delivery-options .row.delivery-option{flex-wrap:wrap !important}#tc-container .delivery-option-detail *,#tc-container .payment-option *,#tc-container-mobile .delivery-option-detail *,#tc-container-mobile .payment-option *{font-size:14px !important}.top-bar{background:#ff0f1c;color:#fff !important;display:flex;gap:10px;justify-content:center;width:100%}.top-bar .text-container{width:100%;display:flex;gap:10px;justify-content:center}.top-bar div.text{text-align:center;width:-moz-fit-content;width:fit-content;font-size:14px}#checkout .card{background:#fff !important}#tc-container{margin-top:25px}#tc-container .checkout-area-2{margin-bottom:10px}#tc-container .blocks{border:1px solid #eee;padding:15px}#tc-container .checkout-area-4{gap:10px;margin-bottom:10px}#tc-container .checkout-area-9{margin-bottom:10px;gap:10px}#tc-container .checkout-block #main .block-header{padding:0 !important}#tc-container .checkout-block #main .cart-grid{margin:0 !important}#tc-container .checkout-block #main .cart-grid .card{padding:0 !important}#tc-container .checkout-block #main .cart-grid .cart-detailed-totals{background:#fff !important}#tc-container .checkout-block #main .cart-grid .promo-highlighted{margin-top:15px;padding-top:15px;border-top:1px solid #d3d3d3}@media(max-width: 825px){#tc-container .blocks{display:none !important}}#tc-container-mobile .custom-checkbox,#tc-container .custom-checkbox{margin-bottom:10px !important}#tc-container-mobile .block-header.account-header,#tc-container-mobile .block-header.address-name-header,#tc-container-mobile .block-header.shipping-method-header,#tc-container-mobile .block-header.payment-method-header,#tc-container .block-header.account-header,#tc-container .block-header.address-name-header,#tc-container .block-header.shipping-method-header,#tc-container .block-header.payment-method-header{padding:0 !important;margin-bottom:10px}#tc-container-mobile .block-header.account-header::before,#tc-container-mobile .block-header.address-name-header::before,#tc-container-mobile .block-header.shipping-method-header::before,#tc-container-mobile .block-header.payment-method-header::before,#tc-container .block-header.account-header::before,#tc-container .block-header.address-name-header::before,#tc-container .block-header.shipping-method-header::before,#tc-container .block-header.payment-method-header::before{background:#ff0f1c !important;color:#fff !important;border:0 !important}#tc-container-mobile input[type=text],#tc-container-mobile input[type=email],#tc-container-mobile input[type=password],#tc-container-mobile input[type=tel],#tc-container-mobile textarea,#tc-container-mobile select,#tc-container input[type=text],#tc-container input[type=email],#tc-container input[type=password],#tc-container input[type=tel],#tc-container textarea,#tc-container select{border:1px solid #d3d3d3;border-radius:4px;padding:10px;height:40px;line-height:20px;font-size:14px;width:100%;color:#000}#tc-container-mobile input[type=text]::-moz-placeholder, #tc-container-mobile input[type=email]::-moz-placeholder, #tc-container-mobile input[type=password]::-moz-placeholder, #tc-container-mobile input[type=tel]::-moz-placeholder, #tc-container-mobile textarea::-moz-placeholder, #tc-container-mobile select::-moz-placeholder, #tc-container input[type=text]::-moz-placeholder, #tc-container input[type=email]::-moz-placeholder, #tc-container input[type=password]::-moz-placeholder, #tc-container input[type=tel]::-moz-placeholder, #tc-container textarea::-moz-placeholder, #tc-container select::-moz-placeholder{color:#999 !important;visibility:visible !important;opacity:1 !important}#tc-container-mobile input[type=text]::placeholder,#tc-container-mobile input[type=email]::placeholder,#tc-container-mobile input[type=password]::placeholder,#tc-container-mobile input[type=tel]::placeholder,#tc-container-mobile textarea::placeholder,#tc-container-mobile select::placeholder,#tc-container input[type=text]::placeholder,#tc-container input[type=email]::placeholder,#tc-container input[type=password]::placeholder,#tc-container input[type=tel]::placeholder,#tc-container textarea::placeholder,#tc-container select::placeholder{color:#999 !important;visibility:visible !important;opacity:1 !important}#tc-container-mobile input[type=text]:focus,#tc-container-mobile input[type=email]:focus,#tc-container-mobile input[type=password]:focus,#tc-container-mobile input[type=tel]:focus,#tc-container-mobile textarea:focus,#tc-container-mobile select:focus,#tc-container input[type=text]:focus,#tc-container input[type=email]:focus,#tc-container input[type=password]:focus,#tc-container input[type=tel]:focus,#tc-container textarea:focus,#tc-container select:focus{border-color:#7c7c7c !important}#tc-container-mobile .cart-line-product-quantity,#tc-container .cart-line-product-quantity{width:60px !important}#tc-container-mobile .suggestion:hover,#tc-container-mobile .selected,#tc-container .suggestion:hover,#tc-container .selected{background:#fff !important}#tc-container-mobile .remaining-amount-to-free-shipping-container,#tc-container .remaining-amount-to-free-shipping-container{margin-bottom:10px}#tc-container-mobile a.cart-line-product-quantity-up,#tc-container-mobile a.cart-line-product-quantity-down,#tc-container a.cart-line-product-quantity-up,#tc-container a.cart-line-product-quantity-down{height:40px !important;width:35px !important;border:1px solid #d3d3d3 !important;margin-left:3px;margin-right:3px;background-size:30% !important}#tc-container-mobile .delivery-options-list.shipping-selected #select-widget,#tc-container .delivery-options-list.shipping-selected #select-widget{border:0 !important}#tc-container-mobile .block-promo .promo-input-button .promo-input+button,#tc-container .block-promo .promo-input-button .promo-input+button{flex-basis:auto}#tc-container-mobile #thecheckout-newsletter,#tc-container #thecheckout-newsletter{display:none !important}#tc-container-mobile .custom-checkbox input[type=checkbox]:checked+span .checkbox-checked,#tc-container .custom-checkbox input[type=checkbox]:checked+span .checkbox-checked{color:#ff0f1c;font-size:20px}body.compact-cart #tc-container .qty-container .qty-box{transform:none !important;margin-bottom:5px}#tc-container-mobile .checkout-block{padding:0 !important}#tc-container-mobile .card.cart-container{padding:0 !important}#tc-container-mobile .product-line-actions{padding-top:0 !important}#tc-container-mobile .product-line-price{display:none !important}#tc-container-mobile .cart-detailed-totals{background:#fff !important}#tc-container-mobile .card.cart-summary{padding:0 !important;background:#fff !important}#tc-container-mobile .delivery-options-list.shipping-selected #select-widget{padding-left:10px;background-image:none !important}#tc-container-mobile #promo-code .promo-input-button{display:grid !important;grid-template-columns:1fr !important;height:-moz-fit-content !important;height:fit-content !important}#tc-container-mobile .promo-code form{width:100% !important}body.compact-cart #tc-container .product-line-actions{flex-basis:auto}.product-line-delete .remove-from-cart{display:flex !important;height:40px;width:35px;justify-content:center;align-items:center;border:1px solid #d3d3d3}@media(max-width: 767px){.product-line-qty,.product-line-price,.product-line-delete{padding:0 !important}.product-line-body{padding-left:5px !important}}.amenu-item .amenu-link{padding:20px}@media(min-width: 767px){.btn-search-open{display:none !important}.header-top{display:flex;flex-wrap:wrap;justify-content:center;padding:0 15px;max-width:1920px;margin:auto}.header-top .navigation{width:100%}.header-top .navigation .container{width:100%;max-width:100%}.header-top .navigation .container .anav-top{width:100%}.header-top #_desktop_logo{width:300px;padding:10px}.header-top #_desktop_logo a{display:block}.header-top #_desktop_logo a .logo{max-height:unset !important;width:100% !important;height:auto;max-width:300px !important}.header-top #_desktop_search_widget{width:calc(100% - 300px);display:flex;align-items:center}.header-top #_desktop_search_widget #search_widget{position:static;width:100%}.header-top #_desktop_search_widget #search_widget form{position:static;display:flex;justify-content:flex-end;width:100%}.header-top #_desktop_search_widget #search_widget form input[name=s]{width:100%;max-width:600px}.header-top #_desktop_search_widget #search_widget form button{position:static;background:#ff0f1c;display:flex;width:48px;width:48px;align-items:center;justify-content:center}.header-top #_desktop_search_widget #search_widget form button i{color:#fff !important}}.an_homeproducts-products .products.owl-carousel .owl-dots{display:none !important}.an_homeproducts-products .products.owl-carousel .owl-nav{display:flex;align-items:center;justify-content:space-between;margin-top:0;top:-35px;position:absolute;width:100%}.an_homeproducts-products .products.owl-carousel .owl-nav>div{background:none;border-radius:0;border:1px solid #c8c8c8;height:35px;width:35px}.js-an_homeproducts-block{margin-bottom:25px !important}body#product .featured-products>h2{display:none !important}.form-control.alert{border:1px solid #c00 !important}.box_clothes_size a{text-align:center;font-weight:600;line-height:1.25;display:block;color:#000;font-size:16px;text-decoration:underline}/*# sourceMappingURL=custom.css.map */ \ No newline at end of file +.an_banner{position:relative}.an_banner .an_banner-link{position:absolute;inset:0}#tc-container .text,#tc-container-mobile .text{position:static !important}#tc-container .form-group,#tc-container-mobile .form-group{margin-bottom:0;padding-right:5px}#tc-container .custom-checkbox span.label,#tc-container-mobile .custom-checkbox span.label{font-size:14px;display:block}#tc-container .field-label,#tc-container-mobile .field-label{font-size:14px}#tc-container .checkout-block,#tc-container-mobile .checkout-block{padding:0 15px}#tc-container #thecheckout-html-box-1,#tc-container-mobile #thecheckout-html-box-1{display:none !important}#tc-container #select-widget,#tc-container-mobile #select-widget{width:100% !important}#tc-container .delivery-options .row.delivery-option,#tc-container-mobile .delivery-options .row.delivery-option{flex-wrap:wrap !important}#tc-container .delivery-option-detail *,#tc-container .payment-option *,#tc-container-mobile .delivery-option-detail *,#tc-container-mobile .payment-option *{font-size:14px !important}.top-bar{background:#ff0f1c;color:#fff !important;display:flex;gap:10px;justify-content:center;width:100%}.top-bar .text-container{width:100%;display:flex;gap:10px;justify-content:center}.top-bar div.text{text-align:center;width:-moz-fit-content;width:fit-content;font-size:14px}#checkout .card{background:#fff !important}#tc-container{margin-top:25px}#tc-container .checkout-area-2{margin-bottom:10px}#tc-container .blocks{border:1px solid #eee;padding:15px}#tc-container .checkout-area-4{gap:10px;margin-bottom:10px}#tc-container .checkout-area-9{margin-bottom:10px;gap:10px}#tc-container .checkout-block #main .block-header{padding:0 !important}#tc-container .checkout-block #main .cart-grid{margin:0 !important}#tc-container .checkout-block #main .cart-grid .card{padding:0 !important}#tc-container .checkout-block #main .cart-grid .cart-detailed-totals{background:#fff !important}#tc-container .checkout-block #main .cart-grid .promo-highlighted{margin-top:15px;padding-top:15px;border-top:1px solid #d3d3d3}@media(max-width: 825px){#tc-container .blocks{display:none !important}}#tc-container-mobile .custom-checkbox,#tc-container .custom-checkbox{margin-bottom:10px !important}#tc-container-mobile .block-header.account-header,#tc-container-mobile .block-header.address-name-header,#tc-container-mobile .block-header.shipping-method-header,#tc-container-mobile .block-header.payment-method-header,#tc-container .block-header.account-header,#tc-container .block-header.address-name-header,#tc-container .block-header.shipping-method-header,#tc-container .block-header.payment-method-header{padding:0 !important;margin-bottom:10px}#tc-container-mobile .block-header.account-header::before,#tc-container-mobile .block-header.address-name-header::before,#tc-container-mobile .block-header.shipping-method-header::before,#tc-container-mobile .block-header.payment-method-header::before,#tc-container .block-header.account-header::before,#tc-container .block-header.address-name-header::before,#tc-container .block-header.shipping-method-header::before,#tc-container .block-header.payment-method-header::before{background:#ff0f1c !important;color:#fff !important;border:0 !important}#tc-container-mobile input[type=text],#tc-container-mobile input[type=email],#tc-container-mobile input[type=password],#tc-container-mobile input[type=tel],#tc-container-mobile textarea,#tc-container-mobile select,#tc-container input[type=text],#tc-container input[type=email],#tc-container input[type=password],#tc-container input[type=tel],#tc-container textarea,#tc-container select{border:1px solid #d3d3d3;border-radius:4px;padding:10px;height:40px;line-height:20px;font-size:14px;width:100%;color:#000}#tc-container-mobile input[type=text]::-moz-placeholder, #tc-container-mobile input[type=email]::-moz-placeholder, #tc-container-mobile input[type=password]::-moz-placeholder, #tc-container-mobile input[type=tel]::-moz-placeholder, #tc-container-mobile textarea::-moz-placeholder, #tc-container-mobile select::-moz-placeholder, #tc-container input[type=text]::-moz-placeholder, #tc-container input[type=email]::-moz-placeholder, #tc-container input[type=password]::-moz-placeholder, #tc-container input[type=tel]::-moz-placeholder, #tc-container textarea::-moz-placeholder, #tc-container select::-moz-placeholder{color:#999 !important;visibility:visible !important;opacity:1 !important}#tc-container-mobile input[type=text]::placeholder,#tc-container-mobile input[type=email]::placeholder,#tc-container-mobile input[type=password]::placeholder,#tc-container-mobile input[type=tel]::placeholder,#tc-container-mobile textarea::placeholder,#tc-container-mobile select::placeholder,#tc-container input[type=text]::placeholder,#tc-container input[type=email]::placeholder,#tc-container input[type=password]::placeholder,#tc-container input[type=tel]::placeholder,#tc-container textarea::placeholder,#tc-container select::placeholder{color:#999 !important;visibility:visible !important;opacity:1 !important}#tc-container-mobile input[type=text]:focus,#tc-container-mobile input[type=email]:focus,#tc-container-mobile input[type=password]:focus,#tc-container-mobile input[type=tel]:focus,#tc-container-mobile textarea:focus,#tc-container-mobile select:focus,#tc-container input[type=text]:focus,#tc-container input[type=email]:focus,#tc-container input[type=password]:focus,#tc-container input[type=tel]:focus,#tc-container textarea:focus,#tc-container select:focus{border-color:#7c7c7c !important}#tc-container-mobile .cart-line-product-quantity,#tc-container .cart-line-product-quantity{width:60px !important}#tc-container-mobile .suggestion:hover,#tc-container-mobile .selected,#tc-container .suggestion:hover,#tc-container .selected{background:#fff !important}#tc-container-mobile .remaining-amount-to-free-shipping-container,#tc-container .remaining-amount-to-free-shipping-container{margin-bottom:10px}#tc-container-mobile a.cart-line-product-quantity-up,#tc-container-mobile a.cart-line-product-quantity-down,#tc-container a.cart-line-product-quantity-up,#tc-container a.cart-line-product-quantity-down{height:40px !important;width:35px !important;border:1px solid #d3d3d3 !important;margin-left:3px;margin-right:3px;background-size:30% !important}#tc-container-mobile .delivery-options-list.shipping-selected #select-widget,#tc-container .delivery-options-list.shipping-selected #select-widget{border:0 !important}#tc-container-mobile .block-promo .promo-input-button .promo-input+button,#tc-container .block-promo .promo-input-button .promo-input+button{flex-basis:auto}#tc-container-mobile #thecheckout-newsletter,#tc-container #thecheckout-newsletter{display:none !important}#tc-container-mobile .custom-checkbox input[type=checkbox]:checked+span .checkbox-checked,#tc-container .custom-checkbox input[type=checkbox]:checked+span .checkbox-checked{color:#ff0f1c;font-size:20px}body.compact-cart #tc-container .qty-container .qty-box{transform:none !important;margin-bottom:5px}#tc-container-mobile .checkout-block{padding:0 !important}#tc-container-mobile .card.cart-container{padding:0 !important}#tc-container-mobile .product-line-actions{padding-top:0 !important}#tc-container-mobile .product-line-price{display:none !important}#tc-container-mobile .cart-detailed-totals{background:#fff !important}#tc-container-mobile .card.cart-summary{padding:0 !important;background:#fff !important}#tc-container-mobile .delivery-options-list.shipping-selected #select-widget{padding-left:10px;background-image:none !important}#tc-container-mobile #promo-code .promo-input-button{display:grid !important;grid-template-columns:1fr !important;height:-moz-fit-content !important;height:fit-content !important}#tc-container-mobile .promo-code form{width:100% !important}body.compact-cart #tc-container .product-line-actions{flex-basis:auto}.product-line-delete .remove-from-cart{display:flex !important;height:40px;width:35px;justify-content:center;align-items:center;border:1px solid #d3d3d3}@media(max-width: 767px){.product-line-qty,.product-line-price,.product-line-delete{padding:0 !important}.product-line-body{padding-left:5px !important}}.amenu-item .amenu-link{padding:20px}@media(min-width: 767px){.btn-search-open{display:none !important}.header-top{display:flex;flex-wrap:wrap;justify-content:center;padding:0 15px;max-width:1920px;margin:auto}.header-top .navigation{width:100%}.header-top .navigation .container{width:100%;max-width:100%}.header-top .navigation .container .anav-top{width:100%}.header-top #_desktop_logo{width:300px;padding:10px}.header-top #_desktop_logo a{display:block}.header-top #_desktop_logo a .logo{max-height:unset !important;width:100% !important;height:auto;max-width:300px !important}.header-top #_desktop_search_widget{width:calc(100% - 300px);display:flex;align-items:center}.header-top #_desktop_search_widget #search_widget{position:static;width:100%}.header-top #_desktop_search_widget #search_widget form{position:static;display:flex;justify-content:flex-end;width:100%}.header-top #_desktop_search_widget #search_widget form input[name=s]{width:100%;max-width:600px}.header-top #_desktop_search_widget #search_widget form button{position:static;background:#ff0f1c;display:flex;width:48px;width:48px;align-items:center;justify-content:center}.header-top #_desktop_search_widget #search_widget form button i{color:#fff !important}}.an_homeproducts-products .products.owl-carousel .owl-dots{display:none !important}.an_homeproducts-products .products.owl-carousel .owl-nav{display:flex;align-items:center;justify-content:space-between;margin-top:0;top:-35px;position:absolute;width:100%}.an_homeproducts-products .products.owl-carousel .owl-nav>div{background:none;border-radius:0;border:1px solid #c8c8c8;height:35px;width:35px}.js-an_homeproducts-block{margin-bottom:25px !important}body#product .featured-products>h2{display:none !important}.form-control.alert{border:1px solid #c00 !important}.box_clothes_size a{text-align:center;font-weight:600;line-height:1.25;display:block;color:#000;font-size:16px;text-decoration:underline}#banner-img-12{text-align:center}#banner-img-12 img{width:100%;height:auto;max-width:750px}/*# sourceMappingURL=custom.css.map */ \ No newline at end of file diff --git a/themes/charme/assets/css/custom.css.map b/themes/charme/assets/css/custom.css.map index 5b8c3c9a..9a9064e8 100644 --- a/themes/charme/assets/css/custom.css.map +++ b/themes/charme/assets/css/custom.css.map @@ -1 +1 @@ -{"version":3,"sources":["custom.scss"],"names":[],"mappings":"AAAA,WACC,iBAAA,CAEA,2BACC,iBAAA,CACA,OAAA,CAMD,+CACC,0BAAA,CAGD,2DACC,eAAA,CACA,iBAAA,CAIA,2FACC,cAAA,CACA,aAAA,CAIF,6DACC,cAAA,CAGD,mEACC,cAAA,CAGD,mFACC,uBAAA,CAGD,iEACC,qBAAA,CAGD,iHACC,yBAAA,CAKA,8JACC,yBAAA,CAKH,SACC,kBAAA,CACA,qBAAA,CACA,YAAA,CACA,QAAA,CACA,sBAAA,CACA,UAAA,CAEA,yBACC,UAAA,CACA,YAAA,CACA,QAAA,CACA,sBAAA,CAGD,kBACC,iBAAA,CACA,sBAAA,CAAA,iBAAA,CACA,cAAA,CAIF,gBACC,0BAAA,CAGD,cACC,eAAA,CAEA,+BACC,kBAAA,CAGD,sBACC,qBAAA,CACA,YAAA,CAGD,+BACC,QAAA,CACA,kBAAA,CAGD,+BACC,kBAAA,CACA,QAAA,CAKC,kDACC,oBAAA,CAGD,+CACC,mBAAA,CAEA,qDACC,oBAAA,CAGD,qEACC,0BAAA,CAGD,kEACC,eAAA,CACA,gBAAA,CACA,4BAAA,CAMJ,yBACC,sBACC,uBAAA,CAAA,CAOF,qEACC,6BAAA,CAGD,4ZAIC,oBAAA,CACA,kBAAA,CAEA,4dACC,6BAAA,CACA,qBAAA,CACA,mBAAA,CAIF,kYAMC,wBAAA,CACA,iBAAA,CACA,YAAA,CACA,WAAA,CACA,gBAAA,CACA,cAAA,CACA,UAAA,CACA,UAAA,CAEA,qmBACC,qBAAA,CACA,6BAAA,CACA,oBAAA,CAHD,8hBACC,qBAAA,CACA,6BAAA,CACA,oBAAA,CAGD,0cACC,+BAAA,CAIF,2FACC,qBAAA,CAGD,8HAEC,0BAAA,CAGD,6HACC,kBAAA,CAGD,0MAEC,sBAAA,CACA,qBAAA,CACA,mCAAA,CACA,eAAA,CACA,gBAAA,CACA,8BAAA,CAIA,mJACC,mBAAA,CAIF,6IACC,eAAA,CAGD,mFACC,uBAAA,CAGD,6KACC,aAAA,CACA,cAAA,CAIF,wDACC,yBAAA,CACA,iBAAA,CAIA,qCACC,oBAAA,CAGD,0CACC,oBAAA,CAGD,2CACC,wBAAA,CAGD,yCACC,uBAAA,CAGD,2CACC,0BAAA,CAGD,wCACC,oBAAA,CACA,0BAAA,CAIA,6EACC,iBAAA,CACA,gCAAA,CAKD,qDACC,uBAAA,CACA,oCAAA,CACA,kCAAA,CAAA,6BAAA,CAKD,sCACC,qBAAA,CAKH,sDACC,eAAA,CAIA,uCACC,uBAAA,CACA,WAAA,CACA,UAAA,CACA,sBAAA,CACA,kBAAA,CACA,wBAAA,CAIF,yBACC,2DAGC,oBAAA,CAGD,mBACC,2BAAA,CAAA,CAIF,wBACC,YAAA,CAGD,yBACC,iBACC,uBAAA,CAGD,YACC,YAAA,CACA,cAAA,CACA,sBAAA,CACA,cAAA,CACA,gBAAA,CACA,WAAA,CAEA,wBACC,UAAA,CAEA,mCACC,UAAA,CACA,cAAA,CAEA,6CACC,UAAA,CAKH,2BACC,WAAA,CACA,YAAA,CAEA,6BACC,aAAA,CAEA,mCACC,2BAAA,CACA,qBAAA,CACA,WAAA,CACA,0BAAA,CAKH,oCACC,wBAAA,CACA,YAAA,CACA,kBAAA,CAEA,mDACC,eAAA,CACA,UAAA,CAEA,wDACC,eAAA,CACA,YAAA,CACA,wBAAA,CACA,UAAA,CAEA,sEACC,UAAA,CACA,eAAA,CAGD,+DACC,eAAA,CACA,kBAAA,CACA,YAAA,CACA,UAAA,CACA,UAAA,CACA,kBAAA,CACA,sBAAA,CAEA,iEACC,qBAAA,CAAA,CAWL,2DACC,uBAAA,CAGD,0DACC,YAAA,CACA,kBAAA,CACA,6BAAA,CACA,YAAA,CACA,SAAA,CACA,iBAAA,CACA,UAAA,CAEA,8DACC,eAAA,CACA,eAAA,CACA,wBAAA,CACA,WAAA,CACA,UAAA,CAMJ,0BACC,6BAAA,CAKC,mCACC,uBAAA,CAKH,oBACC,gCAAA,CAGD,oBACC,iBAAA,CACA,eAAA,CACA,gBAAA,CACA,aAAA,CACA,UAAA,CACA,cAAA,CACA,yBAAA","file":"custom.css"} \ No newline at end of file +{"version":3,"sources":["custom.scss"],"names":[],"mappings":"AAAA,WACE,iBAAA,CAEA,2BACE,iBAAA,CACA,OAAA,CAMF,+CACE,0BAAA,CAGF,2DACE,eAAA,CACA,iBAAA,CAIA,2FACE,cAAA,CACA,aAAA,CAIJ,6DACE,cAAA,CAGF,mEACE,cAAA,CAGF,mFACE,uBAAA,CAGF,iEACE,qBAAA,CAGF,iHACE,yBAAA,CAKA,8JACE,yBAAA,CAKN,SACE,kBAAA,CACA,qBAAA,CACA,YAAA,CACA,QAAA,CACA,sBAAA,CACA,UAAA,CAEA,yBACE,UAAA,CACA,YAAA,CACA,QAAA,CACA,sBAAA,CAGF,kBACE,iBAAA,CACA,sBAAA,CAAA,iBAAA,CACA,cAAA,CAIJ,gBACE,0BAAA,CAGF,cACE,eAAA,CAEA,+BACE,kBAAA,CAGF,sBACE,qBAAA,CACA,YAAA,CAGF,+BACE,QAAA,CACA,kBAAA,CAGF,+BACE,kBAAA,CACA,QAAA,CAKE,kDACE,oBAAA,CAGF,+CACE,mBAAA,CAEA,qDACE,oBAAA,CAGF,qEACE,0BAAA,CAGF,kEACE,eAAA,CACA,gBAAA,CACA,4BAAA,CAMR,yBACE,sBACE,uBAAA,CAAA,CAOJ,qEACE,6BAAA,CAGF,4ZAIE,oBAAA,CACA,kBAAA,CAEA,4dACE,6BAAA,CACA,qBAAA,CACA,mBAAA,CAIJ,kYAME,wBAAA,CACA,iBAAA,CACA,YAAA,CACA,WAAA,CACA,gBAAA,CACA,cAAA,CACA,UAAA,CACA,UAAA,CAEA,qmBACE,qBAAA,CACA,6BAAA,CACA,oBAAA,CAHF,8hBACE,qBAAA,CACA,6BAAA,CACA,oBAAA,CAGF,0cACE,+BAAA,CAIJ,2FACE,qBAAA,CAGF,8HAEE,0BAAA,CAGF,6HACE,kBAAA,CAGF,0MAEE,sBAAA,CACA,qBAAA,CACA,mCAAA,CACA,eAAA,CACA,gBAAA,CACA,8BAAA,CAIA,mJACE,mBAAA,CAIJ,6IACE,eAAA,CAGF,mFACE,uBAAA,CAGF,6KACE,aAAA,CACA,cAAA,CAIJ,wDACE,yBAAA,CACA,iBAAA,CAIA,qCACE,oBAAA,CAGF,0CACE,oBAAA,CAGF,2CACE,wBAAA,CAGF,yCACE,uBAAA,CAGF,2CACE,0BAAA,CAGF,wCACE,oBAAA,CACA,0BAAA,CAIA,6EACE,iBAAA,CACA,gCAAA,CAKF,qDACE,uBAAA,CACA,oCAAA,CACA,kCAAA,CAAA,6BAAA,CAKF,sCACE,qBAAA,CAKN,sDACE,eAAA,CAIA,uCACE,uBAAA,CACA,WAAA,CACA,UAAA,CACA,sBAAA,CACA,kBAAA,CACA,wBAAA,CAIJ,yBAEE,2DAGE,oBAAA,CAGF,mBACE,2BAAA,CAAA,CAIJ,wBACE,YAAA,CAGF,yBACE,iBACE,uBAAA,CAGF,YACE,YAAA,CACA,cAAA,CACA,sBAAA,CACA,cAAA,CACA,gBAAA,CACA,WAAA,CAEA,wBACE,UAAA,CAEA,mCACE,UAAA,CACA,cAAA,CAEA,6CACE,UAAA,CAKN,2BACE,WAAA,CACA,YAAA,CAEA,6BACE,aAAA,CAEA,mCACE,2BAAA,CACA,qBAAA,CACA,WAAA,CACA,0BAAA,CAKN,oCACE,wBAAA,CACA,YAAA,CACA,kBAAA,CAEA,mDACE,eAAA,CACA,UAAA,CAEA,wDACE,eAAA,CACA,YAAA,CACA,wBAAA,CACA,UAAA,CAEA,sEACE,UAAA,CACA,eAAA,CAGF,+DACE,eAAA,CACA,kBAAA,CACA,YAAA,CACA,UAAA,CACA,UAAA,CACA,kBAAA,CACA,sBAAA,CAEA,iEACE,qBAAA,CAAA,CAWV,2DACE,uBAAA,CAGF,0DACE,YAAA,CACA,kBAAA,CACA,6BAAA,CACA,YAAA,CACA,SAAA,CACA,iBAAA,CACA,UAAA,CAEA,8DACE,eAAA,CACA,eAAA,CACA,wBAAA,CACA,WAAA,CACA,UAAA,CAMR,0BACE,6BAAA,CAKE,mCACE,uBAAA,CAKN,oBACE,gCAAA,CAGF,oBACE,iBAAA,CACA,eAAA,CACA,gBAAA,CACA,aAAA,CACA,UAAA,CACA,cAAA,CACA,yBAAA,CAGF,eACE,iBAAA,CAEA,mBACE,UAAA,CACA,WAAA,CACA,eAAA","file":"custom.css","sourcesContent":[".an_banner {\r\n position: relative;\r\n\r\n .an_banner-link {\r\n position: absolute;\r\n inset: 0;\r\n }\r\n}\r\n\r\n#tc-container,\r\n#tc-container-mobile {\r\n .text {\r\n position: static !important;\r\n }\r\n\r\n .form-group {\r\n margin-bottom: 0;\r\n padding-right: 5px;\r\n }\r\n\r\n .custom-checkbox {\r\n span.label {\r\n font-size: 14px;\r\n display: block;\r\n }\r\n }\r\n\r\n .field-label {\r\n font-size: 14px;\r\n }\r\n\r\n .checkout-block {\r\n padding: 0 15px;\r\n }\r\n\r\n #thecheckout-html-box-1 {\r\n display: none !important;\r\n }\r\n\r\n #select-widget {\r\n width: 100% !important;\r\n }\r\n\r\n .delivery-options .row.delivery-option {\r\n flex-wrap: wrap !important;\r\n }\r\n\r\n .delivery-option-detail,\r\n .payment-option {\r\n * {\r\n font-size: 14px !important;\r\n }\r\n }\r\n}\r\n\r\n.top-bar {\r\n background: #ff0f1c;\r\n color: #fff !important;\r\n display: flex;\r\n gap: 10px;\r\n justify-content: center;\r\n width: 100%;\r\n\r\n .text-container {\r\n width: 100%;\r\n display: flex;\r\n gap: 10px;\r\n justify-content: center;\r\n }\r\n\r\n div.text {\r\n text-align: center;\r\n width: fit-content;\r\n font-size: 14px;\r\n }\r\n}\r\n\r\n#checkout .card {\r\n background: #fff !important;\r\n}\r\n\r\n#tc-container {\r\n margin-top: 25px;\r\n\r\n .checkout-area-2 {\r\n margin-bottom: 10px;\r\n }\r\n\r\n .blocks {\r\n border: 1px solid #eee;\r\n padding: 15px;\r\n }\r\n\r\n .checkout-area-4 {\r\n gap: 10px;\r\n margin-bottom: 10px;\r\n }\r\n\r\n .checkout-area-9 {\r\n margin-bottom: 10px;\r\n gap: 10px;\r\n }\r\n\r\n .checkout-block {\r\n #main {\r\n .block-header {\r\n padding: 0 !important;\r\n }\r\n\r\n .cart-grid {\r\n margin: 0 !important;\r\n\r\n .card {\r\n padding: 0 !important;\r\n }\r\n\r\n .cart-detailed-totals {\r\n background: #fff !important;\r\n }\r\n\r\n .promo-highlighted {\r\n margin-top: 15px;\r\n padding-top: 15px;\r\n border-top: 1px solid #d3d3d3;\r\n }\r\n }\r\n }\r\n }\r\n\r\n @media (max-width: 825px) {\r\n .blocks {\r\n display: none !important;\r\n }\r\n }\r\n}\r\n\r\n#tc-container-mobile,\r\n#tc-container {\r\n .custom-checkbox {\r\n margin-bottom: 10px !important;\r\n }\r\n\r\n .block-header.account-header,\r\n .block-header.address-name-header,\r\n .block-header.shipping-method-header,\r\n .block-header.payment-method-header {\r\n padding: 0 !important;\r\n margin-bottom: 10px;\r\n\r\n &::before {\r\n background: #ff0f1c !important;\r\n color: #fff !important;\r\n border: 0 !important;\r\n }\r\n }\r\n\r\n input[type='text'],\r\n input[type='email'],\r\n input[type='password'],\r\n input[type='tel'],\r\n textarea,\r\n select {\r\n border: 1px solid #d3d3d3;\r\n border-radius: 4px;\r\n padding: 10px;\r\n height: 40px;\r\n line-height: 20px;\r\n font-size: 14px;\r\n width: 100%;\r\n color: #000;\r\n\r\n &::placeholder {\r\n color: #999 !important;\r\n visibility: visible !important;\r\n opacity: 1 !important;\r\n }\r\n\r\n &:focus {\r\n border-color: #7c7c7c !important;\r\n }\r\n }\r\n\r\n .cart-line-product-quantity {\r\n width: 60px !important;\r\n }\r\n\r\n .suggestion:hover,\r\n .selected {\r\n background: #fff !important;\r\n }\r\n\r\n .remaining-amount-to-free-shipping-container {\r\n margin-bottom: 10px;\r\n }\r\n\r\n a.cart-line-product-quantity-up,\r\n a.cart-line-product-quantity-down {\r\n height: 40px !important;\r\n width: 35px !important;\r\n border: 1px solid #d3d3d3 !important;\r\n margin-left: 3px;\r\n margin-right: 3px;\r\n background-size: 30% !important;\r\n }\r\n\r\n .delivery-options-list.shipping-selected {\r\n #select-widget {\r\n border: 0 !important;\r\n }\r\n }\r\n\r\n .block-promo .promo-input-button .promo-input+button {\r\n flex-basis: auto;\r\n }\r\n\r\n #thecheckout-newsletter {\r\n display: none !important;\r\n }\r\n\r\n .custom-checkbox input[type='checkbox']:checked+span .checkbox-checked {\r\n color: #ff0f1c;\r\n font-size: 20px;\r\n }\r\n}\r\n\r\nbody.compact-cart #tc-container .qty-container .qty-box {\r\n transform: none !important;\r\n margin-bottom: 5px;\r\n}\r\n\r\n#tc-container-mobile {\r\n .checkout-block {\r\n padding: 0 !important;\r\n }\r\n\r\n .card.cart-container {\r\n padding: 0 !important;\r\n }\r\n\r\n .product-line-actions {\r\n padding-top: 0 !important;\r\n }\r\n\r\n .product-line-price {\r\n display: none !important;\r\n }\r\n\r\n .cart-detailed-totals {\r\n background: #fff !important;\r\n }\r\n\r\n .card.cart-summary {\r\n padding: 0 !important;\r\n background: #fff !important;\r\n }\r\n\r\n .delivery-options-list.shipping-selected {\r\n #select-widget {\r\n padding-left: 10px;\r\n background-image: none !important;\r\n }\r\n }\r\n\r\n #promo-code {\r\n .promo-input-button {\r\n display: grid !important;\r\n grid-template-columns: 1fr !important;\r\n height: fit-content !important;\r\n }\r\n }\r\n\r\n .promo-code {\r\n form {\r\n width: 100% !important;\r\n }\r\n }\r\n}\r\n\r\nbody.compact-cart #tc-container .product-line-actions {\r\n flex-basis: auto;\r\n}\r\n\r\n.product-line-delete {\r\n .remove-from-cart {\r\n display: flex !important;\r\n height: 40px;\r\n width: 35px;\r\n justify-content: center;\r\n align-items: center;\r\n border: 1px solid #d3d3d3;\r\n }\r\n}\r\n\r\n@media (max-width: 767px) {\r\n\r\n .product-line-qty,\r\n .product-line-price,\r\n .product-line-delete {\r\n padding: 0 !important;\r\n }\r\n\r\n .product-line-body {\r\n padding-left: 5px !important;\r\n }\r\n}\r\n\r\n.amenu-item .amenu-link {\r\n padding: 20px;\r\n}\r\n\r\n@media (min-width: 767px) {\r\n .btn-search-open {\r\n display: none !important;\r\n }\r\n\r\n .header-top {\r\n display: flex;\r\n flex-wrap: wrap;\r\n justify-content: center;\r\n padding: 0 15px;\r\n max-width: 1920px;\r\n margin: auto;\r\n\r\n .navigation {\r\n width: 100%;\r\n\r\n .container {\r\n width: 100%;\r\n max-width: 100%;\r\n\r\n .anav-top {\r\n width: 100%;\r\n }\r\n }\r\n }\r\n\r\n #_desktop_logo {\r\n width: 300px;\r\n padding: 10px;\r\n\r\n a {\r\n display: block;\r\n\r\n .logo {\r\n max-height: unset !important;\r\n width: 100% !important;\r\n height: auto;\r\n max-width: 300px !important;\r\n }\r\n }\r\n }\r\n\r\n #_desktop_search_widget {\r\n width: calc(100% - 300px);\r\n display: flex;\r\n align-items: center;\r\n\r\n #search_widget {\r\n position: static;\r\n width: 100%;\r\n\r\n form {\r\n position: static;\r\n display: flex;\r\n justify-content: flex-end;\r\n width: 100%;\r\n\r\n input[name='s'] {\r\n width: 100%;\r\n max-width: 600px;\r\n }\r\n\r\n button {\r\n position: static;\r\n background: #ff0f1c;\r\n display: flex;\r\n width: 48px;\r\n width: 48px;\r\n align-items: center;\r\n justify-content: center;\r\n\r\n i {\r\n color: #fff !important;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n.an_homeproducts-products {\r\n .products.owl-carousel {\r\n .owl-dots {\r\n display: none !important;\r\n }\r\n\r\n .owl-nav {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n margin-top: 0;\r\n top: -35px;\r\n position: absolute;\r\n width: 100%;\r\n\r\n >div {\r\n background: none;\r\n border-radius: 0;\r\n border: 1px solid #c8c8c8;\r\n height: 35px;\r\n width: 35px;\r\n }\r\n }\r\n }\r\n}\r\n\r\n.js-an_homeproducts-block {\r\n margin-bottom: 25px !important;\r\n}\r\n\r\nbody#product {\r\n .featured-products {\r\n >h2 {\r\n display: none !important;\r\n }\r\n }\r\n}\r\n\r\n.form-control.alert {\r\n border: 1px solid #cc0000 !important;\r\n}\r\n\r\n.box_clothes_size a {\r\n text-align: center;\r\n font-weight: 600;\r\n line-height: 1.25;\r\n display: block;\r\n color: #000;\r\n font-size: 16px;\r\n text-decoration: underline;\r\n}\r\n\r\n#banner-img-12 {\r\n text-align: center;\r\n\r\n img {\r\n width: 100%;\r\n height: auto;\r\n max-width: 750px;\r\n }\r\n}"]} \ No newline at end of file diff --git a/themes/charme/assets/css/custom.scss b/themes/charme/assets/css/custom.scss index e5105f81..0612897c 100644 --- a/themes/charme/assets/css/custom.scss +++ b/themes/charme/assets/css/custom.scss @@ -1,441 +1,452 @@ .an_banner { - position: relative; + position: relative; - .an_banner-link { - position: absolute; - inset: 0; - } + .an_banner-link { + position: absolute; + inset: 0; + } } #tc-container, #tc-container-mobile { - .text { - position: static !important; - } + .text { + position: static !important; + } - .form-group { - margin-bottom: 0; - padding-right: 5px; - } + .form-group { + margin-bottom: 0; + padding-right: 5px; + } - .custom-checkbox { - span.label { - font-size: 14px; - display: block; - } - } + .custom-checkbox { + span.label { + font-size: 14px; + display: block; + } + } - .field-label { - font-size: 14px; - } + .field-label { + font-size: 14px; + } - .checkout-block { - padding: 0 15px; - } + .checkout-block { + padding: 0 15px; + } - #thecheckout-html-box-1 { - display: none !important; - } + #thecheckout-html-box-1 { + display: none !important; + } - #select-widget { - width: 100% !important; - } + #select-widget { + width: 100% !important; + } - .delivery-options .row.delivery-option { - flex-wrap: wrap !important; - } + .delivery-options .row.delivery-option { + flex-wrap: wrap !important; + } - .delivery-option-detail, - .payment-option { - * { - font-size: 14px !important; - } - } + .delivery-option-detail, + .payment-option { + * { + font-size: 14px !important; + } + } } .top-bar { - background: #ff0f1c; - color: #fff !important; - display: flex; - gap: 10px; - justify-content: center; - width: 100%; + background: #ff0f1c; + color: #fff !important; + display: flex; + gap: 10px; + justify-content: center; + width: 100%; - .text-container { - width: 100%; - display: flex; - gap: 10px; - justify-content: center; - } + .text-container { + width: 100%; + display: flex; + gap: 10px; + justify-content: center; + } - div.text { - text-align: center; - width: fit-content; - font-size: 14px; - } + div.text { + text-align: center; + width: fit-content; + font-size: 14px; + } } #checkout .card { - background: #fff !important; + background: #fff !important; } #tc-container { - margin-top: 25px; + margin-top: 25px; - .checkout-area-2 { - margin-bottom: 10px; - } + .checkout-area-2 { + margin-bottom: 10px; + } - .blocks { - border: 1px solid #eee; - padding: 15px; - } + .blocks { + border: 1px solid #eee; + padding: 15px; + } - .checkout-area-4 { - gap: 10px; - margin-bottom: 10px; - } + .checkout-area-4 { + gap: 10px; + margin-bottom: 10px; + } - .checkout-area-9 { - margin-bottom: 10px; - gap: 10px; - } + .checkout-area-9 { + margin-bottom: 10px; + gap: 10px; + } - .checkout-block { - #main { - .block-header { - padding: 0 !important; - } + .checkout-block { + #main { + .block-header { + padding: 0 !important; + } - .cart-grid { - margin: 0 !important; + .cart-grid { + margin: 0 !important; - .card { - padding: 0 !important; - } + .card { + padding: 0 !important; + } - .cart-detailed-totals { - background: #fff !important; - } + .cart-detailed-totals { + background: #fff !important; + } - .promo-highlighted { - margin-top: 15px; - padding-top: 15px; - border-top: 1px solid #d3d3d3; - } - } - } - } + .promo-highlighted { + margin-top: 15px; + padding-top: 15px; + border-top: 1px solid #d3d3d3; + } + } + } + } - @media (max-width: 825px) { - .blocks { - display: none !important; - } - } + @media (max-width: 825px) { + .blocks { + display: none !important; + } + } } #tc-container-mobile, #tc-container { - .custom-checkbox { - margin-bottom: 10px !important; - } + .custom-checkbox { + margin-bottom: 10px !important; + } - .block-header.account-header, - .block-header.address-name-header, - .block-header.shipping-method-header, - .block-header.payment-method-header { - padding: 0 !important; - margin-bottom: 10px; + .block-header.account-header, + .block-header.address-name-header, + .block-header.shipping-method-header, + .block-header.payment-method-header { + padding: 0 !important; + margin-bottom: 10px; - &::before { - background: #ff0f1c !important; - color: #fff !important; - border: 0 !important; - } - } + &::before { + background: #ff0f1c !important; + color: #fff !important; + border: 0 !important; + } + } - input[type='text'], - input[type='email'], - input[type='password'], - input[type='tel'], - textarea, - select { - border: 1px solid #d3d3d3; - border-radius: 4px; - padding: 10px; - height: 40px; - line-height: 20px; - font-size: 14px; - width: 100%; - color: #000; + input[type='text'], + input[type='email'], + input[type='password'], + input[type='tel'], + textarea, + select { + border: 1px solid #d3d3d3; + border-radius: 4px; + padding: 10px; + height: 40px; + line-height: 20px; + font-size: 14px; + width: 100%; + color: #000; - &::placeholder { - color: #999 !important; - visibility: visible !important; - opacity: 1 !important; - } + &::placeholder { + color: #999 !important; + visibility: visible !important; + opacity: 1 !important; + } - &:focus { - border-color: #7c7c7c !important; - } - } + &:focus { + border-color: #7c7c7c !important; + } + } - .cart-line-product-quantity { - width: 60px !important; - } + .cart-line-product-quantity { + width: 60px !important; + } - .suggestion:hover, - .selected { - background: #fff !important; - } + .suggestion:hover, + .selected { + background: #fff !important; + } - .remaining-amount-to-free-shipping-container { - margin-bottom: 10px; - } + .remaining-amount-to-free-shipping-container { + margin-bottom: 10px; + } - a.cart-line-product-quantity-up, - a.cart-line-product-quantity-down { - height: 40px !important; - width: 35px !important; - border: 1px solid #d3d3d3 !important; - margin-left: 3px; - margin-right: 3px; - background-size: 30% !important; - } + a.cart-line-product-quantity-up, + a.cart-line-product-quantity-down { + height: 40px !important; + width: 35px !important; + border: 1px solid #d3d3d3 !important; + margin-left: 3px; + margin-right: 3px; + background-size: 30% !important; + } - .delivery-options-list.shipping-selected { - #select-widget { - border: 0 !important; - } - } + .delivery-options-list.shipping-selected { + #select-widget { + border: 0 !important; + } + } - .block-promo .promo-input-button .promo-input + button { - flex-basis: auto; - } + .block-promo .promo-input-button .promo-input+button { + flex-basis: auto; + } - #thecheckout-newsletter { - display: none !important; - } + #thecheckout-newsletter { + display: none !important; + } - .custom-checkbox input[type='checkbox']:checked + span .checkbox-checked { - color: #ff0f1c; - font-size: 20px; - } + .custom-checkbox input[type='checkbox']:checked+span .checkbox-checked { + color: #ff0f1c; + font-size: 20px; + } } body.compact-cart #tc-container .qty-container .qty-box { - transform: none !important; - margin-bottom: 5px; + transform: none !important; + margin-bottom: 5px; } #tc-container-mobile { - .checkout-block { - padding: 0 !important; - } + .checkout-block { + padding: 0 !important; + } - .card.cart-container { - padding: 0 !important; - } + .card.cart-container { + padding: 0 !important; + } - .product-line-actions { - padding-top: 0 !important; - } + .product-line-actions { + padding-top: 0 !important; + } - .product-line-price { - display: none !important; - } + .product-line-price { + display: none !important; + } - .cart-detailed-totals { - background: #fff !important; - } + .cart-detailed-totals { + background: #fff !important; + } - .card.cart-summary { - padding: 0 !important; - background: #fff !important; - } + .card.cart-summary { + padding: 0 !important; + background: #fff !important; + } - .delivery-options-list.shipping-selected { - #select-widget { - padding-left: 10px; - background-image: none !important; - } - } + .delivery-options-list.shipping-selected { + #select-widget { + padding-left: 10px; + background-image: none !important; + } + } - #promo-code { - .promo-input-button { - display: grid !important; - grid-template-columns: 1fr !important; - height: fit-content !important; - } - } + #promo-code { + .promo-input-button { + display: grid !important; + grid-template-columns: 1fr !important; + height: fit-content !important; + } + } - .promo-code { - form { - width: 100% !important; - } - } + .promo-code { + form { + width: 100% !important; + } + } } body.compact-cart #tc-container .product-line-actions { - flex-basis: auto; + flex-basis: auto; } .product-line-delete { - .remove-from-cart { - display: flex !important; - height: 40px; - width: 35px; - justify-content: center; - align-items: center; - border: 1px solid #d3d3d3; - } + .remove-from-cart { + display: flex !important; + height: 40px; + width: 35px; + justify-content: center; + align-items: center; + border: 1px solid #d3d3d3; + } } @media (max-width: 767px) { - .product-line-qty, - .product-line-price, - .product-line-delete { - padding: 0 !important; - } - .product-line-body { - padding-left: 5px !important; - } + .product-line-qty, + .product-line-price, + .product-line-delete { + padding: 0 !important; + } + + .product-line-body { + padding-left: 5px !important; + } } .amenu-item .amenu-link { - padding: 20px; + padding: 20px; } @media (min-width: 767px) { - .btn-search-open { - display: none !important; - } + .btn-search-open { + display: none !important; + } - .header-top { - display: flex; - flex-wrap: wrap; - justify-content: center; - padding: 0 15px; - max-width: 1920px; - margin: auto; + .header-top { + display: flex; + flex-wrap: wrap; + justify-content: center; + padding: 0 15px; + max-width: 1920px; + margin: auto; - .navigation { - width: 100%; + .navigation { + width: 100%; - .container { - width: 100%; - max-width: 100%; + .container { + width: 100%; + max-width: 100%; - .anav-top { - width: 100%; - } - } - } + .anav-top { + width: 100%; + } + } + } - #_desktop_logo { - width: 300px; - padding: 10px; + #_desktop_logo { + width: 300px; + padding: 10px; - a { - display: block; + a { + display: block; - .logo { - max-height: unset !important; - width: 100% !important; - height: auto; - max-width: 300px !important; - } - } - } + .logo { + max-height: unset !important; + width: 100% !important; + height: auto; + max-width: 300px !important; + } + } + } - #_desktop_search_widget { - width: calc(100% - 300px); - display: flex; - align-items: center; + #_desktop_search_widget { + width: calc(100% - 300px); + display: flex; + align-items: center; - #search_widget { - position: static; - width: 100%; + #search_widget { + position: static; + width: 100%; - form { - position: static; - display: flex; - justify-content: flex-end; - width: 100%; + form { + position: static; + display: flex; + justify-content: flex-end; + width: 100%; - input[name='s'] { - width: 100%; - max-width: 600px; - } + input[name='s'] { + width: 100%; + max-width: 600px; + } - button { - position: static; - background: #ff0f1c; - display: flex; - width: 48px; - width: 48px; - align-items: center; - justify-content: center; + button { + position: static; + background: #ff0f1c; + display: flex; + width: 48px; + width: 48px; + align-items: center; + justify-content: center; - i { - color: #fff !important; - } - } - } - } - } - } + i { + color: #fff !important; + } + } + } + } + } + } } .an_homeproducts-products { - .products.owl-carousel { - .owl-dots { - display: none !important; - } + .products.owl-carousel { + .owl-dots { + display: none !important; + } - .owl-nav { - display: flex; - align-items: center; - justify-content: space-between; - margin-top: 0; - top: -35px; - position: absolute; - width: 100%; + .owl-nav { + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 0; + top: -35px; + position: absolute; + width: 100%; - > div { - background: none; - border-radius: 0; - border: 1px solid #c8c8c8; - height: 35px; - width: 35px; - } - } - } + >div { + background: none; + border-radius: 0; + border: 1px solid #c8c8c8; + height: 35px; + width: 35px; + } + } + } } .js-an_homeproducts-block { - margin-bottom: 25px !important; + margin-bottom: 25px !important; } body#product { - .featured-products { - > h2 { - display: none !important; - } - } + .featured-products { + >h2 { + display: none !important; + } + } } .form-control.alert { - border: 1px solid #cc0000 !important; + border: 1px solid #cc0000 !important; } .box_clothes_size a { - text-align: center; - font-weight: 600; - line-height: 1.25; - display: block; - color: #000; - font-size: 16px; - text-decoration: underline; + text-align: center; + font-weight: 600; + line-height: 1.25; + display: block; + color: #000; + font-size: 16px; + text-decoration: underline; } + +#banner-img-12 { + text-align: center; + + img { + width: 100%; + height: auto; + max-width: 750px; + } +} \ No newline at end of file diff --git a/themes/charme/modules/an_banners/banners/default.tpl b/themes/charme/modules/an_banners/banners/default.tpl index c9895fd2..dab20d34 100644 --- a/themes/charme/modules/an_banners/banners/default.tpl +++ b/themes/charme/modules/an_banners/banners/default.tpl @@ -17,7 +17,7 @@ {/if}
{if $banner.imgUrlFile !=''} -
+ -
\ No newline at end of file + diff --git a/themes/charme/templates/_partials/head.tpl b/themes/charme/templates/_partials/head.tpl index 878624eb..12668d2e 100644 --- a/themes/charme/templates/_partials/head.tpl +++ b/themes/charme/templates/_partials/head.tpl @@ -57,7 +57,8 @@ {block name='stylesheets'} {include file="_partials/stylesheets.tpl" stylesheets=$stylesheets} {/block} - +{assign var=custom_css_file value=$smarty.const._PS_THEME_DIR_|cat:'assets/css/custom.css'} + {block name='javascript_head'} {include file="_partials/javascript.tpl" javascript=$javascript.head vars=$js_custom_vars} @@ -86,4 +87,4 @@ })(); -{/literal} \ No newline at end of file +{/literal}