2

I have two blocks of the same type on the category page, set in local.xml:

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

When using the category filter an error is thrown:

You cannot define a correlation name 'attribute_2_idx' more than once

I understand from multiple sources that it is because the category page has two blocks of the same navigation.

But my design requires that I have two different filter areas on the category page.

All other resolutions I've found say to just remove one of the blocks - this is not an option in this scenario.

Any ideas? Thanks.

2

I fixed this by removing my block creation in local.xml, and instead appended the existing filter block, like this:

<action method="append"><block>catalog.leftnav</block></action>

And then output in my relevant phtml file, like this:

<?php echo $this->getChildHtml('catalog.leftnav') ?>

Obvious really, just so easy to overlook.

  • Or you could also just do: <?php echo $this->getLayout()->getBlock('catalog.leftnav')->toHtml(); ?> – user2565123 Jun 28 '15 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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