Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

I want to make an additional filter for the category. you bring 2 attributes to the top of the page and make them horizontally. The same attributes will remain in the vertical filter as well. Is it possible to do this? I'm using Magento 2.3.1

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top