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

Добавление поля в админке


Recommended Posts

Добрый день.

Как добавить поле (такое же как и sku) в админке.

Что у меня не так?

Решил добавить поле qwe после поля mpn

для этого редактирую product_form.tpl по адресу admin\view\template\catalog

<div class="form-group<?php echo ($hide_mpn == true)? ' hide':''; ?>">
                <label class="col-sm-2 control-label" for="input-mpn"><span data-toggle="tooltip" title="<?php echo $help_mpn; ?>"><?php echo $entry_mpn; ?></span></label>
                <div class="col-sm-10">
                  <input type="text" name="mpn" value="<?php echo $mpn; ?>" placeholder="<?php echo $entry_mpn; ?>" id="input-mpn" class="form-control" />
                </div>
                </div>
                <!--ячейка qwe-->
                <div class="form-group<?php echo ($hide_qwe == true)? ' hide':''; ?>">
                <label class="col-sm-2 control-label" for="input-qwe"><span data-toggle="tooltip" title="<?php echo $help_qwe; ?>"><?php echo $entry_qwe; ?></span></label>
                <div class="col-sm-10">
                  <input type="text" name="qwe" value="<?php echo $qwe; ?>" placeholder="<?php echo $entry_qwe; ?>" id="input-qwe" class="form-control" />
                </div>
              </div>
              <!---->

далее редактирую product.php по адресу admin\controller\catalog

$data['entry_mpn'] = $this->language->get('entry_mpn');
$data['help_mpn'] = $this->language->get('help_mpn');
if (isset($this->request->post['mpn'])) {
			$data['mpn'] = $this->request->post['mpn'];
		} elseif (!empty($product_info)) {
			$data['mpn'] = $product_info['mpn'];
		} else {
			$data['mpn'] = '';
		}
if ($this->config->get('config_product_mpn_hide') != 0) {
			$data['hide_mpn'] = true;
		} else {
			$data['hide_mpn'] = false;
		}

после этих строчек добавляю такие же строчки и вместо mpn ставлю qwe

 

далее редактирую файл product.php  по адресу admin\language\ru-ru\catalog

$_['entry_mpn']          		= 'Адрес:';

копирую строку и заменяю на qwe

 

далее создаю б БД столбец qwe

 

 

В итоге в карточке товара во вкладке "Данные" так ничего не появилось. Что я пропустил?

 

Edited by Godik1985
Link to post
Share on other sites

изменил...добавил

public function editProduct($product_id, $data) {
		$this->db->query("UPDATE " . DB_PREFIX . "product SET 
model = '" . $this->db->escape($data['model']) . "', 
sku = '" . $this->db->escape($data['sku']) . "', 
upc = '" . $this->db->escape($data['upc']) . "', 
ean = '" . $this->db->escape($data['ean']) . "', 
jan = '" . $this->db->escape($data['jan']) . "', 
isbn = '" . $this->db->escape($data['isbn']) . "', 
mpn = '" . $this->db->escape($data['mpn']) . "', 
qwe = '" . $this->db->escape($data['qwe']) . "', 
location = '" . $this->db->escape($data['location']) . "', 
quantity = '" . (int)$data['quantity'] . "', 
minimum = '" . (int)$data['minimum'] . "', 
$this->db->query("INSERT INTO " . DB_PREFIX . "product SET 
model = '" . $this->db->escape($data['model']) . "', 
sku = '" . $this->db->escape($data['sku']) . "', 
upc = '" . $this->db->escape($data['upc']) . "', 
ean = '" . $this->db->escape($data['ean']) . "', 
jan = '" . $this->db->escape($data['jan']) . "', 
isbn = '" . $this->db->escape($data['isbn']) . "', 
mpn = '" . $this->db->escape($data['mpn']) . "', 
qwe = '" . $this->db->escape($data['qwe']) . "', 
location = '" . $this->db->escape($data['location']) . "', 

ничего не поменялось

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.