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

[Решено] Вывести модель в Рекомендуемые


 Share

Recommended Posts

Здравствуйте, помогите). Не могу вывести модель из админки в рекомендуемые (модуль). opencart 2

Сделал следующее 

В файле featured.php  

после 'name'        => $product_info['name'],    прописал    'model'        => $result['model'],   

и вывел в tpl так <?php echo $product['model']; ?>

 

Не работает. Видимо работает только до версий 1.5. или у меня руки кривые. Помогите правильно сделать

Link to comment
Share on other sites


  • 10 months later...

Доброго времени. У меня похожая проблема, только не в модуле вывести это надо.

Как правильно вывести модель в "Рекомендуемые товары", которые мы добавляем в редактировании товара, вкладка "связи"?

Я сделал так:

1. В "/catalog/controller/product/product.php" добавил после

$data['products'][] = array(
					'product_id'  => $result['product_id'],
					'thumb'       => $image,
					'name'        => $result['name'],

Вот такое

'model'   	=> $product_info['model'],

2. В "/catalog/view/theme/storeset/template/product/product_related.tpl" добавил в нужное место

<?php echo $text_model; ?><?php echo $product['model']; ?>

3. В "/catalog/view/theme/storeset/template/product/product.tpl" добавил в нужное место после

<?php foreach ($products as $product) { ?>

Такой код:

<?php echo $text_model; ?><?php echo $product['model']; ?>

 

Языки подключены.

В итоге получилось так: "Код товара:Notice: Undefined index: model in ...../catalog/view/theme/storeset/template/product/product_related.tpl on line 49"

Но, есть какой-то прикол: Допустим, у меня три товара связаны между собой.

Открываю первый товар, такая ошибка (что выше указана). Обновляю страницу, без изменений.

Открываю второй товар, такая же ошибка, обновляю страницу, отображает всё правильно.

Открываю третий товар, сказу всё правильно и после обновления страницы тоже.

Кэш модификаторов чистил, естественно. У разработчиков шаблона узнавал, сторонние модификаторы не меняют ничего в файлах, которые я правил.

Кто сможет помочь? Скрины прилагаю.

Скрин-1_(Косячный)

Скрин-2_(Рабочий)

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.