Цитата
<style>
<!--
.attrset li {
list-style:none;
float:left;
margin:0 2px 0 0;
}
-->
</style>
<div style="color:#FFFFFF;font-family:Arial,Helvetica,sans-serif;font-size:13pt;font-weight:bold;padding:15px 15px 7px 28px;text-transform:uppercase;">Подбор</div>
<div style="padding-left: 28px; font-size: 12px;">
<script type="text/javascript">
function show1(obj) {
no = obj.options[obj.selectedIndex].value;
count = obj.options.length;
for(i=1;i<=count;i++)
document.getElementById('podborchik'+i).style.display = 'none';
if(no>0)
document.getElementById('podborchik'+no).style.display = 'block';
}
</script>
<select onchange="show1(this)">
<option value="1">выбор...</option>
<option value="2">Фильтры</option>
<option value="3">Запорная Арматура</option>
<option value="4">Сигнализаторы Газа</option>
<option value="5">Клапаны (КЭИ)</option>
<option value="6">Счетчики Газа</option>
<option value="7">Регуляторы Давления</option>
</select>
<div id="podborchik1" style="display: block; padding-top: 8px;">Подбор оборудования по характеристикам</div>
<div id="po" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['rabochaya_sreda_podbor']) ):?>
<?php $_attribute = $attributes['rabochaya_sreda_podbor']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
<div id="podborchik2" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['prisoedinitelniy_razmer']) ):?>
<?php $_attribute = $attributes['prisoedinitelniy_razmer']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
<div id="podborchik3" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['prisoedinit_razmer_arm']) ):?>
<?php $_attribute = $attributes['prisoedinit_razmer_arm']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
<!--End of each accordion item-->
<div id="podborchik4" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['type_gaz']) ):?>
<?php $_attribute = $attributes['type_gaz']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
<div id="podborchik5" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['type_kei']) ):?>
<?php $_attribute = $attributes['type_kei']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
<div id="podborchik6" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['rashod_schetchik_gaza']) ):?>
<?php $_attribute = $attributes['rashod_schetchik_gaza']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
<div id="podborchik7" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['max_davlenie_filter1']) ):?>
<?php $_attribute = $attributes['max_davlenie_filter1']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
</div>
<?php echo $this->getChildHtml('topSearch') ?>
<?php /*?>
<fieldset class="group-select">
<h3 class="legend"><?php echo $this->__('Search') ?></h3>
<ul id="advanced-search-list">
<?php foreach ($this->getSearchableAttributes() as $_attribute): ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<?php switch($this->getAttributeInputType($_attribute)):
case 'select': ?>
<li>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute) ?>
</li>
<?php break;
default: ?>
<?php endswitch; ?>
<?php endforeach; ?>
</ul>
<script type="text/javascript">decorateList('advanced-search-list')</script>
<p class="required">* <?php echo $this->__('Required Fields') ?></p>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Search') ?></span></button>
</div>
</fieldset>
<?php */?>
<script type="text/javascript">
//<![CDATA[
var dataForm = new VarienForm('form-validate', true);
//]]>
</script>
<!--
.attrset li {
list-style:none;
float:left;
margin:0 2px 0 0;
}
-->
</style>
<div style="color:#FFFFFF;font-family:Arial,Helvetica,sans-serif;font-size:13pt;font-weight:bold;padding:15px 15px 7px 28px;text-transform:uppercase;">Подбор</div>
<div style="padding-left: 28px; font-size: 12px;">
<script type="text/javascript">
function show1(obj) {
no = obj.options[obj.selectedIndex].value;
count = obj.options.length;
for(i=1;i<=count;i++)
document.getElementById('podborchik'+i).style.display = 'none';
if(no>0)
document.getElementById('podborchik'+no).style.display = 'block';
}
</script>
<select onchange="show1(this)">
<option value="1">выбор...</option>
<option value="2">Фильтры</option>
<option value="3">Запорная Арматура</option>
<option value="4">Сигнализаторы Газа</option>
<option value="5">Клапаны (КЭИ)</option>
<option value="6">Счетчики Газа</option>
<option value="7">Регуляторы Давления</option>
</select>
<div id="podborchik1" style="display: block; padding-top: 8px;">Подбор оборудования по характеристикам</div>
<div id="po" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['rabochaya_sreda_podbor']) ):?>
<?php $_attribute = $attributes['rabochaya_sreda_podbor']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
<div id="podborchik2" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['prisoedinitelniy_razmer']) ):?>
<?php $_attribute = $attributes['prisoedinitelniy_razmer']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
<div id="podborchik3" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['prisoedinit_razmer_arm']) ):?>
<?php $_attribute = $attributes['prisoedinit_razmer_arm']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
<!--End of each accordion item-->
<div id="podborchik4" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['type_gaz']) ):?>
<?php $_attribute = $attributes['type_gaz']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
<div id="podborchik5" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['type_kei']) ):?>
<?php $_attribute = $attributes['type_kei']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
<div id="podborchik6" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['rashod_schetchik_gaza']) ):?>
<?php $_attribute = $attributes['rashod_schetchik_gaza']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
<div id="podborchik7" style="display: none;">
<form action="/catalogsearch/advanced/result/" method="get" id="form-validate">
<?php $attributes = $this->getAssosiatedAttributes(); // Get all searchable attributes ?>
<div>
<?php if( isset($attributes['max_davlenie_filter1']) ):?>
<?php $_attribute = $attributes['max_davlenie_filter1']; ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute,100) //width=100?>
<?php endif ?>
</div>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Подобрать') ?></span></button>
</div>
</form>
</div>
</div>
<?php echo $this->getChildHtml('topSearch') ?>
<?php /*?>
<fieldset class="group-select">
<h3 class="legend"><?php echo $this->__('Search') ?></h3>
<ul id="advanced-search-list">
<?php foreach ($this->getSearchableAttributes() as $_attribute): ?>
<?php $_code = $_attribute->getAttributeCode() ?>
<?php switch($this->getAttributeInputType($_attribute)):
case 'select': ?>
<li>
<label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label><br />
<?php echo $this->getAttributeSelectElement($_attribute) ?>
</li>
<?php break;
default: ?>
<?php endswitch; ?>
<?php endforeach; ?>
</ul>
<script type="text/javascript">decorateList('advanced-search-list')</script>
<p class="required">* <?php echo $this->__('Required Fields') ?></p>
<div class="buttons-set">
<button type="submit" class="button"><span><?php echo $this->__('Search') ?></span></button>
</div>
</fieldset>
<?php */?>
<script type="text/javascript">
//<![CDATA[
var dataForm = new VarienForm('form-validate', true);
//]]>
</script>
Но это, как говорит мой друг, гомнокод
хочется все реализовать несколько по иному
Вытянуть из конкретной папки в группе атрибутов - атрибуты и сделать расширенный поиск по блокам.
Вообщем переделать то что уже есть на более цивилизованное решение
Цитата
<?php
$attrSetName = 'Schetchiki';
$attributeSetId = Mage::getModel('eav/entity_attribute_set')->load($attrSetName, 'attribute_set_name')->getAttributeSetId();
$groupName = 'Optionsss';
$group = Mage::getModel ("eav/entity_attribute_group");
$attributesgroupid = $group->load ($groupName, 'attribute_group_name')->getAttributeGroupId();
var_dump ($group);
?>
$attrSetName = 'Schetchiki';
$attributeSetId = Mage::getModel('eav/entity_attribute_set')->load($attrSetName, 'attribute_set_name')->getAttributeSetId();
$groupName = 'Optionsss';
$group = Mage::getModel ("eav/entity_attribute_group");
$attributesgroupid = $group->load ($groupName, 'attribute_group_name')->getAttributeGroupId();
var_dump ($group);
?>
таким образом вытянул названия и ид атрибутсет и атрибут групп
как вытянуть из них атрибуты так и не нашел.
Прошу помочь с реализацией
Код выше полностью рабочий на всех версиях магенто - так что если кому нужен - пользуйтесь на здоровье