Out of Stock Notification: Why the messages disappear after a second?

Created by Kaylin Nguyen, Modified on Tue, 18 Dec, 2018 at 6:41 PM by Kaylin Nguyen

Question: 

When enabling the module, I got an issue. Some of the notification messages that appear on top of the pages quickly disappear after a second. 


For example: when a customer add a product to cart which is over the available quantity, the red message is only presented in a second. 



The suggested solution: 

You go to file: app/code/Bss/ProductStockAlert/view/frontend/web/js/ajax.js

and edit: 


before:


$.ajax({
                url: this.options.url,
                dataType: 'json',
                data: {"action" : this.options.action, "productId" : this.options.productId, "statusAvailable" : this.options.statusAvailable},
                type : "post"
            }).done(function (data) {


after


$.ajax({
                url: this.options.url,
                global: false,
                dataType: 'json',
                data: {"action" : this.options.action, "productId" : this.options.productId, "statusAvailable" : this.options.statusAvailable},
                type : "post"
            }).done(function (data) {



We sorry about the inconvenience. If you need further assistance, please don't hesitate to contact us.

Please visit our site for more useful Magento 2 Extensions: https://bsscommerce.com/magento-2-extensions.html


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article