How to fix incompatible issue with M2.4.0?

Created by Support Agent, Modified on Fri, 3 Apr at 5:49 AM by Support Agent

QUESTION:

I installed the module version 2.2.6 on Magento 2.4, the command bin/magento setup:di:compile shows: 

Fatal error:  Uncaught Error: Class 'Magento\CatalogSearch\Model\Search\FilterMapper\ExclusionStrategy' not found in /app/code/Bss/MultiStoreViewPricing/Model/Search/FilterMapper/ExclusionStrategy.php:26

Can you tell me how to fix it?


ANSWER:

The issue due to the fact that the module is not compatible with Magento 2.4 


The solution as below:


Step 1: Plese remove code    <preference for="Magento\CatalogSearch\Model\Search\FilterMapper\ExclusionStrategy" type="Bss\MultiStoreViewPricing\Model\Search\FilterMapper\ExclusionStrategy" /> in file app/code/Bss/MultiStoreViewPricing/etc/frontend/di.xml


Step 2:  Remove file
app/code/Bss/MultiStoreViewPricing/Model/Search/FilterMapper/ExclusionStrategy.php


After the fix above, there is another error shown:


Fatal error:  Uncaught Error: Class 'Magento\CatalogSearch\Model\Adapter\Mysql\Dynamic\DataProvider' not found in app/code/Bss/MultiStoreViewPricing/Model/CatalogSearch/Adapter/Mysql/Dynamic/DataProvider.php:34
Stack trace:
#0 /var/www/xxx/xxxx/xxxx/vendor/composer/ClassLoader.php(444): include()
#1 /var/www/xxx/xxx/xxxxx/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/var/www/vhosts...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Bss\\MultiStoreV...')
#3 [internal function]: spl_autoload_call('Bss\\MultiStoreV...')
#4 /var/www/xxxx/xxxx/xxxx/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(134): class_exists('Bss\\MultiStoreV...')
#5 /var/www/xxxxx/xxxx/xxxxx/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(117): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->includeClass('Bss\\MultiStoreV...', '/var/www/vhosts...')
#6 /var/www/vhosts in /var/www/xxxx/xxxxx/xxxx/app/code/Bss/MultiStoreViewPricing/Model/CatalogSearch/Adapter/Mysql/Dynamic/DataProvider.php on line 34 


Step 3: Please remove code:
<preference for="Magento\Framework\Search\Dynamic\DataProviderInterface" type="Bss\MultiStoreViewPricing\Model\CatalogSearch\Adapter\Mysql\Dynamic\DataProvider" />
in file app/code/Bss/MultiStoreViewPricing/etc/di.xml.

Step 4: Remove file
app/code/Bss/MultiStoreViewPricing/Model/CatalogSearch/Adapter/Mysql/Dynamic/DataProvider.php


If you have any other question or concern, please feel free to leave us a message via https://bsscommerce.com/contact

We'd be happy to support.


BSS Commerce is a full-service ecommerce agency with 14+ years of experience, supporting 75,000+ customers worldwide. As an Adobe Commerce Solution Bronze Partner and Select Magento Extensions Builder, we deliver trusted end-to-end solutions.


Our core strength is Magento, with 150+ extensions designed to enhance store performance and drive growth. With deep expertise from years of working on Magento websites, we deliver scalable, high-impact solutions backed by strong client trust.


Discover our extensions: https://bsscommerce.com/magento-2-extensions.html 


Our Magento B2B Extension by BSS Commerce is a flagship, widely used global solution, providing an all-in-one system for pricing, account management, and efficient B2B workflows. 





Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article