K
K
Kirill Michenus2017-01-30 19:37:14
PHP
Kirill Michenus, 2017-01-30 19:37:14

How to get page path by information_id?

There is information_id , as well as code:

$this->load->language('information/information');
$this->load->model('catalog/information');
$page = $this->model_catalog_information->getInformation($information_id);

How to get SEO URL?
After all, here print_r($page);
Array
(
    [information_id] => 9
    [bottom] => 0
    [sort_order] => 5
    [status] => 1
    [language_id] => 1
    [title] => Заголовок страницы
    [description] => ''
    [meta_title] => ''
    [meta_description] => 
    [meta_keyword] => 
    [store_id] => 0
)

he is not.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Michenus, 2017-01-30
@michenusweb

In general, I solved the issue in my own way:
Added a function to "catalog\model\catalog\information.php"

public function getInformationAdd($information_id) {
    $query = $this->db->query("SELECT DISTINCT *, (SELECT keyword FROM " . DB_PREFIX . "url_alias WHERE query = 'information_id=" . (int)$information_id . "') AS keyword FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE i.information_id = '" . (int)$information_id . "' AND id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND i.status = '1'");

    return $query->row;
  }

Calling out just in
now, when calling print_r
Array
(
    [information_id] => 9
    [bottom] => 0
    [sort_order] => 5
    [status] => 1
    [language_id] => 1
    [title] => 'Заголовок страницы'
    [description] => ''
    [meta_title] => 'Заголовок страницы в метатеге'
    [meta_description] => 
    [meta_keyword] => 
    [store_id] => 0
    [keyword] => 'zagolovok-stranitzi'
)

And [keyword] is the seo_url I need .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question