Magento Layered Navigation “You cannot define a correlation name 'mycustomattribute' more than once ”

后端 未结 7 469
广开言路
广开言路 2021-01-17 10:27

I\'m using Magento\'s layered navigation with my custom attributes and price. If I filter by price it works; but when filtering by my custom attributes it shows:

相关标签:
7条回答
  • 2021-01-17 10:54

    Had a similar issue on an Enterprise build, so posting for anyone else that needs it - turned out I had to use the following in order to get it to work:

    <remove name="enterprisecatalog.leftnav" />
    
    0 讨论(0)
  • 2021-01-17 10:59

    im my case i have to get ride the block that whas type="catalog/layer_view" from local.xml and catalog.xml and put my modified type="catalog/layer_view" block . be sure there is only one block that contain type="catalog/layer_view".

    0 讨论(0)
  • 2021-01-17 11:04

    I had <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/> twice. Deleted one line and fixed it.

    0 讨论(0)
  • 2021-01-17 11:05

    For me Dubbo's answer was right, but more specifically I found out that Magento Enterprise touches the catalog_category_layered xml node in the enterprise_search.xml file

    0 讨论(0)
  • 2021-01-17 11:11

    It is because catalog/layer_view module was called twice. You can search 'type="catalog/layer_view"' through your xml files. Remove the block you don't needed. Or change the type to another class

    0 讨论(0)
  • 2021-01-17 11:12

    This causes the same problem. -adding the same attribute to the sort twice when building a collection:

    ...
        ->addAttributeToSort('color', 'asc')
        ->addAttributeToSort('color', 'asc');
    

    NOTE: calling setCollection($this->getMyCollection); on the template caused my error, because 'color' was already added to the sort order as the default sort order.

    SOLUTION:a quick way to fix this is to remove the default sort order from the request after obtain the value:

    $this->getRequest()->setParam('order','');
    

    otherwise extend the Block and override the setCollection() method for your particular needs.

    0 讨论(0)
提交回复
热议问题