Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Recommended Posts

Только одна строка может быть затронуи из-за того что окно запроса в вашей версии пхпадмина не подгдерживает множественные запросы. Ну на вскакий случай проверьте, разгделителем является ";". Если все-же окно не подгдерживает множественных запросов,то я бы просто сгделал импорт в иблицу url_alias.

По поводу ошибки, осмелюсь предположить что у вас нет правильного файла .htaccess в корне, точнее вы не убрали расширение txt у него.

Да ; есть разгделение. по поводу файла htaccess как только я убирал txt то сразу вылеиет икая ошибка что в админе что на сайте. Internal Server Error

Возможно нужно какой то другой файл htaccess?

Link to comment
Share on other sites


Да ; есть разгделение. по поводу файла htaccess как только я убирал txt то сразу вылеиет икая ошибка что в админе что на сайте. Internal Server Error

Возможно нужно какой то другой файл htaccess?

1) смотрите какую именно строку съедает запрос к бд, если верхнюю, то попробуйте скормить другую...

2) ошибка из-за неподгдерживаемых директорий в файле htaccess скорее всего, что странно при том что вы его согдержимого (как я понимаю) не меняли, подожгдем что скажут гуру, может тут что-то найгдете для себя.

Link to comment
Share on other sites


1) смотрите какую именно строку съедает запрос к бд, если верхнюю, то попробуйте скормить другую...

2) ошибка из-за неподгдерживаемых директорий в файле htaccess скорее всего, что странно при том что вы его согдержимого (как я понимаю) не меняли, подожгдем что скажут гуру, может тут что-то найгдете для себя.

Без разниэто какую бы строку не посивил все равно пишет не пишет разве что когда 1 срока. Но не суть я через импорт сгделал. Но с файлом не понятно... я ничего не трогал но вот икая беда :(

Явно какая то беда с файлом htaccess.

Link to comment
Share on other sites


Усиновил данную версию - внес SQL - все ок - но вот при попытке перейти из списка брендов (domain/brands/) в люпотому чтой бренд - пишет что:

Запрашиваемая страница не найгдена!

Link to comment
Share on other sites


Усиновил на сайт, всё рилииет. Спасипотому что потому чтольшое, за прогделанную Вами рилиту. Очень полезное дополнение !

Но только есть проблема с правильным отображением "Новостей"

И QiWi сил ошибку выдавать

2013-03-19 23:08:29 - qiwi error hash

Подскажите пожалуйси как решить ?

Link to comment
Share on other sites


Усиновил на сайт, всё рилииет. Спасипотому что потому чтольшое, за прогделанную Вами рилиту. Очень полезное дополнение !

Но только есть проблема с правильным отображением "Новостей"

И QiWi сил ошибку выдавать

2013-03-19 23:08:29 - qiwi error hash

Подскажите пожалуйси как решить ?

C новостями навести порядок мне помогло вот это https://opencart-forum.ru/files/file/554-seo-manager-%D0%B4%D0%BB%D1%8F-ocstore-153/.

  • +1 1
Link to comment
Share on other sites


Спасипотому что, antracit. Заменил файл сео про. Хотел сгделать по аналогии Faq (модуль часто задавемых вопросов) Но получается не очень :)

сайт.ру/faq/faq.html?topic=13

Link to comment
Share on other sites


после всех перегделок, получается максимум икой вид http://сайт.ru/faq/?topic=8

,а хотелось бы чтобы отображалось http://сайт.ru/faq/kak-zakazat/html

<?php
class ControllerCommonSeoPro extends Controller {
private $cache_data = null;
public function __construct($registry) {
 parent::__construct($registry);
 $this->cache_data = $this->cache->get('seo_pro');
 if (!$this->cache_data) {
  $query = $this->db->query("SELECT LOWER(`keyword`) as 'keyword', `query` FROM " . DB_PREFIX . "url_alias");
  $this->cache_data = array();
  foreach ($query->rows as $row) {
   $this->cache_data['keywords'][$row['keyword']] = $row['query'];
   $this->cache_data['queries'][$row['query']] = $row['keyword'];
  }
  $this->cache->set('seo_pro', $this->cache_data);
 }
}
public function index() {
 // Add rewrite to url class
 if ($this->config->get('config_seo_url')) {
  $this->url->addRewrite($this);
 } else {
  return;
 }
 // Decode URL
 if (!isset($this->request->get['_route_'])) {
  $this->validate();
 } else {
  $route = $this->request->get['_route_'];
  unset($this->request->get['_route_']);
  $parts = explode('/', trim(utf8_strtolower($route), '/'));
  /* BEGIN Actions */
  if (preg_match('#^(actions/)(.*)#', $route, $matches)) {
   $parts = explode('/', trim(utf8_strtolower($matches[2]), '/'));
   if($parts[0] == '' AND count($parts) == 1) {
 $parts = explode('/', trim(utf8_strtolower($route), '/'));
   }
  }
  /* END Actions */
  /* BEGIN News & Reviews */
  if (preg_match('#^(news/)(.*)#', $route, $matches)) {
   $parts = explode('/', trim(utf8_strtolower($matches[2]), '/'));
   if($parts[0] == '' AND count($parts) == 1) {
 $parts = explode('/', trim(utf8_strtolower($route), '/'));
   }
  }
  /* END News & Reviews */  
  list($last_part) = explode('.', array_pop($parts));
  array_push($parts, $last_part); 
  $rows = array();
  foreach ($parts as $keyword) {
   if (isset($this->cache_data['keywords'][$keyword])) {
 $rows[] = array('keyword' => $keyword, 'query' => $this->cache_data['keywords'][$keyword]);
   }
  }
  if (count($rows) == sizeof($parts)) {
   $queries = array();
   foreach ($rows as $row) {
 $queries[utf8_strtolower($row['keyword'])] = $row['query'];
   }
   reset($parts);
   foreach ($parts as $part) {
 $url = explode('=', $queries[$part], 2);
 if ($url[0] == 'category_id') {
  if (!isset($this->request->get['path'])) {
   $this->request->get['path'] = $url[1];
  } else {
   $this->request->get['path'] .= '_' . $url[1];
  }
 } elseif (count($url) > 1) {
  $this->request->get[$url[0]] = $url[1];
 }
   }
  /* BEGIN Actions */
  } elseif ( (isset($keyword_in[0]) AND $keyword_in[0] == 'actions') OR (isset($parts[0]) AND $parts[0] == 'actions') ) {
   $this->request->get['route'] = 'information/actions';
  /* END Actions */
  /* BEGIN News & Reviews */
  } elseif ( (isset($keyword_in[0]) AND $keyword_in[0] == 'news') OR (isset($parts[0]) AND $parts[0] == 'news') ) {
   $this->request->get['route'] = 'information/news';
  /* END News & Reviews */  
  } else {
   $this->request->get['route'] = 'error/not_found';
  }
  if (isset($this->request->get['product_id'])) {
   $this->request->get['route'] = 'product/product';
   if (!isset($this->request->get['path'])) {
 $path = $this->getPathByProduct($this->request->get['product_id']);
 if ($path) $this->request->get['path'] = $path;
   }
  } elseif (isset($this->request->get['path'])) {
   $this->request->get['route'] = 'product/category';
  } elseif (isset($this->request->get['manufacturer_id'])) {
   $this->request->get['route'] = 'product/manufacturer/product';
  } elseif (isset($this->request->get['information_id'])) {
   $this->request->get['route'] = 'information/information';
  /* BEGIN Actions */
  } elseif (isset($this->request->get['actions_id'])) {
   $this->request->get['route'] = 'information/actions';
  /* END Actions */
  /* BEGIN News & Reviews */
  } elseif (isset($this->request->get['news_id'])) {
   $this->request->get['route'] = 'information/news';
  /* END News & Reviews */

  } else {
   if (isset($queries[$parts[0]])) {
 $this->request->get['route'] = $queries[$parts[0]];
   }
  }

  $this->validate();
  if (isset($this->request->get['route'])) {
   return $this->forward($this->request->get['route']);
  }
 }
}
public function rewrite($link) {
 if (!$this->config->get('config_seo_url')) return $link;
 $seo_url = '';
 $component = parse_url(str_replace('&', '&', $link));
 $data = array();
 parse_str($component['query'], $data);
 $route = $data['route'];
 unset($data['route']);
 switch ($route) {
  /* BEGIN Actions*/
  case 'information/actions':
   if (!isset($data['actions_id'])) {
 $seo_url .= '/actions';
   }
   break;
  /*END Actions*/
  /* BEGIN News & Reviews */
  case 'information/news':
   if (!isset($data['news_id'])) {
 $seo_url .= '/news';
   }
   break;
  /* END News & Reviews */
  case 'product/product':
   if (isset($data['product_id'])) {
 $tmp = $data;
 $data = array();
 if ($this->config->get('config_seo_url_include_path')) {
  $data['path'] = $this->getPathByProduct($tmp['product_id']);
  if (!$data['path']) return $link;
 }
 $data['product_id'] = $tmp['product_id'];
 if (isset($tmp['tracking'])) {
  $data['tracking'] = $tmp['tracking'];
 }
   }
   break;
  case 'product/category':
   if (isset($data['path'])) {
 $category = explode('_', $data['path']);
 $category = end($category);
 $data['path'] = $this->getPathByCategory($category);
 if (!$data['path']) return $link;
   }
   break;
  case 'product/product/review':
  case 'information/information/info':
   return $link;
   break;
  default:
   break;
 }
 if ($component['scheme'] == 'https') {
  $link = $this->config->get('config_ssl');
 } else {
  $link = $this->config->get('config_url');
 }
 $link .= 'index.php?route=' . $route;
 if (count($data)) {
  $link .= '&' . urldecode(http_build_query($data, '', '&'));
 }
 $queries = array();
 foreach ($data as $key => $value) {
  switch ($key) {
   /* BEGIN Actions */
   case 'actions_id':
 $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = '" . $this->db->escape($key . '=' . (int)$value) . "'");
 if ($query->num_rows) {
  $seo_url .= '/actions/' . rawurlencode($query->row['keyword']);
  unset($data[$key]);
  $postfix = 1;
 }
 break;
   /* END Actions */
   /* BEGIN News & Reviews */
   case 'news_id':
 $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = '" . $this->db->escape($key . '=' . (int)$value) . "'");
 if ($query->num_rows) {
  $seo_url .= '/news/' . rawurlencode($query->row['keyword']);
  unset($data[$key]);
  $postfix = 1;
 }
 break;
   /* END News & Reviews */  
   case 'product_id':
   case 'manufacturer_id':
   case 'category_id':
   case 'information_id':
 $queries[] = $key . '=' . $value;
 unset($data[$key]);
 $postfix = 1;
 break;
   case 'path':
 $categories = explode('_', $value);
 foreach ($categories as $category) {
  $queries[] = 'category_id=' . $category;
 }
 unset($data[$key]);
 break;
   default:
 break;
  }
 }
 if(empty($queries)) {
  $queries[] = $route;
 }
 $rows = array();
 foreach($queries as $query) {
  if(isset($this->cache_data['queries'][$query])) {
   $rows[] = array('query' => $query, 'keyword' => $this->cache_data['queries'][$query]);
  }
 }
 if(count($rows) == count($queries)) {
  $aliases = array();
  foreach($rows as $row) {
   $aliases[$row['query']] = $row['keyword'];
  }
  foreach($queries as $query) {
   $seo_url .= '/' . rawurlencode($aliases[$query]);
  }
 }
 if ($seo_url == '') return $link;
 $seo_url = trim($seo_url, '/');
 if ($component['scheme'] == 'https') {
  $seo_url = $this->config->get('config_ssl') . $seo_url;
 } else {
  $seo_url = $this->config->get('config_url') . $seo_url;
 }
 if (isset($postfix)) {
  $seo_url .= trim($this->config->get('config_seo_url_postfix'));
 } else {
  $seo_url .= '/';
 }
 if(substr($seo_url, -2) == '//') {
  $seo_url = substr($seo_url, 0, -1);
 }
 if (count($data)) {
  $seo_url .= '?' . urldecode(http_build_query($data, '', '&'));
 }
 return $seo_url;
}
private function getPathByProduct($product_id) {
 $product_id = (int)$product_id;
 if ($product_id < 1) return false;
 static $path = null;
 if (!is_array($path)) {
  $path = $this->cache->get('product.seopath');
  if (!is_array($path)) $path = array();
 }
 if (!isset($path[$product_id])) {
  $query = $this->db->query("SELECT category_id FROM " . DB_PREFIX . "product_to_category WHERE product_id = '" . $product_id . "' ORDER BY main_category DESC LIMIT 1");
  $path[$product_id] = $this->getPathByCategory($query->num_rows ? (int)$query->row['category_id'] : 0);
  $this->cache->set('product.seopath', $path);
 }
 return $path[$product_id];
}
private function getPathByCategory($category_id) {
 $category_id = (int)$category_id;
 if ($category_id < 1) return false;
 static $path = null;
 if (!is_array($path)) {
  $path = $this->cache->get('category.seopath');
  if (!is_array($path)) $path = array();
 }
 if (!isset($path[$category_id])) {
  $max_level = 10;
  $sql = "SELECT CONCAT_WS('_'";
  for ($i = $max_level-1; $i >= 0; --$i) {
   $sql .= ",t$i.category_id";
  }
  $sql .= ") AS path FROM " . DB_PREFIX . "category t0";
  for ($i = 1; $i < $max_level; ++$i) {
   $sql .= " LEFT JOIN " . DB_PREFIX . "category t$i ON (t$i.category_id = t" . ($i-1) . ".parent_id)";
  }
  $sql .= " WHERE t0.category_id = '" . $category_id . "'";
  $query = $this->db->query($sql);
  $path[$category_id] = $query->num_rows ? $query->row['path'] : false;
  $this->cache->set('category.seopath', $path);
 }
 return $path[$category_id];
}
private function validate() {
 if (empty($this->request->get['route']) || $this->request->get['route'] == 'error/not_found') {
  return;
 }
 if (isset($this->request->server['HTTP_X_REQUESTED_WITH']) && strtolower($this->request->server['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
  return;
 }
 if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
  $url = str_replace('&', '&', $this->config->get('config_ssl') . ltrim($this->request->server['REQUEST_URI'], '/'));
  $seo = str_replace('&', '&', $this->url->link($this->request->get['route'], $this->getQueryString(array('route')), 'SSL'));
 } else {
  $url = str_replace('&', '&', $this->config->get('config_url') . ltrim($this->request->server['REQUEST_URI'], '/'));
  $seo = str_replace('&', '&', $this->url->link($this->request->get['route'], $this->getQueryString(array('route')), 'NONSSL'));
 }
 if (rawurldecode($url) != rawurldecode($seo)) {
  header($this->request->server['SERVER_PROTOCOL'] . ' 301 Moved Permanently');
  $this->response->redirect($seo);
 }
}
private function getQueryString($exclude = array()) {
 if (!is_array($exclude)) {
  $exclude = array();
  }
 return urldecode(http_build_query(array_diff_key($this->request->get, array_flip($exclude))));
 }
}
?>

Link to comment
Share on other sites


Пролиил все топики и совсем запуился, даты создания тем раньше чем появился ocStore v1.5.4.1, собственно у меня он и стоит и всвязи с этим есть ряд вопрросов.

1. Как сгделать чпу страницах кониктов, информации, производителей? Как я понял нужно гделать запросом к базе?

2. Как автоматичести генерить url страниц и категорий?

3. Как прописать robots.txt?

4. Как убрать дубли?

Link to comment
Share on other sites


Вдруг ни с чего пересил формировать алиасы на новые товары. Откатился, перезалил алиасы в базу - один хрен. Загадка.

Вернул сирый шаблонный, он ссылки на товары формирует нормально.

1.5.4.1 сивил cached_seo_pro_v1.5.3.zip

Link to comment
Share on other sites


У кого нибудь полулилось сгделать ссылки с производителями следующим обвместе:

имя_сайи/производители/название_производителя

А то как то не красиво получается: имя_сайи/название_производителя

Ведь если смотрим товар, то выглядит всё здорово - имя_сайи/категория/товар

Link to comment
Share on other sites


Вопрос к автору темы. Можно сгделать, чтобы модуль: seopro_multilang.zip, был кэшированый, как: cached_seo_pro_v1.5.3.zip. Почему-то магазин дает потому чтольшую нагрузку на сервер.

PS. Возможно вопрос, не умный, но меня он, очень волнует.

Link to comment
Share on other sites


Вопрос к автору темы. Можно сгделать, чтобы модуль: seopro_multilang.zip, был кэшированый, как: cached_seo_pro_v1.5.3.zip. Почему-то магазин дает потому чтольшую нагрузку на сервер.

PS. Возможно вопрос, не умный, но меня он, очень волнует.

multilang кешированный. как вы проверяли нагузку?

Link to comment
Share on other sites

multilang кешированный. как вы проверяли нагузку?

Благодарю за ответ. Через мою неопытность, я не заметил, что проблема совсем не в ocstore.

Link to comment
Share on other sites


Прошу помощи. Уже на грани истерики ))

Перелислю, что сгделано:

1. Усиновлен cached_seo_pro_v1.5.3.zip

2. Выполнен запрос к БД.

3. Переименован .htaccess.txt в .htaccess

4. В системе управления все настройки включены

5. Полиещёны все "cache" и на сервере и в браузере

6. В ручную прописан Seo url для товара

А запрос как был http://****.com/inde...3&product_id=65 ик и осился.

Link to comment
Share on other sites


Прошу помощи. Уже на грани истерики ))

Перелислю, что сгделано:

1. Усиновлен cached_seo_pro_v1.5.3.zip

2. Выполнен запрос к БД.

3. Переименован .htaccess.txt в .htaccess

4. В системе управления все настройки включены

5. Полиещёны все "cache" и на сервере и в браузере

6. В ручную прописан Seo url для товара

А запрос как был http://sait.com/inde...3&product_id=65 ик и осился.

Аналогично. У меня 1.5.4.1 Основные ссылки сили нормальными. А вот категории и товары как всегда.

Link to comment
Share on other sites


Ну на основные категории то срилиило, а вот пути к товарам и подкатегориям нет: http://jade.by/

Вобещём, врогде разобрался.

Нужно прописывать Seu url везгде: категория/подкатегория/товар.

Т.е. у тебя должны быть урлы ггде-то ик: Для лица/Лифтинг и упругость/NANO CORRECTOR ( и дальше по аналогии).

Но вообещё-то я думал, что все это должно подхватываться автоматом, а не вбиваться ручками.

  • +1 1
Link to comment
Share on other sites


Поискал по форуму, может конечно плохо искал, но всё же. Есть структура категорий типа:

Футпотому чтол

- кроссовки

- огдежка

Баскетпотому чтол

- кросовки

- огдежда

Да вот используя seo_pro с кеширование (да и просто если seo_pro использовать) то перейдя по ссылке футпотому чтол/кроссовки - редирект идёт на баскетпотому чтол/кроссовки.

В обещём что гделать с одинаковыми названиями подкатегорий в seo_url

OcStore 15.3.1

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

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