Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Products is not showing up on Magento2 subcategory

I installed a fresh magento2, and top categories are working, but for sub-category, there is no product showing up in frontend even thought I assigned products to these sub-categories.

It's always said "We can't find products matching the selection."

Where can I find the code in Magento 2 that's responsible for displaying products so I can diagnose this in a programatic manner?

like image 860
Zike Avatar asked Nov 25 '15 22:11

Zike


People also ask

How do I show all products in Magento 2?

Easy Steps to Display Products in Magento 2 Home PageSelect the widget type as 'Catalog Products List' and enter the basic information. In the bottom you can see the conditions to add. Select the option 'Category' and select the category you want to display in home page and click “Insert Widget” button. That's it.

How do I get product categories in Magento 2?

You need to instantiate Magento\Catalog\Model\ProductCategoryList class in your __construct() method to get category ids for a product. Here 5 and 12 is category id of the product with id is 10. The result will be an array of category ids for the products.

How do I display Magento two subcategories with an image on a category page?

Find the parent category that you want to show subcategories on, then go to the 'Display Settings' tab. Switch 'Display Mode' to either 'Static block only' or 'Static block and products', then choose your newly create 'Subcategories' block from the 'CMS Block' menu. Then save.

How do I show all products in Magento?

How to Allow Customers to Display All Products on a Category Page in Magento 2. On the Magento admin panel, go to Stores > Settings > Configuration. In the left panel, navigate to Catalog > Catalog. Expand the Storefront section and change the Allow All Products per Page setting from No to Yes.


2 Answers

To show the product, check if the product following options:

  1. General->Status = Enabled
  2. general->Visibility = Catalog,Search
  3. Inventory->Qty > 0
  4. Inventory->Stock Availability = In Stock
  5. Websites = checking your site
  6. Catgories = checking your category.

If you want checking product to subcategory, go to Catalog->Manage Categories->Select your category, open tab Display Settings and change option "Is Anchor" to "Yes". Save category.

like image 50
Echo Avatar answered Sep 21 '22 17:09

Echo


You can try reindexing.it works if these things all set

1.General->Status = Enabled

2.general->Visibility = Catalog,Search

3.Inventory->Qty > 0

4.Inventory->Stock Availability = In Stock

5.Websites = checking your site

6.Catgories = checking your category.

like image 23
Rahul Singh Avatar answered Sep 20 '22 17:09

Rahul Singh