cancel
Showing results for 
Search instead for 
Did you mean: 

message info empty remove

SOLVED

message info empty remove

hi there,

I need a little bit help please.

On a product overview page appears the information: "We can not find any products according to this selection", ((german Screenshot: "Wir können keine Produkte entsprechend....")) if there is no selection of articles. But this information should not come there however. So I tried it with xml with with command:

<referenceBlock name="message info empty" remove="true"/>

But it doesen`t work.

Can you give me an advice?

I have attached a screenshotkeine Auswahl.jpg

1 ACCEPTED SOLUTION

Accepted Solutions

Re: message info empty remove

@Stefan79  hi,

if this is the product overview page then you can just override the products.phtml file in your theme folder.
You have to copy product.phtml file form 
/vendor/magento/module-catalog/view/frontend/templates/category/products.phtml
to your theme folder as

/app/designe/frontend/{{theme}}/{{theme-name}}/Magento_Catalog/templates/category/products.phtml


add this 

<?php if($block->getProductListHtml() == 'Can not find products matching your selection.'): ?>
<div class="empty">empty</div>
<?php endif;?>

 

if this work for you accept this as solution.

Thank you

 

 

View solution in original post

1 REPLY 1

Re: message info empty remove

@Stefan79  hi,

if this is the product overview page then you can just override the products.phtml file in your theme folder.
You have to copy product.phtml file form 
/vendor/magento/module-catalog/view/frontend/templates/category/products.phtml
to your theme folder as

/app/designe/frontend/{{theme}}/{{theme-name}}/Magento_Catalog/templates/category/products.phtml


add this 

<?php if($block->getProductListHtml() == 'Can not find products matching your selection.'): ?>
<div class="empty">empty</div>
<?php endif;?>

 

if this work for you accept this as solution.

Thank you