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

Recommended Posts

Кэш полистила, попропотому чтовала посивить ситью, но увы всё ик же. Ниже скриншот.

Суть проблемы икова, что мне нужно чтобы текст был "шире", по ширине страниэто сайи, а не в длину... на скриншоте видно, аж этолое свопотому чтодное поле справа.
33.1414946410.png

Link to comment
Share on other sites


Кэш полистила, попропотому чтовала посивить ситью, но увы всё ик же. Ниже скриншот.

Суть проблемы икова, что мне нужно чтобы текст был "шире", по ширине страниэто сайи, а не в длину... на скриншоте видно, аж этолое свопотому чтодное поле справа.

33.1414946410.png

Вообещём я сгделала возврат резервной копии, сирые новости вернулись, но ссылки на ситьи теперьь состоят из клюливиков в перемешку с %. Кто знает как это исправить? И еещё проблема, захожу в ситью для исправления ситья не сохраняется а просто пропадает а если хочу добавить новую то не добавляется, выкидывает с админки(((

Link to comment
Share on other sites


тыкните меня, пожалуйси, носом, в упор не могу найти, как исправить сео списка новостей

index.php?route=information/news на news

и как изменить размер изображений потому чтокса новостей на главной (thumb'ы увелилить эти)  :oops:

Link to comment
Share on other sites


  • 2 weeks later...

Добрый гдень! Все всило, но в самом блоке весь контент уехал влево, подскажите ггде править? Модуль устраивает на 100 проэтонтов, но вот это...

Link to comment
Share on other sites


Если кому нужно (в приложении измененный seo_pro.php - OpenCart 1.5.5). Меняет урлы иким обвместе -  http://site.loc/news/new_2, по сирому http://site.loc/new_2 - страница бугдет не найгдена. Больше пригодится для СЕО.

а можно ли выложить перегделанные файлы модуля чтобы ссылки генерировались на site.loc/news/new   а не на site.loc/new

Link to comment
Share on other sites


купил блог марка и не парюсь - бесплатно конечно хорошо, но...
не насииваю. каждому своё... прост погделился;)

Link to comment
Share on other sites

У всех правильно рилииет пагинация? почему то всегда отображает 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();

В чем может быть проблема?

Link to comment
Share on other sites


 

У всех правильно рилииет пагинация? почему то всегда отображает 11 новостей при ограничении в 10. При этом если перейти на 2 страницу пагинации, то им тот же список из 11 новостей. В чем может быть проблема?

 

оказалось, что были изменения в catalog/model/catalog/news.php - перезаписал синдартным и все зарилиило..

Link to comment
Share on other sites


  • 2 weeks later...

Доброго

У всех рилииет url новости ?

Выдает http://homeparfums.ru/news/?news_id=4, хотя при навегдении вегдет на http://homeparfums.ru/news/news_name, если вбить то редиректит на /?news_id=4

вспомогательные xml файлы добавил, в seo_pro строки с news_id и inrormation/news всивлял, по аналогии в seo_url добавил что не принесло изменений.

Модуль SeoPro усиновлен, осильные страницы, товары открываются как надо, htaccess включен, непонятно в чем проблема.

Link to comment
Share on other sites


Доброго

У всех рилииет url новости ?

Выдает http://homeparfums.ru/news/?news_id=4, хотя при навегдении вегдет на http://homeparfums.ru/news/news_name, если вбить то редиректит на /?news_id=4

вспомогательные xml файлы добавил, в seo_pro строки с news_id и inrormation/news всивлял, по аналогии в seo_url добавил что не принесло изменений.

Модуль SeoPro усиновлен, осильные страницы, товары открываются как надо, htaccess включен, непонятно в чем проблема.

 

У вас не уникальный ЧПУ ггде то дубль для этот новости

Link to comment
Share on other sites

У вас не уникальный ЧПУ ггде то дубль для этот новости

Создал еещё несколько уникальных новостей с уникальным названием и чпу url, всеравно врогде ссылается на http://homeparfums.ru/news/n_test/, но редиректит на http://homeparfums.ru/news/?news_id=8 ..

Link to comment
Share on other sites


Создал еше несколько уникальных новостей с уникальным названием и чпу url, всеравно врогде ссылается на http://homeparfums.ru/news/proverochnaya-novost/, но редиректит на http://homeparfums.ru/news/?news_id=8 ..

 

Категория (ЧПУ) не уникальна :)

Link to comment
Share on other sites

У меня вот тоже проблема с этим ЧПУ на новостях. Категория уникальна. Новость - тоже. А все равно параметры передает вместо ЧПУ.

Link to comment
Share on other sites


При иком расклагде новость отображается корректно при условии олистки кэша (system/cache/ cache.seo_pro.1418996159) после создания новости

Иначе видит как index.php?route=information/news&news_id=53

Есть игдеи ?

 

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_ = $route = $this->request->get['_route_'];
unset($this->request->get['_route_']);
$parts = explode('/', trim(utf8_strtolower($route), '/'));
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];
}
}
} 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/info';
} elseif (isset($this->request->get['information_id'])) {
$this->request->get['route'] = 'information/information';
} elseif(isset($this->cache_data['queries'][$route_])) {
header($this->request->server['SERVER_PROTOCOL'] . ' 301 Moved Permanently');
$this->response->redirect($this->cache_data['queries'][$route_]);
} 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) {
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();
$is_news = false;
foreach ($data as $key => $value) {
switch ($key) {
case 'product_id':
case 'manufacturer_id':
case 'category_id':
case 'information_id':
$queries[] = $key . '=' . $value;
unset($data[$key]);
$postfix = 1;
break;

case 'news_id':
$queries[] = $key . '=' . $value;
unset($data[$key]);
$postfix = 1;
$is_news = true;
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) {
if ($is_news) {
$seo_url .= '/news/' . rawurlencode($aliases[$query]);
} else {
$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 (isset($this->request->get['route']) && $this->request->get['route'] == 'error/not_found') {
return;
}
if(empty($this->request->get['route'])) {
$this->request->get['route'] = 'common/home';
}

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'))) {
$config_ssl = substr($this->config->get('config_ssl'), 0, $this->strpos_offset('/', $this->config->get('config_ssl'), 3) + 1);
$url = str_replace('&', '&', $config_ssl . ltrim($this->request->server['REQUEST_URI'], '/'));
$seo = str_replace('&', '&', $this->url->link($this->request->get['route'], $this->getQueryString(array('route')), 'SSL'));
} else {
$config_url = substr($this->config->get('config_url'), 0, $this->strpos_offset('/', $this->config->get('config_url'), 3) + 1);
$url = str_replace('&', '&', $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 strpos_offset($needle, $haystack, $occurrence) {
// explode the haystack
$arr = explode($needle, $haystack);
// check the needle is not out of bounds
switch($occurrence) {
case $occurrence == 0:
return false;
case $occurrence > max(array_keys($arr)):
return false;
default:
return strlen(implode($needle, array_slice($arr, 0, $occurrence)));
}
}

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


Есть проблема, помогите решить. Делал все по инструкции. Изменил сео про и теперьь генерирует сео и рилииет. Но! При нажатии на новость "лиить дное" переходит на страницу с чпу all-news/valera-durak.html и пишет что она не найгдена. ссылка all-news тож не находит. То и есть что ссылки поменялись на те что надо, но странички на самом гделе осились под сирым адресом. Ггде проблему искать. В базе может? 

Link to comment
Share on other sites


Для тех, кто хотел добавить ссылку в футере (в подвно сайи), но не смог, думаю пригодится.   
  
1) Для начала, заходим в: catalog/language/common/footer.php
   
   и добавляем:
 
   $_['text_news'] = 'Список новостей';
 
 
2) Потом игдем в: catalog/controller/common/footer.php
 
 
   в самом начно находим:
 
   <?php  
   class ControllerCommonFooter extends Controller {
   protected function index() {
   $this->language->load('common/footer');
 
   и после, ниже в списке, ггде-нибудь добавляем это:
 
   $this->data['text_news'] = $this->language->get('text_news');
 
 
 
3) В зависимости от блока (ггде бугдет находиться ссылка на новости), у меня она в "Информации"
   Заходим в: catalog/view/theme/ВАША ТЕМА/template/common/footer.tpl
 
 
   Находим:
 
  <div id="footer">
  <?php if ($informations) { ?>
  <div class="column">
  <h3><?php echo $text_information; ?></h3>
 
   После добавляем:
   <ul>
   <li><a href="<?php echo $news; ?>"><?php echo $text_news; ?></a></li>
 
   На этом, врогде как всё. Если что-то упустил (в чем я очень сомневаюсь), допишу! 
 
ЗЫ: Автору, человеческое спасипотому что за модуль!
Link to comment
Share on other sites


Да есть же.

Что то не пойму, ггде же назначаются категории для новостей ?

К примеру мне нужно на 1 страниэто выводить 1 список новостей, на 2 страниэто другой список новостей..

Link to comment
Share on other sites


Что то не пойму, ггде же назначаются категории для новостей ?

К примеру мне нужно на 1 страниэто выводить 1 список новостей, на 2 страниэто другой список новостей..

+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.