3

Currently I am on Magento 2.4.2 which was upgraded from 2.3.0. The issue which I am facing right now is that I am not able to see any products displayed on category page.

After debugging the below file:

Magento\Elasticsearch\Model\Layer\Category\ItemCollectionProvider

and below function in the above path:

public function getCollection(\Magento\Catalog\Model\Category $category)

I found the collection query which is as below:

SELECT `e`.* FROM `catalog_product_entity` AS `e` WHERE (NULL)

I guess WHERE(NULL) condition might be the culprit here.

Any idea why am I getting this WHERE(NULL) condition and any suggestions to resolve this

6
  • there could be several reasons for product not getting displayed 1st one and most common is reindexing also make sure that your elasticsearch configuration are coorect and working? please confirm
    – Pramod
    Jun 18, 2021 at 10:45
  • Yes have indexed too and elastic search configuration are correct as well.. but cant get rid of products not displaying
    – Nisith
    Jun 18, 2021 at 10:54
  • @Nisith check is there any third party extension which may affect the sql query. Try disabling third party extensions. Jun 18, 2021 at 11:46
  • facing the same issue, I've disabled all the modules but it doesn't work. May 27 at 18:33
  • @VirangJethva HAve you found any solution
    – Pawankumar
    May 30 at 8:55

1 Answer 1

0
  • Disable the third-party modules.
  • Make sure elasticsearch is up and running
  • Run the below query to see if is there any issue with backend_type in attributes

Show misconfigured attributes:

SELECT *
FROM catalog_eav_attribute cea 
JOIN eav_attribute ea
ON ea.attribute_id = cea.attribute_id 
AND backend_type IN ('text')
WHERE 
cea.is_filterable = 1 OR cea.is_filterable_in_search = 1

Set is_filterable to 0 to allow category pages to load.

UPDATE catalog_eav_attribute cea 
JOIN eav_attribute ea
ON ea.attribute_id = cea.attribute_id 
AND backend_type in ('text')
SET 
cea.is_filterable = 0, cea.is_filterable_in_search = 0
WHERE 
cea.is_filterable = 1 OR cea.is_filterable_in_search = 1

Reindex/Refresh Cache

magento indexer:reindex
magento cache:clean
magento cache:flush

Original Answer Credit Source : https://magento.stackexchange.com/a/322623/27583

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.