0

Maybe duplicate of other tickets but I couldn't found solutions in other questions.

I get no products in category in frontend, Products are in stocks and all other parameters are checked and they are perfect, After debugging I found that in following query if I manually remove following code

INNER JOIN
    `search_tmp_5cd96fa8932f95_44809536` AS `search_result`
ON
    e.entity_id = search_result.entity_id

then it is returning product list

Following is result of

 $_productCollection = $block->getLoadedProductCollection();
 echo $_productCollection->getSelect();


SELECT
    `e`.*,
    `cat_index`.`position` AS `cat_index_position`,
    `price_index`.`price`,
    `price_index`.`tax_class_id`,
    `price_index`.`final_price`,
    IF(
        price_index.tier_price IS NOT NULL,
        LEAST(
            price_index.min_price,
            price_index.tier_price
        ),
        price_index.min_price
    ) AS `minimal_price`,
    `price_index`.`min_price`,
    `price_index`.`max_price`,
    `price_index`.`tier_price`,
    `stock_status_index`.`stock_status` AS `is_salable`
FROM
    `catalog_product_entity` AS `e`
INNER JOIN
    `catalog_category_product_index_store1` AS `cat_index`
ON
    cat_index.product_id = e.entity_id AND cat_index.store_id = 1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '85'
INNER JOIN
    `catalog_product_index_price` AS `price_index`
ON
    price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
INNER JOIN
    `search_tmp_5cd96fa8932f95_44809536` AS `search_result`
ON
    e.entity_id = search_result.entity_id
LEFT JOIN
    `cataloginventory_stock_status` AS `stock_status_index`
ON
    e.entity_id = stock_status_index.product_id AND stock_status_index.website_id = 0 AND stock_status_index.stock_id = 1
WHERE
    (e.created_in <= '1557643741') AND(e.updated_in > '1557643741')
ORDER BY
    `e`.`entity_id`
DESC
    ,
    `e`.`entity_id`
DESC
LIMIT 12
3
  • 1
    Do you have category permissions enabled as part of the M2 B2B functionality? I had a similar issue and I ended up needing to disable category permissions to see products.
    – mlunt
    May 13 '19 at 16:14
  • Try reindexing, menually, disable flate category and product then again enable it(if it is enable).
    – Saphal Jha
    May 13 '19 at 18:15
  • this is a temporary table and reindex is the solution but before you do that you need to invalidate all your indexes you can do this by running bin/magento indexer:reset once you have done this id recommend running your index process bin/magento indexer:reindex if this fails again then potentially run them 1 by 1 as you may be running out of memory during the reindex process Jan 21 at 21:04
0

This is something related to vendor folder.

I didn't search much for this issue but when I replaced my local vendor folder with live vendor folder.

It has started working.

2
  • 1
    You shouldn't change the vendor folder directly all changes in that folder should be handled by the composer file. id suggest deleting the vendor folder and running composer install Jan 21 at 21:18
  • @DavaGordon yes I know that, But I think previous developer has made some changes so I had to restore clean vendor folder. Otherwise I never make changes in core file ;) Jan 21 at 21:50
0

For anyone else having suddenly seeing products on category pages replaced by the "We can't find products matching the selection" warning in 2.4.x, make sure that Elasticsearch is running. This can be tested in the admin. An error will also be thrown when running setup::upgrade.

0
0

My issue was Elasticsearch Since Magento 2.4 Elasticsearch needs to be enabled and configured to work with magento.

0

With Magento 2.4. and above all search and listing are delivered from elastic search. Issue reasons:

  1. Elastic search not running.
  2. Elastic search timed out.
  3. Some other module did alter the flow and was checking flat table for response.
  4. Elastic search index were not populated.

Check Logs as well.

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.