cancel
Showing results for 
Search instead for 
Did you mean: 

Enable error messages on the product list page (catalog page).

Enable error messages on the product list page (catalog page).

Hi, I want to enable error messages on the product list page. Now, for example, when I add too much one product, it redirects me to the product page and there is an error message. 
I can block the redirection but I need to refresh the page to get an error message, is there any function to refresh the message cache?

2 REPLIES 2

Re: Enable error messages on the product list page (catalog page).

Hello @maciejmodl497d ,

 

According to me, you want temporarily enable message for all time instead of one time.

 

File Path: vendor/magento/module-theme/view/frontend/web/js/view/messages.js 

 

Remove or comment Following code from js file 

 

if (!_.isEmpty(this.messages().messages)) {
    customerData.set('messages', {});
}

$.cookieStorage.set('mage-messages', '');

 

Run following Magento Command.

1. bin/magento setup:upgrade 

2. bin/magento setup:static-content:deploy

 

If it helps then Click on Kudos and Accept as Solution.

 

Thank you

Hiren Patel

Re: Enable error messages on the product list page (catalog page).

Hi, thank you for your answer, but I need the error message to appear on the product list page, like success messages. Now when there is an error message, magento is redirecting you to the product detail page. Does not load ajax error messages.