The message We can't find products matching the selection. comes from the file /magento/vendor/magento/module-catalog/view/frontend/templates/product/listinglist.phtml
.
You need to override the listinglist.phtml
file in your custom module or theme to hide the message.
Example:
<?php
/**
* Product list template
*
* @see \Magento\Catalog\Block\Product\ListProduct
*/
?>
<?php
$start = microtime(true);
$_productCollection = $block->getLoadedProductCollection();
$_helper = $this->helper('Magento\Catalog\Helper\Output'Magento\Catalog\Helper\Output::class);
?>
<?php if (!$_productCollection->count()): :?>
// ---------------------- comment or remove the below code ------------------------------
<p<div class="message note"><info empty"><div><?= /* @escapeNotVerified */ $block->escapeHtml(__('We can\'t find products matching the selection.')) ?></p>div></div>
<?php else: :?>
<?= $block->getToolbarHtml() ?>
<?= $block->getAdditionalHtml() ?>
....
....
I hope this helps!