Answer the question
In order to leave comments, you need to log in
How to display an article on the main page in opencart?
Hi all. How to display the incomplete text of the article on the main page in opencart with the "more" button at the bottom to go to the page of the article where the full text is already? In wordpress, I could put the separator where I needed in the editor and then display it in the right one using the_content(); , but in opencart I don't know how to do it.
PS I found such a solution, can I somehow change it so that the id is already passed in the template file itself? So I want to display several articles.
$this->load->language('information/information');
$this->load->model('catalog/information');
$information_id = 4;
$information_info = $this->model_catalog_information->getInformation($information_id);
$data['heading_title'] = $information_info['title'];
$data['description'] = html_entity_decode($information_info['description'], ENT_QUOTES, 'UTF-8');
$data['link_continue'] = $this->url->link('information/information', 'information_id=' . $information_id);
$data['button_continue'] = $this->language->get('button_continue');
Answer the question
In order to leave comments, you need to log in
Well, look, in OC - "model" is a file with query commands and result processing.
You "connect" it...
...and then call the method from there, passing the parameter to the function
$information_id = 4;
$information_info = $this->model_catalog_information->getInformation($information_id);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question