Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

alferus

Новачок
  
  • Публікації

    21
  • З нами

  • Відвідування

Усі публікації користувача alferus

  1. Интересно, у меня наоборот по умолчанию с включенным ssl открывает только аккаунт, афилейт и оформление по https, остальное через http. Opencart 2.1.0.1 seo url + seo pro. Только для категорий изменяет canonical, пришлось править в ручную.
  2. В смысле удалить из него ссылки на категории вида "domain/category/" ? Нужно в файле /catalog/controller/feed/google_sitemap.php закомментить так: //$output .= '<url>';//$output .= '<loc>' . $this->url->link('product/category', 'path=' . $new_path) . '</loc>'; //$output .= '<changefreq>weekly</changefreq>'; //$output .= '<priority>0.7</priority>'; //$output .= '</url>';
  3. Установил на ocStore 1.5.5.1.2 - работает нормально, микроразметка встала. Жаль только рейтинг без дробей и полузвездочек =\
  4. Прямо в файле /catalog/controller/feed/google_sitemap.php нужно добавлять. Может кому пригодится, готовый доработанный google_sitemap.php для включенного seo_pro с добавленными ссылками на: главную, связаться с нами, страницу новости+ (www.domain.ru/news/) и страницы статей (www.domain.ru/news/blablabla): <?php class ControllerFeedGoogleSitemap extends Controller { public function index() { if ($this->config->get('google_sitemap_status')) { $output = '<?xml version="1.0" encoding="UTF-8"?>'; $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; $output .= '<url>'; $output .= '<loc>' . HTTP_SERVER . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>1.0</priority>'; $output .= '</url>'; $output .= '<url>'; $output .= '<loc>' . HTTP_SERVER . 'news/' . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>0.7</priority>'; $output .= '</url>'; $output .= '<url>'; $output .= '<loc>' . HTTP_SERVER . 'contact-us/' . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>0.5</priority>'; $output .= '</url>'; $this->load->model('catalog/product'); $products = $this->model_catalog_product->getProducts(); foreach ($products as $product) { $output .= '<url>'; $output .= '<loc>' . $this->url->link('product/product', 'product_id=' . $product['product_id']) . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>1.0</priority>'; $output .= '</url>'; } $this->load->model('catalog/category'); $output .= $this->getCategories(0); $this->load->model('catalog/manufacturer'); $manufacturers = $this->model_catalog_manufacturer->getManufacturers(); foreach ($manufacturers as $manufacturer) { $output .= '<url>'; $output .= '<loc>' . $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $manufacturer['manufacturer_id']) . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>0.7</priority>'; $output .= '</url>'; $products = $this->model_catalog_product->getProducts(array('filter_manufacturer_id' => $manufacturer['manufacturer_id'])); //foreach ($products as $product) { // $output .= '<url>'; // $output .= '<loc>' . $this->url->link('product/product', 'manufacturer_id=' . $manufacturer['manufacturer_id'] . '&product_id=' . $product['product_id']) . '</loc>'; // $output .= '<changefreq>weekly</changefreq>'; // $output .= '<priority>1.0</priority>'; // $output .= '</url>'; //} } $this->load->model('catalog/information'); $informations = $this->model_catalog_information->getInformations(); foreach ($informations as $information) { $output .= '<url>'; $output .= '<loc>' . $this->url->link('information/information', 'information_id=' . $information['information_id']) . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>0.5</priority>'; $output .= '</url>'; } $this->load->model('catalog/news'); $news = $this->model_catalog_news->geturlNews(); foreach ($news as $item) { $output .= '<url>'; $output .= '<loc>' . $this->url->link('information/news', 'news_id=' . $item['news_id']) . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>0.7</priority>'; $output .= '</url>'; } $output .= '</urlset>'; $this->response->addHeader('Content-Type: application/xml'); $this->response->setOutput($output); } } protected function getCategories($parent_id, $current_path = '') { $output = ''; $results = $this->model_catalog_category->getCategories($parent_id); foreach ($results as $result) { if (!$current_path) { $new_path = $result['category_id']; } else { $new_path = $current_path . '_' . $result['category_id']; } $output .= '<url>'; $output .= '<loc>' . $this->url->link('product/category', 'path=' . $new_path) . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>0.7</priority>'; $output .= '</url>'; $products = $this->model_catalog_product->getProducts(array('filter_category_id' => $result['category_id'])); // foreach ($products as $product) { // $output .= '<url>'; // $output .= '<loc>' . $this->url->link('product/product', 'path=' . $new_path . '&product_id=' . $product['product_id']) . '</loc>'; // $output .= '<changefreq>weekly</changefreq>'; // $output .= '<priority>1.0</priority>'; // $output .= '</url>'; //} $output .= $this->getCategories($result['category_id'], $new_path); } return $output; } } ?> Только не забываем редактировать catalog/model/catalog/news.php как написано выше. Спрашивайте лучше в личку.
  5. У всех правильно работает пагинация? почему то всегда отображает 11 новостей при ограничении в 10. При этом если перейти на 2 страницу пагинации, то там тот же список из 11 новостей. Изменил только $limit: $url = ''; if (isset($this->request->get['page'])) { $page = $this->request->get['page']; $url .= '&page=' . $this->request->get['page']; } else { $page = 1; } //$limit = $this->config->get('config_catalog_limit'); $limit = 10; $data = array( 'page' => $page, 'limit' => $limit, 'start' => $limit * ($page - 1), ); $total = $this->model_catalog_news->getTotalNews(); $pagination = new Pagination(); $pagination->total = $total; $pagination->page = $page; $pagination->limit = $limit; $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('information/news', $url . '&page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); В чем может быть проблема?
  6. Универсального способа так и не нашел =\ Пришлось для каждой ссылки прописывать редирект: RewriteCond %{QUERY_STRING} ^_route_=news/$ RewriteRule ^(.*)$ http://www.domain.ru/blog/? [R=301,L]
  7. Кстати да, хорошее простое решение) Может сможешь помочь, как сделать 301 редирект для "каталога", например с http://www.domain.ru/news/we-started на http://www.domain.ru/blog/we-started ? Сделал из этого модуля Блог, но жалко терять старых несколько ссылок ( Пробовал разные варианты, но почему то не работает. Думаю тут нужен не стандартный прием.. Сейчас .htaccess: Options +FollowSymlinks # Prevent Directoy listing Options -Indexes # Prevent Direct Access to files <FilesMatch "\.(tpl|ini|log)"> Order deny,allow Deny from all </FilesMatch> # SEO URL Settings RewriteEngine On RewriteBase / RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L] RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L] RewriteRule ^download/(.*) /index.php?route=error/not_found [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css) RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
  8. уже наверняка не актуально, но у меня кеш обновляется раз в пол часа, если самому не почистить папку www.domain.ru/system/cache - может на будущее пригодится) Вопрос к разработчикам, планируется ли добавить отзывы внутри новости? хотелось бы превратить модуль в блог)
  9. Думаю проблема была в зараженном response.php, туда попал вредоносный код, который посылал запросы на разные подозрительные url.
  10. К сожалению, все выбранные настройки фильтра сбрасываются при переходе на 1 страницу, так как она перезагружается. По идее надо добавить в код еще параметры фильтра ".&sort=", ".p.sort_order&order=ASC&limit=" и.т.д..
  11. Всем привет, Может быть кому-то будет полезно, как послать файл вместе с сообщением со страницы Связаться с нами в Opencart. Тестировалось на OcStore 1.5.5.1.2. Сначала добавим кнопку выбора в файле "../catalog/view/theme/*/template/information/contact.tpl" в нужное нам место: <input type="file" name="file"> Затем используем следующий код для файла "../catalog/controller/information/contact.php": $mail = new Mail(); $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->hostname = $this->config->get('config_smtp_host'); $mail->username = $this->config->get('config_smtp_username'); $mail->password = $this->config->get('config_smtp_password'); $mail->port = $this->config->get('config_smtp_port'); $mail->timeout = $this->config->get('config_smtp_timeout'); $mail->setTo($this->config->get('config_email')); $mail->setFrom($this->request->post['email']); $mail->setSender($this->request->post['name']); if (file_exists($_FILES['file']['tmp_name'])) { $tempdir = (DIR_DOWNLOAD)."/temp/"; $fileName = $_FILES['file']['name']; $imageTemp = $tempdir.$fileName; move_uploaded_file($_FILES['file']['tmp_name'], $tempdir.$fileName); $mail->addAttachment($tempdir.$fileName); } $mail->setSubject(html_entity_decode(sprintf($this->language->get('email_subject'), $this->request->post['name']), ENT_QUOTES, 'UTF-8')); $mail->setText(strip_tags(html_entity_decode($this->request->post['enquiry'], ENT_QUOTES, 'UTF-8'))); $mail->send(); unlink($tempdir.$fileName); $this->redirect($this->url->link('information/contact/success')); При этом обязательно нужно создать папку "temp": "../download/temp/" куда будет забрасываться файл и удаляться после отправки письма. Код простой и не очень безопасный, так как не ограничивает тип файла и размер. Для себе еще модернизировал его, чтобы можно было отправить письмо без текста (указаны только имя, почта и прикреплен файл), для этого надо заменить: $mail->setText(strip_tags(html_entity_decode($this->request->post['enquiry'], ENT_QUOTES, 'UTF-8'))); на следующий код: if (utf8_strlen($this->request->post['enquiry']) > 0) {$mail->setText(strip_tags(html_entity_decode($this->request->post['enquiry'], ENT_QUOTES, 'UTF-8')));} else {$mail->setText(strip_tags(html_entity_decode($enquiry = ' ', ENT_QUOTES, 'UTF-8')));} Но не забудьте тогда поменять сообщение об ошибке на "Файл должен содержать не более 3000 символов" вместо "Файл должен быть от 3 до 3000 символов".
  12. Определенно проблемы с кодировкой, возможно файлы news.tpl сохранены не в UTF-8 (Без BOM)? На индексацию статей вряд ли повлияет, а вот посетителей отпугнет..
  13. Сделал такую штуку: if(isset($this->request->post['manufacturer_id'])) { $pagination->url = $this->url->link('manufacturer_id=' . $this->request->post['manufacturer_id'] . '&page={page}'); } elseif(isset($this->request->post['category_id'])) { $pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&page={page}'); } else { $pagination->url = $this->url->link('product/productall' . '&page={page}'); }
  14. Помогите с пагинацией! Использую filterpro v2.4.2.3.1 mega - когда нажимаю вернутся на 1 страницу пагинации в производителях или productall, выдает ссылку http://www.site.ru/index.php?route=product/category&path= и сообщение Категория не найдена! В filterpro.php нашел строку: $pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&page={page}'); Я так понимаю, что при переходе по страницам пагинации начиная со 2+ в url попадает 'product/category' без перезагрузки страницы, но при переходе на 1 страницу пагинации происходит перезагрузка и не правильный запрос и сформированная ссылка. Как сделать чтобы для 1 страницы формировался правильный url для категорий, производителей и productall?
  15. Добавил в product.tpl, но после Купить не исчезает, хотя на сравнение и закладки действует =\ ocStore 1.5.5.1
  16. Написал пост про вывод ссылок в sitemap.xml для модуля НОВОСТИ+: https://opencartforum.com/topic/27094-google-sitemap-трижды-дублирует-ссылки/?do=findComment&comment=312329 Там же найдете другие полезности для карты ;]
  17. Путем долгих экспериментов удалось настроить sitemap.xml без дублирования ссылок для ocStore 1.5.5.1.2 со включенным seoPro. Чтобы избавиться от дублей нужно в файле /catalog/controller/feed/google_sitemap.php добавить "//" для следующего кода: $products = $this->model_catalog_product->getProducts(array('filter_manufacturer_id' => $manufacturer['manufacturer_id'])); //foreach ($products as $product) { // $output .= '<url>'; // $output .= '<loc>' . $this->url->link('product/product', 'manufacturer_id=' . $manufacturer['manufacturer_id'] . '&product_id=' . $product['product_id']) . '</loc>'; // $output .= '<changefreq>weekly</changefreq>'; // $output .= '<priority>1.0</priority>'; // $output .= '</url>'; //} $products = $this->model_catalog_product->getProducts(array('filter_category_id' => $result['category_id'])); // foreach ($products as $product) { // $output .= '<url>'; // $output .= '<loc>' . $this->url->link('product/product', 'path=' . $new_path . '&product_id=' . $product['product_id']) . '</loc>'; // $output .= '<changefreq>weekly</changefreq>'; // $output .= '<priority>1.0</priority>'; // $output .= '</url>'; //} После этого в sitemap.xml буду попадать ссылки всех товаров без дублей. Еще немного полезного: 1. Ссылка на главную страницу и любую свою страницу (например site/news) $output = '<?xml version="1.0" encoding="UTF-8"?>'; $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; $output .= '<url>'; $output .= '<loc>' . HTTP_SERVER . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>1.0</priority>'; $output .= '</url>'; $output .= '<url>'; $output .= '<loc>' . HTTP_SERVER . 'news' . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>0.7</priority>'; $output .= '</url>'; 2. Для тех кто использует модуль НОВОСТИ+ выводим все новости $this->load->model('catalog/news'); $news = $this->model_catalog_news->geturlNews(); foreach ($news as $item) { $output .= '<url>'; $output .= '<loc>' . $this->url->link('information/news', 'news_id=' . $item['news_id']) . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>0.7</priority>'; $output .= '</url>'; } $output .= '</urlset>'; Но важно в файле catalog/model/catalog/news.php добавить перед "public function getNews($data) {" следующий код: public function geturlNews() { $sql = "SELECT * FROM " . DB_PREFIX . "news n LEFT JOIN " . DB_PREFIX . "news_description nd ON (n.news_id = nd.news_id) LEFT JOIN " . DB_PREFIX . "news_to_store n2s ON (n.news_id = n2s.news_id) WHERE nd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND n2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND n.status = '1' ORDER BY n.date_added DESC"; if (isset($data['start']) || isset($data['limit'])) { if ($data['start'] < 0) { $data['start'] = 0; } if ($data['limit'] < 1) { $data['limit'] = 10; } $sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit']; } $query = $this->db->query($sql); return $query->rows; } После подобных манипуляций получаем все товары без дублирования, ссылку на главную страницу и любые свои страницы, ссылки на новости модуля News+ ;)
  18. Если не работает вывод сеткой (list -> grid), надо дополнительно вставить в конце перед <?php echo $footer; ?>: <script type="text/javascript">$(document).ready(function() { if(typeof display == 'function') { display('grid'); } });</script>
  19. В логах Avast выдает следующее: "Network Shield: blocked access to malicious site domain..", хотя virustotal показывает 0 / 58.. Добавил в исключения веб-экрана domain.ru и domain.ru/admin/, теперь вроде доступ к странице есть, но к чему все это?)
  20. Добрый день! Сегодня столкнулся с странным поведением браузеров на компьютере, когда при обращении к www.domain.ru/admin/ страница недоступна. При этом сама витрина магазина работает отлично, но в админку зайти не получается. Подумал на проблемы с модулями или хостингом, но случайно обнаружил, что с мобильных устройств все работает отлично. Оказалось, что новый avast блокирует страницу /admin/ на ocstore. Добавление ulr в исключение веб-экрана не помогло и его пришлось отключить.. Кто нибудь сталкивался с подобным?

×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.