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

sherbak

Newbie
  
  • Posts

    3
  • Joined

  • Last visited

sherbak's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Week One Done
  • One Month Later
  • One Year In
  • Conversation Starter

Recent Badges

1

Reputation

  1. Спасибо за советы! Проблему вывода атрибутов решил следующим образом: 1. поправил руками файлик catalog\controller\extension\module\featured.php Было: $data['products'][] = array( 'product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $rating, 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']) ); Стало: $data['products'][] = array( 'product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8'),'<br><p></p>'), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) , 'price' => $price, 'attribute_groups' => $this->model_catalog_product->getProductAttributes($product_info['product_id']), 'special' => $special, 'tax' => $tax, 'rating' => $rating, 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']) ); Если хорошо присмотреться, то там еще одна проблемка решена - отсутствие переносов строк в описании. Ну, а дальше отредактировал шаблон: {% if product.attribute_groups %} {% for attribute_group in product.attribute_groups %} {% for attribute in attribute_group.attribute %} {{ attribute.name }}: {{ attribute.text }}<br> {% endfor %} {% endfor %} {% endif %}
  2. Дружище! Подскажи, плз., как это сделать? Башку себе уже об стену разбил!
  3. Приветствую, уважаемые! Только-только начал осваивать OpenCart 3. Возник вопрос. Создаю Витрину. И в ней нужно вывести Атрибуты (вместо или вместе с описанием). Я нашел, как выводятся атрибуты в карточке товара: {% if attribute_groups %} <div class="tab-pane" id="tab-specification"> <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> </tr> {% endfor %} </tbody> {% endfor %} </table> </div> {% endif %} С некоторыми изменениями (мне нужна не таблица, а список) вставляю в extention/module/featured: <ul> {% if attribute_groups %} {% for attribute_group in attribute_groups %} {% for attribute in attribute_group.attribute %} <li><strong>{{ attribute.name }}: </strong>{{ attribute.text }}</li> {% endfor %} {% endfor %} {% endif %} </ul> Но это не приводит ни к какому результату. Отсюда 2 вопроса: 1. Что делаю не так? 2. Почему измененный файл featured.twig отображается только в Истории редактора шаблонов, а когда "тыкаю" на этот файл в списке выбора или открываю непосредственно на сервере, то там этот файлик лежит без изменений? Как вообще тут правильно вносить изменения? Заранее благодарю всех, кто дельно откликнется!
Guest
×
  • 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.