4

I came across a weird issue. There are around 400 products assigned to a category but it is only displaying around 150 products.

I verified the products enabled and all, actually those products show up on a search or another category.

So, in short, the product is assigned to multiple categories. It is displayed in a few categories but not one.

I tried reindexing but no luck.

The weirdest thing here is when I open the product on the admin panel and resave the product, I can see the product on the frontend. The problem is I can't open every product and save it again. Also after I tried that with few undisplayed products, I reindexed again and the products that appeared after saving individually disappeared again.

Can anyone passed through such a weird situation.

I'm stalled on what to do next to fix this. Can anyone help me with this? Any help would be appreciated. By the way, my Magento version is 2.1.3

  • I may be wrong here! you said whenever you save product, product visible in frontend so why not try this progrmatically save the products. Get all the product collections just load and save. – Bilal Usean Mar 6 '17 at 4:38
  • I tried saving from admin, i think while product save the index are updated that is why it is displaying the products. I think there is some problem with reindexing. I have checked the indexer_status table and all indexes are valid – aton1004 Mar 6 '17 at 5:16
  • Check tables catalog_category_product_index count is it 400? & In indexer_state all are valid? – Ankit Shah Mar 6 '17 at 7:55
  • magento.stackexchange.com/questions/158646/… Perfect answer... – Great Indian Brain Jul 1 '17 at 6:45
3

Looks like some error happened in process of re-index and index status left processing. You need reset it DB.

For example by query:

UPDATE indexer_state SET status = 'invalid' WHERE status != 'valid';

Then run:

php -f bin/magento indexer:reindex;
|improve this answer|||||
  • thanks this work for me, now new problem arise, the images doesn't show up – Gujarat Santana Oct 14 '17 at 10:43
0

I had a similar issue, and as you mentioned in you question, when you save a product it fixes it for that product. So you just need to save all products at once with a mass update to avoid the laborious task of saving them one by one.

From the Magento Admin go to Products > Catalog and in the Products Grid select all products in the catalog. Then select to Update Attributes from the Actions Control dropdown.

enter image description here

Now you just need to update one attribute for all product's, select an attribute which is unlikely to have a value already set for any of the products, e.g. Meta Keywords or Layout Update XML. Click Save to save all the products at once.

enter image description here

Now all your products should display correctly in the categories. Don't forget to repeat the process to remove the value you just set for all products.

|improve this answer|||||

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.