4

I've been developing Magento 2.0 themes/extensions for a while now and almost releasing the first Magento webshop. My problem is that in this webshop the products are suddenly disappeared on the frontend. The backend still shows the products correct. I've spent a lot of hours now to search for a solution, but I still did not manage to get it working again.

I checked all standard possible solutions:

  • Cleared/flushed Magento cache/ Cache storage (via admin and command line)
  • Product is in stock and has a qty of 10
  • Product visibility is enabled
  • Run indexer:reindex

Did anyone have a similar problem?

8
  • Please try reindex all indexer: bin/magento indexer:reindex – KAndy Oct 28 '15 at 16:51
  • Thanks for your reply, I forgot to mention this but I already did that too. – Silvan Oct 28 '15 at 17:51
  • Please mention how you have cleared your cache – MagePsycho Oct 29 '15 at 6:39
  • I updated the question. – Silvan Oct 29 '15 at 7:02
  • 1
    These are the commands: php bin/magento indexer:reindex && php bin/magento cache:clean && php bin/magento cache:flush. – Silvan Nov 9 '15 at 8:46
4

It was due to upgrading Magento version via git or others. Also, it is known as Magento 2.1.3/2.1.4/2.1.5 issue.

This is accurate solution.

We can easily add these two files on original Modules folder.

app\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>

app\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 should run this command.

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

Finally, we got whole 2000 products on our category page instead of previous 340 products on frontend page. Also, the "Product category" tab on index management is just updated from date of version upgraded to current indexing date and time.

Hope this will help many developers and owners.

1

Have you try with remove var/generation folder and clear catch with reindexing using cli.

using cmd.

php bin/magento indexer:reindex
0
1

This happened on one of my stores when none of the product attributes were searchable. The catalogsearch_fulltext table was empty, which is used in a join when querying products in a category. (Version 2.1.7)

Changing just one attribute to searchable solved the issue.

example of attributes not searchable

1
  • This problem occurred on one of my local VM's. Re-importing the catalogsearch_fulltext_scope1 table (which was also empty in my case, catalogsearch_fulltext table didn't even exist) from the live-site to my local install solved the problem. Your answer inspired me to try this. Thanks! – Daan van den Bergh Mar 19 '18 at 13:01
1

Using 2.18, I seem to have a fix working. Problem: If you run magento indexer:reindex Lots of products disappear

Fix: Run the following magento indexer:reindex magento indexer:reindex catalog_category_product magento cache:clean magento cache:clean full_page Then they all come back

0

After many hours of hair pulling and countless cups of coffee...

I believe this issue is related to a custom or system attribute with values of "No" for {attribute} -> Storefront Properties -> :

Visible on Catalog Pages on Storefront

Used in Product Listing

Updating these values does not save in UI, and then after refreshing cache the products disappear from catalog pages. Changing the values back to "Yes", even though UI already reads "Yes" and refreshing the cache again brings backs products on catalog pages.

I've filed an issue on Github:

https://github.com/magento/magento2/issues/2568

0

I did a lot of research on this issue. I compared databases from before and after the products starting to disappear, but nothing critical was changed. That's why it should be in the files. I uploaded all Magento files (upgrade from 1.0.0beta to 2.0.0 RC) and kept the same database. After this I uploaded the magento catalog images, config files and my theme folder again. Magento now shows the products again.

0

Igor Revenko's answer worked but only after upgrading to 2.17.

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

Should the cache:clean be after indexer:reindex? i.e. php bin/magento indexer:reindex php bin/magento cache:clean

1
  • Yes, if all caches are enabled you should clear the cache too. – Silvan Jul 7 '17 at 9:43

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.