Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working in Magento 2.3.2 #7

Open
aljosamotore opened this issue Aug 10, 2019 · 4 comments
Open

Not working in Magento 2.3.2 #7

aljosamotore opened this issue Aug 10, 2019 · 4 comments
Labels

Comments

@aljosamotore
Copy link

PHP Fatal error: Uncaught Error: Call to undefined method Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor::getAddedFilters() in /SY/MultipleLayeredNavigation/Model/Layer/Filter/Category.php

@Abby724
Copy link

Abby724 commented Mar 5, 2020

PHP Fatal error: Uncaught Error: Call to undefined method Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor::getAddedFilters() in /SY/MultipleLayeredNavigation/Model/Layer/Filter/Category.php

Hi, did you finally solve this problem?

@SlavaYurthev
Copy link
Owner

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
...
<preference for="Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection" type="SY\MultipleLayeredNavigation\Model\ResourceModel\Fulltext\Collection" />
...
</config>

@bilizz
Copy link

bilizz commented May 1, 2020

This is ok solution for category view, but in case of using search option, I get the same error:

/catalogsearch/result/?q=something

AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined method Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor::getAddedFilters() in /home/dev/domains/dev.petka-delta.si/public_html/app/code/SY/MultipleLayeredNavigation/Model/Layer/Filter/Category.php:70\nStack trace:\n#0 /home/dev1/domains/dev1.petka-delta.si/public_html/vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php(202): SY\MultipleLayeredNavigation\Model\Layer\Filter\Category->_getItemsData()\n#1 /home/dev1/domains/dev1.petka-delta.si/public_html/vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php(159): Magento\Catalog\Model\Layer\Filter\AbstractFilter->_initItems()\n#2 /home/dev1/domains/dev1.petka-delta.si/public_html/vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php(148): Magento\Catalog\Model\Layer\Filter\AbstractFilter->getItems()\n#3 /home/dev1/domains/dev1.petka-delta.si/public_html/vendor/magento/module-catalog/Model/Layer/Category/AvailabilityFlag.p...

@SlavaYurthev
Copy link
Owner

SlavaYurthev commented May 24, 2020

In a both cases:

di.xml

<type name="Magento\Catalog\Model\Layer\Context">
	<plugin name="collectionProvider" type="SY\MultipleLayeredNavigation\Plugin\Catalog\Model\Layer\Context" sortOrder="1" />
</type>

Plugin\Catalog\Model\Layer\Context.php

<?php 
namespace SY\MultipleLayeredNavigation\Plugin\Catalog\Model\Layer;
class Context {
	protected $_collectionProvider;
	public function __construct(
		\SY\MultipleLayeredNavigation\Model\Layer\ItemCollectionProvider $collectionProvider
	){
		$this->_collectionProvider = $collectionProvider;
	}
	public function afterGetCollectionProvider($subject){
		return $this->_collectionProvider;
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants