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

Вывод доп. данных товара на странице категории


alezandro
 Share

Recommended Posts

Привет. Подскажите пожалуйста, как организовать вывод дополнительных данных на странице категории и на странице товара.

Т.е. в идеале хотелось бы добавить новое поле для заполнения при создании товара в админке, занчение и название котрого потом выводить на сайте. Впрочем можно для этого приспособить неиспользуемое поле UPC, но как его вывести и на странице категории и на странице товара пока не разобрался.

Link to comment
Share on other sites


  • 2 months later...

Если еще актуально, то на странице товара его можно вывести вот так <?php echo $product_info['upc']; ?>. А вот как на странице категорий не понятно, Еще я его вывел в модуле рекомендуемых: для этого надо в контроллере рекомендуемых добавить

$this->data['products'][] = array(

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

'thumb' => $image,

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

'bonus' => $product_info['upc'],

'price' => $price,

'special' => $special,

'rating' => $rating,

'reviews' => sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']),

'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']),

);

и в шаблоне модуля избранного вставить <?php echo $product['bonus']; ?> в нужное место

Link to comment
Share on other sites


Поидее чтобы выести и в категориях надо в контроллере категорий вставить в этом месте, что-то типо вот этого 'bonus' => $product_info['upc'], Но так не срабатывает. Не могу понять как в этот массив загнать значение поля UPC.

$this->data['products'][] = array(

'product_id' => $result['product_id'],

'thumb' => $image,

'name' => $result['name'],

'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',

'price' => $price,

'bonus' => $product_info['upc'],

'special' => $special,

'tax' => $tax,

'rating' => $result['rating'],

'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),

'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'])

);

Link to comment
Share on other sites


  • 11 months later...

category.php  в контроллере

$this->data['products'][] = array(,

         'upc'         => $result['upc']         //добавили, где-то 208 строка
);

 

 

в шаблоне категории

<?php echo $product['upc']; ?>

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.