문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top