Я знаю, что эта тема старая, но это может кому-то помочь - работает в Magento 1.9. Это было бы лучше, как модуль, но это "быстрое решение". Сделайте резервную копию всех файлов перед загрузкой. Мне нужно было добавить идентификатор продукта (от> до) и раскрывающееся поле "Производитель", но его можно легко принять для большинства типов атрибутов.
FOR System> Импорт / экспорт> DataProfiles> Экспорт всех продуктов
Приложение / код / ядро / Mage / Каталог / Модель / Преобразовать / адаптер / product.php
скопировать в
Приложение / код / 1010 * местные * / Mage / Каталог / Модель / Преобразовать / адаптер / product.php
НАЙТИ публичная функция загрузки ()
Добавьте атрибуты к $ attrFilterArray = array ();
$attrFilterArray = array();
$attrFilterArray ['name'] = 'like';
$attrFilterArray ['entity_id'] = 'fromTo'; //Custom Field
$attrFilterArray ['manufacturer'] = 'eq'; //Custom Field
$attrFilterArray ['sku'] = 'startsWith';
$attrFilterArray ['type'] = 'eq';
$attrFilterArray ['attribute_set'] = 'eq';
$attrFilterArray ['visibility'] = 'eq';
$attrFilterArray ['status'] = 'eq';
$attrFilterArray ['price'] = 'fromTo';
$attrFilterArray ['qty'] = 'fromTo';
$attrFilterArray ['store_id'] = 'eq';
Если type = " fromTo ", вам нужно добавить дополнительный фильтр до return parent :: load ();
Следующее для entity_id
if ($productId = $this->getFieldValue($filters, 'entity_id')) {
$this->_filter[] = array(
'attribute' => 'entity_id',
'from' => $productId['from'],
'to' => $productId['to']
);
$this->setJoinAttr(array(
'alias' => 'entity_id',
'attribute' => 'catalog_product/entity_id',
'bind' => 'entity_id',
'joinType' => 'LEFT'
));
}
Добавить поля в форму
приложение / дизайн / adminhtml / по умолчанию / по умолчанию / шаблон / система / преобразования / профиль / wizard.phtml
Дублировать как резервную копию
Найти
<div class="profile_entity_type_product">
Добавить дополнительные наборы полей в этот div
Следующее относится к fromTo для идентификатора сущности
<span class="field-row">
<label for="product_filter_entity_id_from"><?php echo $this->__("Product ID:") ?></label>
<input class="input-text" style="width:5em" id="product_filter_entity_id_from" name="gui_data[product][filter][entity_id][from]" value="<?php echo $this->getValue('gui_data/product/filter/entity_id/from') ?>"/> <?php echo $this->__('to') ?>
<input class="input-text" style="width:5em" id="product_filter_entity_id_to" name="gui_data[product][filter][entity_id][to]" value="<?php echo $this->getValue('gui_data/product/filter/entity_id/to') ?>"/>
</span>
Ниже приведено описание выпадающего списка
.
<span class="field-row">
<label for="product_filter_manufacturer"><?php echo $this->__("Manufacturer Name:") ?></label><select id="product_filter_manufacturer" name="gui_data[product][filter][manufacturer]">
<?php $manufacturer = Mage::getSingleton('eav/config')->getAttribute('catalog_product','manufacturer')->getSource()->getAllOptions(); ?>
<?php foreach ($manufacturer as $option): ?>
<option value="<?php echo $option['value'] ?>" <?php echo $this->getSelected('gui_data/product/filter/manufacturer', $option['value']) ?>><?php echo htmlspecialchars($option['label']) ?></option>
<?php endforeach ?>
</select>