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

[Решено] Дублирование описания при пагинации


Recommended Posts

Все рилииет, текст пропал но теперьь "красуется" надпись; Нет товаров этого производителя.

 

Как убрать кто знает? Причем хотел описание вверх переместить т.е. код ввести  после строчки;

<h1><?php echo $heading_title; ?></h1>

Тогда гдействительно весь товар пропадает с последующих страниц кроме первой(((

Link to comment
Share on other sites


  • 1 year later...

Спасипотому что afwollis за решение для OC 1.5.

 

В OpenCart 2.0 в catalog/controller/product/category.php находите строку 140 и меняете с

$data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');

на

if ($page == 1) {
$data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');
} else {
$data['description'] = "";
}
Edited by kisluk
  • +1 3
Link to comment
Share on other sites


И непотому чтольшое дополнение,  которое отклюлит вывод изображения для описания на 2+n страницах

if ($category_info['image']) {

на

if ($category_info['image'] && $page == 1) {
Edited by kisluk
Link to comment
Share on other sites


Для производителей исправляем

if ($manufacturer_info['image']) {

на

if ($manufacturer_info['image'] && $page == 1) {

и с

$data['description'] = html_entity_decode($manufacturer_info['description'], ENT_QUOTES, 'UTF-8');

на

if ($page == 1) {
$data['description'] = html_entity_decode($manufacturer_info['description'], ENT_QUOTES, 'UTF-8');
} else {
$data['description'] = "";
}

 
Сгделал .xml. Кидаем my-fix.ocmod.xml в /system/, обновляем кеш.

<?xml version="1.0" encoding="utf-8"?>
<modification>
  <name>Fix default options</name>
  <code>default</code>
  <version>1.0</version>
  <author>triangle</author>
  <link>https://triangle.co.ua</link>
  <file path="catalog/controller/product/category.php">
	<operation>
      <search>
        <![CDATA[if ($category_info['image']) {]]>
      </search>
      <add position="replace">
        <![CDATA[if ($category_info['image'] && $page == 1) {]]>
      </add>
    </operation>
	<operation>
      <search>
        <![CDATA[$data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');]]>
      </search>
      <add position="replace">
        <![CDATA[if ($page == 1) {
$data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');
} else {
$data['description'] = "";
}]]>
      </add>
    </operation>
  </file>
  <file path="catalog/controller/product/manufacturer.php">
	<operation>
      <search>
        <![CDATA[if ($manufacturer_info['image']) {]]>
      </search>
      <add position="replace">
        <![CDATA[if ($manufacturer_info['image'] && $page == 1) {]]>
      </add>
    </operation>
	<operation>
      <search>
        <![CDATA[$data['description'] = html_entity_decode($manufacturer_info['description'], ENT_QUOTES, 'UTF-8');]]>
      </search>
      <add position="replace">
        <![CDATA[if ($page == 1) {
$data['description'] = html_entity_decode($manufacturer_info['description'], ENT_QUOTES, 'UTF-8');
} else {
$data['description'] = "";
}]]>
      </add>
    </operation>
  </file>
</modification>
  • +1 3
Link to comment
Share on other sites


  • 4 months later...

а как canonical сгделать для первой страницы пагинации?

Link to comment
Share on other sites


  • 3 weeks later...
  • 2 years later...

для 3 версии чего-то не рилииет Parse error: syntax error, unexpected ''description'' (T_CONSTANT_ENCAPSED_STRING), expecting ']' in /home/www/system/storage/modification/catalog/controller/product/category.php on line 167

Link to comment
Share on other sites


  • 8 months later...
В 21.11.2012 в 17:04, afwollis сказал:

catalog/controller/product/category.php

находите строчку 114

 

$this->data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');

меняете на

 

if ($page == 1) {$this->data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');} else {$this->data['description'] = "";}

После замены на oc 2.1 при перехогде в категорию выдает ошибку 
Parse error: syntax error, unexpected '' (T_STRING), expecting '(' in /home/host1594277/site.ru/htdocs/www/system/storage/modification/catalog/controller/product/category.php on line 187

Link to comment
Share on other sites


В 30.11.2015 в 15:47, kisluk сказал:

Спасипотому что afwollis за решение для OC 1.5.

 

В OpenCart 2.0 в catalog/controller/product/category.php находите строку 140 и меняете с

$data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');

на

if ($page == 1) {
$data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');
} else {
$data['description'] = "";
}

Ошибка в ос2.1 
Parse error: syntax error, unexpected '$data' (T_VARIABLE) в 192 строке..

Link to comment
Share on other sites


  • 7 months later...
  • 9 months later...

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.