Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

show magento layer state on catalog listing (not on sidebar)

Tags:

php

magento

Is there a way I could load filter layer state on the content area just below the page titleenter image description here

I've tried several ways like including template/catalog/layer/state.phtml into template/catalog/product/list.phtml, adding below snippet on <reference name="content"> on catalog.xml

<block type="catalog/layer_view" name="catalog.leftnav" after="leftnav" template="catalog/layer/view.phtml"/>

nothing works... what should I do?

thanks before :)

like image 536
Kamal Avatar asked Nov 25 '11 22:11

Kamal


2 Answers

Here is quick fix: paste this in catalog/product/list.phtml

<?php echo $this->getLayout()->createBlock('catalog/layer_state')->setTemplate('catalog/layer/state.phtml')->toHtml(); ?>
like image 56
Rehan Mobin Avatar answered Oct 15 '22 07:10

Rehan Mobin


In page.xml search <block type="core/text_list" name="content" as="content" translate="label">:

Paste this code here (drawback: it will load in every content, will be better to find putting it within catalog pages block tag):

<block type="catalog/layer_state" name="catalog.layer.state" as="catalog.layer.state" template="catalog/layer/state.phtml"/>

Now incatalog/product/list.phtml file you can get this by:

<?php echo $this->getChildHtml('catalog.layer.state') ?>
like image 34
Md. Abdullah Al Mamun Avatar answered Oct 15 '22 08:10

Md. Abdullah Al Mamun