RSS

Monthly Archives: March 2012

How do I get a list of active filters?

<?php /*Create filter dependencies*/

$_activeFilters[] = array();

$_filters = Mage::getSingleton(‘Mage_Catalog_Block_Layer_State’)->getActiveFilters();

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; ?>

 

in this way you can get list of all active filters and placed them any catalog template files..

 

 
2 Comments

Posted by on Mar 30, 2012 in Magento, PHP

 

Tags: , , , , , , , , ,

How to call core template file in magento

1) For calling a core template file in .phtml file

<?php echo $this->getLayout()->createBlock(‘core/template’)->setTemplate(‘templateFolder/yourtemplate.phtml’)->toHtml(); ?>

2) For calling a core template file in CMS page

{{block type=”core/template” template=”templateFolder/your_template.phtml”}}

 
Leave a comment

Posted by on Mar 27, 2012 in Magento, PHP

 

Tags: , , ,

 
%d bloggers like this: