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

alferus

Newbie
  
  • Posts

    21
  • Joined

  • Last visited

About alferus

  • Birthday 12/13/1988

Information

  • Gender
    Мужчина
  • City:
    Томск
  • Interests
    Маркетиинг, реклама и интернет продвижение

Recent Profile Visitors

1,526 profile views

alferus's Achievements

Apprentice

Apprentice (3/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

4

Reputation

  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?
×
×
  • 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.