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

Краткое описание товара


Recommended Posts

Всем доброго времени суток. Помогите реализовать такую штуку... Надо, чтобы в категориях краткое описание товара подгружалось из Мета-тег Description товара. Opencart 2.3.0.2, шаблон стандартный. Где и что подправить? Спасибо заранее.

Link to comment
Share on other sites


catalog/controller/product/category.php

 

'description' => utf8_substr(trim(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'))), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',

на

'description' => utf8_substr(trim(strip_tags(html_entity_decode($result['meta_description'], ENT_QUOTES, 'UTF-8'))), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',

 

Link to comment
Share on other sites

27.02.2023 в 23:31, aridius сказал:

catalog/controller/product/category.php

 

'description' => utf8_substr(trim(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'))), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',

на

'description' => utf8_substr(trim(strip_tags(html_entity_decode($result['meta_description'], ENT_QUOTES, 'UTF-8'))), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',

 

Большое спасибо вам. А как можно контролировать количество символов и перенос строки в meta_description?

Link to comment
Share on other sites


Помогите допилить затею.
В /catalog/controller/product/category.php
Родной код такой:
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..',
Если его заменить на:
'description' => $result['meta_description'],
Или на
'description' => utf8_substr(strip_tags(html_entity_decode($result['meta_description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..',
То при превышении количества символов в мета описании не срабатывает перенос на новую строку и у товара появляется лифт.
Как исправить?

Link to comment
Share on other sites


28.02.2023 в 21:29, aridius сказал:

Може я не правильно зрозумів питання, що заважає задати висоту блоку засобами css?

Можете подсказать, где и как?

Link to comment
Share on other sites


28.02.2023 в 23:33, aridius сказал:

в особисті повідомлення домен надішліть мені

Отправил.

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.