Para ter os selects de volta e não ter que ficar digitando
% edite os seguintes arquivos:
admin/controller/catalog/product.php a partir da linha 968 (estou usando o
DW)
altere este: "
Fabricante"
Código: Selecionar todos/*$this->load->model('catalog/manufacturer');
if (isset($this->request->post['manufacturer_id'])) {
$this->data['manufacturer_id'] = $this->request->post['manufacturer_id'];
} elseif (!empty($product_info)) {
$this->data['manufacturer_id'] = $product_info['manufacturer_id'];
} else {
$this->data['manufacturer_id'] = 0;
}
if (isset($this->request->post['manufacturer'])) {
$this->data['manufacturer'] = $this->request->post['manufacturer'];
} elseif (!empty($product_info)) {
$manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($product_info['manufacturer_id']);
if ($manufacturer_info) {
$this->data['manufacturer'] = $manufacturer_info['name'];
} else {
$this->data['manufacturer'] = '';
}
} else {
$this->data['manufacturer'] = '';
} */
por este:
Código: Selecionar todos$this->load->model('catalog/manufacturer');
$this->data['manufacturers'] = $this->model_catalog_manufacturer->getManufacturers();
if (isset($this->request->post['manufacturer_id'])) {
$this->data['manufacturer_id'] = $this->request->post['manufacturer_id'];
} elseif (!empty($product_info)) {
$this->data['manufacturer_id'] = $product_info['manufacturer_id'];
} else {
$this->data['manufacturer_id'] = 0;
}
Categorias: linha 1004
este:
Código: Selecionar todos// Categories
/* $this->load->model('catalog/category');
if (isset($this->request->post['product_category'])) {
$categories = $this->request->post['product_category'];
} elseif (isset($this->request->get['product_id'])) {
$categories = $this->model_catalog_product->getProductCategories($this->request->get['product_id']);
} else {
$categories = array();
}
$this->data['product_categories'] = array();
foreach ($categories as $category_id) {
$category_info = $this->model_catalog_category->getCategory($category_id);
if ($category_info) {
$this->data['product_categories'][] = array(
'category_id' => $category_info['category_id'],
'name' => ($category_info['path'] ? $category_info['path'] . ' > ' : '') . $category_info['name']
);
}
}*/
por este:
Código: Selecionar todos$this->load->model('catalog/category');
$this->data['categories'] = $this->model_catalog_category->getCategories(0);
if (isset($this->request->post['product_category'])) {
$this->data['product_category'] = $this->request->post['product_category'];
} elseif (isset($this->request->get['product_id'])) {
$this->data['product_category'] = $this->model_catalog_product->getProductCategories($this->request->get['product_id']);
} else {
$this->data['product_category'] = array();
}
Agora em
admin/view/template/catalog/product_form.tpl a partir da linha 225
este:
Fabricantes
Código: Selecionar todos<td>
<!-- <input type="text" name="manufacturer" value="<?php echo $manufacturer ?>" /><input type="hidden" name="manufacturer_id" value="<?php echo $manufacturer_id; ?>" />-->
</td>
por este
Código: Selecionar todos<select name="manufacturer_id">
<option value="0" selected="selected"><?php echo $text_none; ?></option>
<?php foreach ($manufacturers as $manufacturer) { ?>
<?php if ($manufacturer['manufacturer_id'] == $manufacturer_id) { ?>
<option value="<?php echo $manufacturer['manufacturer_id']; ?>" selected="selected"><?php echo $manufacturer['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $manufacturer['manufacturer_id']; ?>"><?php echo $manufacturer['name']; ?></option>
<?php } ?>
<?php } ?>
</select>
Categorias: na linha 240
por este
Código: Selecionar todos<td><div class="scrollbox">
<?php $class = 'odd'; ?>
<?php foreach ($categories as $category) { ?>
<?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
<div class="<?php echo $class; ?>">
<?php if (in_array($category['category_id'], $product_category)) { ?>
<input type="checkbox" name="product_category[]" value="<?php echo $category['category_id']; ?>" checked="checked" />
<?php echo $category['name']; ?>
<?php } else { ?>
<input type="checkbox" name="product_category[]" value="<?php echo $category['category_id']; ?>" />
<?php echo $category['name']; ?>
<?php } ?>
</div>
<?php } ?>
</div></td>
Pronto, só isso, aqui está funcionando muito bem mesmo depois também de editar o produto.
Para não acontecer erros faça antes um bkp dos arquivos a serem alterados e preste muita atenção e vc terá sucesso.
Até logo.