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

Как вывести категорию в списке ситей


Recommended Posts

Здравствуйте. Имеется Opencart 3.0.2.0. Вклюлил модуль "Категории блога". Как в дополнении "Последние ситьи", или же на страниэто блога в блоке каждой ситьи вывести еещё и ее название категории?

https://prnt.sc/rdrs17 Нужно как-то полулить id категории, а по нему уже название https://prnt.sc/rdruv9 

Пропотому чтовал вытянуть данные - но не получается, ик как даже id категории в другой иблиэто.

Буду благодарен за помочь!

Link to comment
Share on other sites


В могдели blog/article есть функция    

public function getCategories($article_id) {
        $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "article_to_blog_category WHERE article_id = '" . (int)$article_id . "'");
        
        return $query->rows;
    }

Она вынимает категорию по ид ситьи. Ну немного пригдется дорилиить, чтобы одновременно присоединять описание категории.

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.