5

When a product adds to the cart the success/exception message is hiding rapidly, So I just tried the below way to show/increase the period of the message. But it's not worked for me.

I have modified the messages.js file as below from vendor/magento/Module-Ui/view/frontend/web/js/view/messages.js

/**
         * @param {Boolean} isHidden
         */
        onHiddenChange: function (isHidden) {
            var self = this; 
            // Hide message block if needed
             if (isHidden) {
                setTimeout(function () {
                    $(self.selector).hide('blind', {}, 500);
                }, 50000);
            }
        }

The above code is not working for me. Please suggest I increase the time of the message.

enter image description here

10
  • 1
    magento.stackexchange.com/a/256465/69 Be sure you're following the recommendation of NOT editing vendor directly. Use your own namespace/module to ensure your edits won't get overridden on updates. Also, be sure to clear both Magento's and Browser cache before testing.
    – B00MER
    Commented Jun 30, 2020 at 21:08
  • interactiv4.com/blog-es-en/… check this out
    – Pramod
    Commented Jul 2, 2020 at 5:47
  • magento.stackexchange.com/questions/282956/…
    – Jackson
    Commented Jul 2, 2020 at 6:47
  • can you please share the file path where your putting your js?
    – Pramod
    Commented Jul 2, 2020 at 7:36
  • weird. I tested adding to cart on clean magento 2.3.5. and the success message didn't hide...
    – SebastianT
    Commented Jul 2, 2020 at 7:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.