skip to Main Content

I am working on a magento project. it was working fine till today.but today when i open it its not working and following error is coming in error log

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to MagentoCatalogModelResourceModelProductCollection::addIsSaleableAttributeToFilter() must be of the type array or null, integer given, called in /home/olfwmbaph2hf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php on line 1582 and defined in /home/olfwmbaph2hf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php:2475

Stack trace:

0 /home/olfwmbaph2hf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php(1582): MagentoCatalogModelResourceModelProductCollection->addIsSaleableAttributeToFilter(1)

1 /home/olfwmbaph2hf/public_html/app/code/Smartwave/Filterproducts/Block/Home/LatestList.php(56): MagentoCatalogModelResourceModelProductCollection->addAttributeToFilter(‘is_saleable’, 1, ‘left’)

2 /home/olfwmbaph2hf/public_html/app/code/Smartwave/Filterproducts/Block/Home/LatestList.php(33): SmartwaveFilterproductsBlockHomeLatestList->getProducts()

3 /home/olfw in /home/olfwmbaph2hf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php on line 2475

can some please help to remove this issue

3

Answers


  1. Try following solution mentioned here Error after indexing after upgrade to 2.3.3

    I am getting this too after upgrading! However, if I change the theme used (Content -> Design -> Config) I can successfully view my site!

    Change the 1 (integer) into array
    $collection->addAttributeToFilter('is_saleable', 1, 'left')
    

    to this

    addAttributeToFilter('is_saleable', [1], 'left')
    

    in in /home/olfwmbaph2hf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php on line 1582

    Login or Signup to reply.
  2. This is Porto theme issue with newer version so, better please installed porto theme patch from their support site and install it.

    it will fix this issue.

    Login or Signup to reply.
  3. you using Porto theme with Magento 2.3.3 you need to update the latest patch follow this link to see more detail Check more detail on this website

    Do not edit core files updating this patch will solve your issue !

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search