for category page
<?php
$_filters = Mage::getSingleton('catalog/layer')->getState()->getFilters();
foreach ($_filters as $_filter):?>
<?php echo $this->stripTags($_filter->getLabel()) ?><a href=”<?php echo $_filter->getRemoveUrl() ?>” title=”<?php echo $this->__('Remove This Item') ?>”><?php echo $this->__('Remove This Item') ?></a>
<?php endforeach; ?>
for search page
<?php
$_filters = Mage::getSingleton('catalogsearch/layer')->getState()->getFilters();
foreach ($_filters as $_filter):?>
<?php echo $this->stripTags($_filter->getLabel()) ?><a href=”<?php echo $_filter->getRemoveUrl() ?>” title=”<?php echo $this->__('Remove This Item') ?>”><?php echo $this->__('Remove This Item') ?></a>
<?php endforeach; ?>
or you want to show only the current filter state use this code
for category page
<?php echo $this->getLayout()->createBlock('catalog/layer_state')->setTemplate('catalog/layer/state.phtml')->toHtml(); ?>
for search result
<?php echo Mage::app()->getLayout()->createBlock('catalogsearch/layer')->setTemplate('catalog/layer/state.phtml')->toHtml(); ?>
Comments
Post a Comment