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

Тип товара. Где настраиваесят?


Recommended Posts

Здравствуйте. 

Подскажите, пожалуйста, где настраиваются (редактируются/добавляются) типы товаров и все остальное от них производное. 

123.png

Link to comment
Share on other sites

Ясно, хотя бы на это свет пролили. 

 

 

Автора допила нет, не будет, и никто не знает где он))

Где примерно искать допил? Можете подсказать? 

Edited by odorlega
Link to comment
Share on other sites

Чекнул f12 нашел по пути tpl view/catalog/product_form

 

Там такой допил нашел

Спойлер
              <div class="form-group">
                <label class="col-sm-2 control-label" for="input-product-type">Тип товара</label>
                <div class="col-sm-10">
                  <select id="input-product-type" name="product_type" class="form-control">
                    <option value="">---</option>
                    <option value="scroll" <?php echo ($product_type == 'scroll') ? 'selected="selected"' : '' ; ?> >Свиток</option>
                    <option value="book" <?php echo ($product_type == 'book') ? 'selected="selected"' : '' ; ?>>Книга</option>
                  </select>
                </div> 
              </div>
              <div class="form-group scroll-type" <?php echo($product_type != 'scroll') ? 'style="display: none"' : '' ; ?>>
                <label class="col-sm-2 control-label" for="input-scroll-type">Тип свитка</label>
                <div class="col-sm-10">
                  <select id="input-scroll-type" name="scroll_type" class="form-control">
                    <option value="">---</option>
                    <option value="vertical" <?php echo ($scroll_type == 'vertical') ? 'selected="selected"' : '' ; ?> >Вертикальный</option>
                    <option value="horizontal" <?php echo ($scroll_type == 'horizontal') ? 'selected="selected"' : '' ; ?>>Горизонтальный</option>
                  </select>
                </div> 
              </div>

 

 

Лезу дальше... в controller/catalog/product

По name="product_type" ищу... нахожу.

Спойлер
if(isset($this->request->post['product_type'])) {
			$data['product_type'] = $this->request->post['product_type'];
		} elseif (!empty($product_info)) {
			$data['product_type'] = $product_info['product_type'];
		} else {
			$data['product_type'] = '';
		}

 

 

Лезем в модель по $this->request->post['product_type']

Там нашел раз:

Спойлер
<?php
class ModelCatalogProduct extends Model {
	public function addProduct($data) {
		$this->event->trigger('pre.admin.product.add', $data);

		$this->db->query("INSERT INTO " . DB_PREFIX . "product SET model = '" . $this->db->escape($data['model']) . "', sku = '" . $this->db->escape($data['sku']). "', product_type = '" . $this->db->escape($data['product_type']). "', scroll_type = '" . $this->db->escape($data['scroll_type']) . "', 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']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', price = '" . (float)$data['price'] . "', points = '" . (int)$data['points'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . (int)$data['tax_class_id'] . "', sort_order = '" . (int)$data['sort_order'] . "', date_added = NOW()");

		$product_id = $this->db->getLastId();
      
      
      //...код продолжается...

 

 

И два:

Спойлер
//.. вырезано из кода
public function editProduct($product_id, $data) {
		$this->event->trigger('pre.admin.product.edit', $data);

		$this->db->query("UPDATE " . DB_PREFIX . "product SET model = '" . $this->db->escape($data['model']) . "', sku = '" . $this->db->escape($data['sku']). "', product_type = '" . $this->db->escape($data['product_type']). "', scroll_type = '" . $this->db->escape($data['scroll_type']) . "', 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']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', price = '" . (float)$data['price'] . "', points = '" . (int)$data['points'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . (int)$data['tax_class_id'] . "', sort_order = '" . (int)$data['sort_order'] . "', date_modified = NOW() WHERE product_id = '" . (int)$product_id . "'");

//...вырезано из кода

 

 

 

 

Как я из всего этого понимаю, мне наверное даже дописывать ничего нового не нужно, достаточно будет в product_form.tpl дописать новые значения? Или не правильно понял?

Edited by odorlega
Link to comment
Share on other sites

А еще мне теперь нужно понять откуда пришло $scroll_count в public_html/catalog/view/theme/МОЯ_ТЕМА/template/mail/order.tpl =_=

 

 

>_< нашел...

public_html/catalog/model/checkout/order.php

Edited by odorlega
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.