Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Gann

Users
  
  • Posts

    687
  • Joined

  • Last visited

Everything posted by Gann

  1. Так уже все способы рассказал. Никаких секретов. На счёт кнопки читать далее - лучше такое не использовать.
  2. Добрый день! При экспорте-импорте в поле описания товара происходит повторное дублирование описания. Повторяется описание несколько раз. Кто-нибудь сталкивался с такой проблемой?
  3. Добрый! Модуль https://opencartforum.com/files/file/3602-citymanager-pro-gruppy-pokupateley-raznye-ceny-dlya-gorodov/ В нём - геосообщения
  4. Здравствуйте! Подскажите, как получить ID modal в контроллере, чтобы вывести его в tpl? Ответ: решил. Нужно добавить: $this->load->model('catalog/multimodal'); $getModals = $this->model_catalog_multimodal->getModals(); $data['modals'] = array(); foreach($getModals as $idModal => $modal){ $data['modals'][$modal['type']][$idModal] = array( 'title' => $modal['title'], 'content' => html_entity_decode($modal['content'], ENT_QUOTES, 'UTF-8'), 'show_modal' => $modal['show_modal'], 'selector' => htmlspecialchars_decode($modal['selector']), 'link' => $modal['link'], 'timeout' => $modal['timeout'], 'tries_time' => $modal['tries_time'] ); }
  5. Здравствуйте! Хочу сделать отправку вложений без загрузки этих вложений на сервер. <div class="styleimputs fileform"> <div class="selectbutton">Обзор</div> <input type="file" class="filesflbank" name="files[]" accept="image/jpeg,image/png,application/pdf" multiple /> </div> <script> $(document).ready(function() { if (window.File && window.FileList && window.FileReader) { $(".filesflbank").on("change", function(e) { var files = e.target.files, filesLength = files.length; for (var i = 0; i < filesLength; i++) { var f = files[i]; var fileReader = new FileReader(); fileReader.onload = (function(e) { var file = e.target; var extensions = 'data:application/pdf'; var ext = e.target.result.split("data:application/pdf").shift(); if(extensions.indexOf(ext) !== -1){ var src = '/images/default.png'; $("<a class=\"imageThumb\" href=\"" + e.target.result + "\"><span class=\"pip\">" + "<img src=\"" + src + "\"/></a>" + "<br/><span class=\"remove\">Удалить</span>" + "</span>").insertAfter(".filesflbank"); $(".remove").click(function(){ $(this).parent(".pip").remove(); }); }else{ $("<span class=\"pip\">" + "<img class=\"imageThumb\" src=\"" + e.target.result + "\"/>" + "<br/><span class=\"remove\">Удалить</span>" + "</span>").insertAfter(".filesflbank"); $(".remove").click(function(){ $(this).parent(".pip").remove(); }); } }); fileReader.readAsDataURL(f); } }); } else { alert("Ваш браузер не поддерживает загрузку файлов") } }); </script> данный код позволяет выбрать нужные для отправки файлы и выводит их превью. Переменная var filesflbank = $('.imageThumb:eq(0)').attr('href'); (если это пдф файл) передаётся в обработчик через Ajax в обработчике if(isset($_POST['filesflbank'])) { $filesflbank = substr($_POST['filesflbank'], strlen('data:application/pdf;base64,')); $attachment = chunk_split($filesflbank); } затем через mail() отправляется на почту. Письмо приходит с вложением, но это вложение в пдф не открывается. Подскажите, как правильно обработать data:application/pdf;base64,jhgjhgjhgjg..... и отправить его корректным вложением?
  6. да, есть решение. оборачиваем в div, вот так: <div class="table-responsive"> <table class="table table-bordered table-striped table-hover"> ..... </table> </div> .table-responsive и другие классы - это стили из CSS Bootstrap 3, который в OP2+ есть
  7. Доброго! Самый лучший модуль для SEO - это голова+руки. Лучшего и не найти. В остальном, в опенкарте есть всё для всего остального. Серьёзно. п.с. по теме ещё - может google_sitemap переработанный, с добавленным lastmod
  8. Здравствуйте! Приходит пустое сообщение. Кто-нибудь сталкивался с таким? По-идее: должно приходить имя, почта, телефон. А приходит пустое. Проверял вручную - всё ок. Это спам-боты делают, наверное.
  9. Приветствую! Хочу купить модуль. Такой вопрос: можно обойтись без регистрации в СДЭК? как физлицо работать, считать стоимость доставки + добавка.
  10. В общем, получилась такая конструкция (суть): <?php if(($as==1 OR $ad==1 OR $af==1 OR $ag==1) && $ah != 1){ ?> <img src="/картинка"> <?php } ?> Работает! Всем спасибо!
  11. Спасибо! Хм.. я так же костылил - не работало. Может где-то ошибся... проверю ещё раз.
  12. Вот такое условие работает: <?php if ($attribute['text'] == 'Значение1') { ?> <img src="/картинка"> <?php } ?> и такое (или то, или это) <?php if ($attribute['text'] == 'Значение1' OR $attribute['text'] == 'Значение2') { ?> <img src="/картинка"> <?php } ?> Как же прописать условие, чтобы для "Значение1" - картинка выводилась, а если есть "Значение1" и "Значение2" - не выводилась?
  13. Приветствую! Необходимо вывести определённую картинку, если есть значение атрибута "Значение1" и нет значение атрибута "Значение2". Пробую вывести так: <?php if ($attribute['text'] == 'Значение 1'){ ?> <?php if($attribute['text'] == 'Значение 2') { ?> <?php } else { ?> <img src="/картинка"> <?php } ?> <?php } ?> Пробовал через in_array - не работает Пробовал через key_exist - не работает Операторы && (and), да много как уже попробовал - не работает. Все эти условия пишу в product.tpl. Вывод стандартный: <?php if ($attribute_groups) { ?> <?php foreach ($attribute_groups as $attribute_group) { ?> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> ... ... ...
  14. Привет! Подскажите, пожалуйста, как реализовать идею: вывести все товары с определённой опцией? У товаров задаём опции в виде картинки. При клике на картинку - переходим на страницу со всеми товарами, у которых есть данная опция, из всех категорий. Через фильтр не получится. Фильтр уже используется в подкатегориях.
  15. пока вы делаете изменения в CSS, можно прибегнуть к такому решению: <link href="catalog/view/theme/default/stylesheet/stylesheet.css?<?php echo time();?>" rel="stylesheet"> т.е. добавить к ссылке на css ?<?php echo time();?> Потом удалите, как правки закончатся. И вручную допишите какую нибудь версию, как выше порекомендовали. Чтобы те, кто давно не заходил - увидели так, как надо.
  16. Приветствую! Подскажите, пожалуйста, как в контроллере категории (newsblog) подключить $data['products']? Это нужно чтобы вывести шорткоды в категории. <file path="catalog/controller/newsblog/category.php"> <operation> <search><![CDATA[$data['description']]]></search> <add position="after"><![CDATA[ $data['description'] = $this->shortcodes->do_shortcode($data['description']); ]]></add> </operation> </file> <file path="catalog/controller/newsblog/category.php"> <operation> <search><![CDATA[new Pagination()]]></search> <add position="after"><![CDATA[ $x = count($data['products']); if ($x) { $sc_products = array(); for ($i=0; $i < $x; $i++) { $sc_products[$i] = $data['products'][$i]; $sc_products[$i]['description'] = $this->shortcodes->do_shortcode($data['products'][$i]['description']); } $data['products'] = $sc_products; } ]]></add> </operation> </file>
  17. Приветствую! Необходимо в контроллер, который отвечает за вывод записей, добавить несколько строчек кода. Подскажите, пожалуйста, в каком контроллере осуществлять правки? Его адрес. Их куча целая. И ещё вопрос - как подключить к СЕО ЦМС ТОП2 свою библиотеку?
  18. С первой частью вроде бы разобрался: <file path="index.php"> <operation info="Add Shortcodes to admin $registry"> <search><![CDATA[$registry->set('encryption', new Encryption($config->get('config_encryption')));]]></search> <add position="after"><![CDATA[ $registry->set('shortcodes', new Shortcodes($config->get('config_shortcodes'))); ]]></add> </operation> </file> Дальше дело как то не пошло... п.с. первую часть вероятно руками надо будет прописать
  19. Приветствую! Прошу посильной помощи в адаптации модуля с 2.3 на 2.1. Вот часть кода, которую не могу адаптировать: <file path="admin/controller/startup/startup.php"> <operation info="Add Shortcodes to admin $registry"> <search><![CDATA[$this->registry->set('encryption']]></search> <add position="after"><![CDATA[ // OpenCart Shortcodes $this->registry->set('shortcodes', new Shortcodes($this->registry)); ]]></add> </operation> </file> <file path="catalog/controller/startup/startup.php"> <operation info="Add Shortcodes to front $registry"> <search><![CDATA[$this->registry->set('encryption']]></search> <add position="after"><![CDATA[ // OpenCart Shortcodes $this->registry->set('shortcodes', new Shortcodes($this->registry)); ]]></add> </operation> </file> <file path="catalog/controller/startup/maintenance.php"> <operation> <search><![CDATA[function index()]]></search> <add position="after"><![CDATA[ //========= OpenCart Shortcodes //=== Default shortcodes $this->load->helper('shortcodes_default'); $class = new ShortcodesDefault($this->registry); $scDefaults = get_class_methods($class); foreach ($scDefaults as $shortcode) { $this->shortcodes->add_shortcode($shortcode, $class); } //=== Extensions shortcodes : for extensions developer $files = glob(DIR_APPLICATION . '/view/shortcodes/*.php'); if ($files) { foreach ($files as $file) { require_once($file); $file = basename($file, ".php"); $extClass = 'Shortcodes' . preg_replace('/[^a-zA-Z0-9]/', '', $file); $class = new $extClass($this->registry); $scExtensions = get_class_methods($class); foreach ($scExtensions as $shortcode) { $this->shortcodes->add_shortcode($shortcode, $class); } } } //--------------- OLD theme OpenCart 2 compatible $theme = $this->config->get('config_theme'); if ($this->config->get('config_theme') == 'theme_default') { $theme = $this->config->get('theme_default_directory'); } //=== Themes shortcodes : for theme developer $file = DIR_TEMPLATE . $theme . '/shortcodes_theme.php'; if (file_exists($file)) { require_once($file); $class = new ShortcodesTheme($this->registry); $scThemes = get_class_methods($class); foreach ($scThemes as $shortcode) { $this->shortcodes->add_shortcode($shortcode, $class); } } $this->event->trigger('shortcodes/themes/after', array(&$data)); //=== Custom shortcodes : user power! $file = DIR_TEMPLATE . $theme . '/shortcodes_custom.php'; if (file_exists($file)) { require_once($file); $class = new ShortcodesCustom($this->registry); $scCustom = get_class_methods($class); foreach ($scCustom as $shortcode) { $this->shortcodes->add_shortcode($shortcode, $class); } } //========= End:: OpenCart Shortcodes ]]></add> </operation> </file> В 2.1 нет startup
  20. Может быть есть предположения, почему не сработало при перечислении? Помню, что в 2.1. вроде так работало. Неужели в версии 2.3 по-другому? п.с. эврика! надо так: <file path="catalog/controller/product/{category.php,manufacturer.php,product.php,search.php,special.php}"> п.п.с. головняк на полдня, блин
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.