cancel
Showing results for 
Search instead for 
Did you mean: 

Products not showing on category and search but direct links are working

SOLVED

Products not showing on category and search but direct links are working

Hello,

 

I recently migrated Magento 1.9 to Magento 2.4.5p1. The categories are visible, the products are set to be visible in catalogue and search, they are set to categories. But they aren't showing up, while direct links do work and I can put them into cart, so it's definitely not a stock issue.

 

Reindexing and clearing cache doesn't help.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Products not showing on category and search but direct links are working

It is the bug https://github.com/magento/magento2/issues/35900 and I incorporated the fix from https://github.com/magento/magento2/commit/bb55549cd3016987663272e7ffe3f452c8d6e40d into my custom theme I created just for this before 2.4.5-p2 or 2.4.6 will be created.

View solution in original post

7 REPLIES 7

Re: Products not showing on category and search but direct links are working

Hello @RarogIT 

 

Make sure that the visibility of your products is 'Catalog, Search' or 'Catalog'. Otherwise, products will not show in product categories on app. To change the product visibility, go to Magento Admin > Catalog > Products and find the Visibility attribute in a certain product page.

Problem solved? Click Accept as Solution!

Re: Products not showing on category and search but direct links are working

Hi @RarogIT ,

 

Please configure elasticsearch and problem will be solve after that.

Based on your version you need elasticversion 7.17

Configure it and run reindex

Check your front-end again

 

Problem Solved? Accept as Solution!

 

Hope it helps!

Thanks

Ankit Jasani

Re: Products not showing on category and search but direct links are working


@Bhanu Periwal wrote:

Hello @RarogIT 

 

Make sure that the visibility of your products is 'Catalog, Search' or 'Catalog'. Otherwise, products will not show in product categories on app. To change the product visibility, go to Magento Admin > Catalog > Products and find the Visibility attribute in a certain product page.


I made it sure, all products are set to be visible in "Catalog, Search". They still don't appear.

Re: Products not showing on category and search but direct links are working


@Ankit Jasani wrote:

Hi @RarogIT ,

 

Please configure elasticsearch and problem will be solve after that.

Based on your version you need elasticversion 7.17

Configure it and run reindex

Check your front-end again

 

Problem Solved? Accept as Solution!

 

Hope it helps!

Thanks



Elasticsearch 7 is already installed. In the admin panel I can test the connection to the service and it works. I re-indexed multiple times. The products still do not appear.

Re: Products not showing on category and search but direct links are working

Further investigation.

 

module-catalog/view/frontend/templates/product/list.phtml or module-catalog/view/frontend/templates/product/listing.phtml are never called for me. Nothing seems to override catalog_category_view.xml and getChildHtml('product_list') seems to be called correctly but doesn't deliver any content.

Re: Products not showing on category and search but direct links are working

I have a general suspicion now: There is an exception thrown before the product list is drawn. Both in system.log and debug log I can find a stack trace starting with this:

`[2022-10-23T08:18:47.295760+00:00] main.CRITICAL: Exception: Warning: Object of class Magento\Framework\Phrase could not be converted to int in /.../vendor/magento/module-catalog/view/frontend/templates/product/list/toolbar/limiter.phtml on line 26 in /.../vendor/magento/framework/App/ErrorHandler.php:62`

Re: Products not showing on category and search but direct links are working

It is the bug https://github.com/magento/magento2/issues/35900 and I incorporated the fix from https://github.com/magento/magento2/commit/bb55549cd3016987663272e7ffe3f452c8d6e40d into my custom theme I created just for this before 2.4.5-p2 or 2.4.6 will be created.