I want to know how to get visibility of product using Magento 2. I have a product that is set to "not visible individually" and want to remove it from a collection.
I have tried below methods:
$product->getVisiblility(); $product->getVisibleInCatalogStatuses(); $product->getVisibleStatuses(); $product->isVisibleInCatalog(); $product->getVisibleInSiteVisibilities(); $product->isVisibleInSiteVisibility();
But all products return the same value "1" for
$product->isVisibleInCatalog visible or not.
I have reindexed via command line also and set the visibility for all stores to be not visible however still the issue persists.