0

I have a category called perfume in my website. I manage to show the default filter in the left side of this category. I want to add the same default filter in the product detail page only for the perfume category products.

List Page enter image description here

Details Page enter image description here

I updated the edit cateogry > custom design > custom Layout Update with below lines.

<reference name="product_list">
<action method="setTemplate"><template>catalog/product/perfume.phtml</template></action>
</reference>
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/perfume-view.phtml</template></action>
</reference>
<remove name="left.newsletter" />

How can i add this filter in the perfume category product details page?

8
  • you want to show layered navigation on product view page? Jan 26, 2016 at 13:26
  • Yes @QaisarSatti.I want to show the same left side shopping option like list page
    – Mujahidh
    Jan 26, 2016 at 13:29
  • That are not possible because layered navigation need collection. Jan 26, 2016 at 13:42
  • @QaisarSatti.hope you understood my requirement.so there is no any methods to perform this?
    – Mujahidh
    Jan 26, 2016 at 14:19
  • Can you explain what you want to filter by when only viewing one product? Unfortunately what you are trying to do makes no sense.
    – ProxiBlue
    Jan 26, 2016 at 14:44

1 Answer 1

1

I managed to do the task by adding some code in to Custom Layout Update of the product.

<reference name="left">
<block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>
</reference>

Now i can view the layered navigation on my specific product page. for the full functionality(Search n filter) of the layered navigation in the product detail page i edit the filter.phtml -app\design\frontend\base\default\template\catalog\layer\) - url for the label link.

<ol>
<?php $baseUrl = Mage::getBaseUrl(); ?>
<?php foreach ($this->getItems() as $_item): ?>
<li>
    <?php if ($_item->getCount() > 0): ?>
    <?php 
        $urls =  explode("?",$this->urlEscape($_item->getUrl())); 

        $new_url = $baseUrl."perfume.html?".$urls[1];
    ?>
    <?php /*?><a href="<?php echo $this->urlEscape($_item->getUrl()) ?>"><?php echo $_item->getLabel() ?></a><?php */?>

    <a href="<?php echo $new_url ?>"><?php echo $_item->getLabel() ?></a>
    <?php else: echo $_item->getLabel() ?>
    <?php endif; ?>
    <?php if ($this->shouldDisplayProductCount()): ?>
    (<?php echo $_item->getCount() ?>)
    <?php endif; ?>
</li>
<?php endforeach ?>
</ol>

Please Kindly Notice that is based on my requirement i did it.I want the layered navigation on only one specific category's(Perfume) product detail page.

I hope this will help to some one in future.

10
  • did you add the collection or just simply adding by that? Jan 28, 2016 at 11:50
  • I did not do anything to my perfume-view.phtml. I update the Custom Layout Update as in the answer.for the search function completion i did the little change on filter.phtml(app\design\frontend\base\default\template\catalog\layer)
    – Mujahidh
    Jan 28, 2016 at 11:54
  • you remove the product check from there? Jan 28, 2016 at 11:55
  • what do you mean by product Check?
    – Mujahidh
    Jan 28, 2016 at 11:58
  • there were a check if product count greater then zero.. Jan 28, 2016 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.