show new entery input value from manufactor admin to manufactor in frontpage tpl
Posted: Thu Sep 12, 2019 1:29 pm
I added 2 new input to opencart admin controller for manufactor-info page and add a column to database manufactor table and add some code in model. i want to get the value from the input and show it on front-end of manufactor page. But the value of input when user set value or text/url value not save on input and when I echo the value nothings show up
this is my code for admin manufactor.php controller file .
language data
$data['entry_linktolid'] = $this->language->get('entry_linktolid'); $data['entry_khadamat'] = $this->language->get('entry_khadamat');
$data['help_linktolid'] = $this->language->get('help_linktolid');
$data['help_khadamat'] = $this->language->get('help_khadamat');
then add this to manufactor.php
if (isset($this->request->post['linktolid'])) {
$data['linktolid'] = $this->request->post['linktolid'];
} elseif (!empty($product_info)) {
$data['linktolid'] = $product_info['linktolid'];
} else {
$data['linktolid'] = '';
}
if (isset($this->request->post['khadamat'])) {
$data['khadamat'] = $this->request->post['khadamat'];
} elseif (!empty($product_info)) {
$data['khadamat'] = $product_info['khadamat'];
} else {
$data['khadamat'] = '';
}
and in the model file i added this
$this->db->query("UPDATE " . DB_PREFIX . "manufacturer SET name = '" . $this->db->escape($data['name']) . "', description = '" . $this->db->escape($data['information_description']) . "', sort_order = '" . (int)$data['sort_order'] . "' WHERE manufacturer_id = '" . (int)$manufacturer_id . "'"). "', linktolid = '" . $this->db->escape($data['linktolid']). "', khadamat = '" . $this->db->escape($data['khadamat']);
I wanted to value of input that we insert save in db and define it as variable and echo it on front end
this is my code for admin manufactor.php controller file .
language data
$data['entry_linktolid'] = $this->language->get('entry_linktolid'); $data['entry_khadamat'] = $this->language->get('entry_khadamat');
$data['help_linktolid'] = $this->language->get('help_linktolid');
$data['help_khadamat'] = $this->language->get('help_khadamat');
then add this to manufactor.php
if (isset($this->request->post['linktolid'])) {
$data['linktolid'] = $this->request->post['linktolid'];
} elseif (!empty($product_info)) {
$data['linktolid'] = $product_info['linktolid'];
} else {
$data['linktolid'] = '';
}
if (isset($this->request->post['khadamat'])) {
$data['khadamat'] = $this->request->post['khadamat'];
} elseif (!empty($product_info)) {
$data['khadamat'] = $product_info['khadamat'];
} else {
$data['khadamat'] = '';
}
and in the model file i added this
$this->db->query("UPDATE " . DB_PREFIX . "manufacturer SET name = '" . $this->db->escape($data['name']) . "', description = '" . $this->db->escape($data['information_description']) . "', sort_order = '" . (int)$data['sort_order'] . "' WHERE manufacturer_id = '" . (int)$manufacturer_id . "'"). "', linktolid = '" . $this->db->escape($data['linktolid']). "', khadamat = '" . $this->db->escape($data['khadamat']);
I wanted to value of input that we insert save in db and define it as variable and echo it on front end