Products not showing in Magento2 subcategory

I installed new magento2 and the upper categories work, but for the subcategory there is no product showing in the front, even if I assigned the products to these subcategories.

He always said: "We cannot find products that match the choice."

Where can I find the code in Magento 2 that is responsible for displaying products so that I can diagnose this programmatically?

+6
source share
6 answers

To show the product, check if the following product parameters are:

  • General-> Status = Enabled
  • general-> Visibility = Directory, Search
  • Inventory-> Qty> 0
  • Inventory-> Stock = stock
  • Websites = checking your site
  • Catgories = checking your category.

If you want to check the product for a subcategory, go to Catalog-> Manage Categories-> Select your category , open the tab "Display Settings and Change" "Anchor" "Yes" . Save category.

+4
source

You can try reindexing.it if all these things are installed

1. General> Status = Enabled

2.common-> Visibility = directory, search

3.Inventory-> Qty> 0

4.Inventory-> Stock Availability = In Stock

5.Websites = checking your site

6.Catgories = checking your category.

+4
source

Type the following command at a command prompt:

php bin/magento indexer:status 

If one of the indexes is Processing, go to the MySQL database and go to the indexer_state table. You will notice that one of the values ​​is β€œWork” and the rest is β€œValid”

Set the value to "Work with invalid and re-index." The best way to do this is to run the following query:

 update magento.indexer_state set status='invalid' where status ='working' 

Good luck

+2
source

Subcategory Solving a problem with the presentation of a product as you need to follow below:

Magento 2 Admin ==> Products ==> Category ==> Subcategory ==> Design ==> Use the settings of the parent category ==> Checked here

enter image description here

+2
source

This is due to the problem of reindexing.

Application \ code \ Modules \ Catalog \ etc. \ di.xml

 <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Catalog\Model\Indexer\Category\Product\Action\Full" type="Modules\Catalog\Model\Indexer\Category\Product\Action\Full" /> </config> 

Application \ Code \ Modules \ Catalog \ Model \ Indexer \ Category \ Product \ Action \ Full.php

 <?php namespace Modules\Catalog\Model\Indexer\Category\Product\Action; /** * Class AbstractAction * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Full extends \Magento\Catalog\Model\Indexer\Category\Product\Action\Full { public function isRangingNeeded() { return false; // It was "True" as default setting. } } 

Then we must run this command.

 php bin/magento cache:clean php bin/magento indexer:reindex 

Finally, we got as many as 2000 products on our category page instead of the previous 340 products on the frontend page. In addition, the Product Category tab for index management is only updated from the date the version is updated to the current indexing date and time.

Great experience!

Hope this helps a lot of developers and owners.

+1
source

I had a similar problem, the product appeared in the parent category, but not in the originally assigned subcategory. I solved this by clicking the "Save" button in the subcategory and / or (not sure if both are necessary) pages for editing the parent category.

0
source

All Articles