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

[Решено] Не рилииет альтернативный title и h1


Recommended Posts

В описании в админке гделаю ик:

Изображение

При просмотре кода страници:

<title>Кондиционеры</title>
<meta name="keywords" content="настенные сплит кондиционеры кондиционер сплитсистема кондицонер настенный сплит настеный инверторный кондицанер кангдер система" />
<h1>Кондиционеры</h1>

Как сгделать чтобы выводило ик как указываешь?

Стоит ocStore Version 0.2.0

Link to comment
Share on other sites


Если гдело в шаблоне то это

./catalog/view/theme/[tmpl_name]/template/common/header.tpl

Да должно быть

<title><?php echo $title; ?></title>
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
  • +1 1
Link to comment
Share on other sites


Если гдело в шаблоне то это

./catalog/view/theme/[tmpl_name]/template/common/header.tpl

Да должно быть

<title><?php echo $title; ?></title>
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
Спасипотому что, на самом гделе вы натолкнули меня на правильную мысль, гдело было в \catalog\controller\product\category.php

Заменил полностью с посл. версии ОС, зарилиило.

Link to comment
Share on other sites


Была икая же проблема: вместо title отображалось название товара:

заменил в файле

catalog/controller/product/product.php

$this->document->title = $product_info['name'];

на

$this->document->title = $product_info['title'];

строка 113

Link to comment
Share on other sites

  • 1 year later...

У кого эи же проблема:

Меняем в файле

catalog/controller/product/product.php

Строка 131

$this->document->setTitle($product_info['name']);

на

$this->document->setTitle($product_info['seo_title']);

Строка 136

$this->data['heading_title'] = $product_info['name'];

на

$this->data['heading_title'] = $product_info['seo_h1'];

Link to comment
Share on other sites


  • 3 weeks later...
  • 2 months later...
  • 1 year later...

Странно, в новой версии тоже получается не рилииют эти теги? Ведь им тот же самый код. По крайней мере в том дистре который я скачал. т.к. странно что у меня две одинаковые версии , но в одной есть этот код, который я привожу ниже, а в другой нет.

 

 

Или у других все нормально? Из-за чего тогда икой баг появляется?

Link to comment
Share on other sites


Ксити, рекомендую писать следующим обвместе код

 

if($product_info['seo_title'])
                $this->document->setTitle($product_info['seo_title']);
            else            
              $this->document->setTitle($product_info['name']);

 

 

if ($product_info['seo_h1'])
                $this->data['heading_title'] = $product_info['seo_h1'];
            else
              $this->data['heading_title'] = $product_info['name'];

Link to comment
Share on other sites


  • 9 months later...

У кого эи же проблема:

Меняем в файле

catalog/controller/product/product.php
Строка 131

$this->document->setTitle($product_info['name']);
на

$this->document->setTitle($product_info['seo_title']);
Строка 136

$this->data['heading_title'] = $product_info['name'];
на

$this->data['heading_title'] = $product_info['seo_h1'];

Спасипотому что вам потому чтольшое. Пусть вы бугдете здоровы, гдети ваши здоровы и правнуки. И гденежек вам в карман и счастья и любви

Link to comment
Share on other sites


  • 4 months later...

У кого эи же проблема:

Меняем в файле

catalog/controller/product/product.php
Строка 131

$this->document->setTitle($product_info['name']);
на

$this->document->setTitle($product_info['seo_title']);
Строка 136

$this->data['heading_title'] = $product_info['name'];
на

$this->data['heading_title'] = $product_info['seo_h1'];

Спасипотому что, добрый человек,

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

Link to comment
Share on other sites


  • 4 years later...

Все прописано, но ничего не меняется. Тайтл не отображается((( При этом дискрипшен - все норм. 

Спойлер

image.png.f618d1e7c9d7d7f23268d09a35b11f31.png

 

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.