Post by supak111 » Wed May 22, 2024 10:51 am

Is there any way to automatically close the " Success: Your coupon discount has been applied" coupon added to cart ALERT after 5 seconds?

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by ADD Creative » Wed May 22, 2024 8:12 pm

You would need to add something like the following. You may need to add .alert-success to the selector if you only want to close success messages.

Code: Select all

setInterval(function() {
    $('.alert-dismissible').alert('close');
}, 5000);

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by supak111 » Thu May 23, 2024 12:37 am

Thanks for the help. Actually ended up using this and it seems to work for successful alert, but not for Warning alerts even though they both use .alert class

Code: Select all

setTimeout(function(){ 
	$('.alert').fadeOut() 
}, 2000);
Last edited by supak111 on Thu May 23, 2024 10:10 am, edited 1 time in total.

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by straightlight » Thu May 23, 2024 6:04 am

supak111 wrote:
Thu May 23, 2024 12:37 am
Thanks for the help. Actually ended up using this and it seems to work for successful alert, but not for Warrning alerts even though they both use .alert class

Code: Select all

setTimeout(function(){ 
	$('.alert').fadeOut() 
}, 2000);
Now that the issue has been solved, please add: [SOLVED] at the beginning of the subject line on your first post.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by supak111 » Thu May 23, 2024 10:10 am

Well it's only 50% solved. Its not working on Warning alerts

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by straightlight » Fri May 24, 2024 11:53 pm

supak111 wrote:
Thu May 23, 2024 10:10 am
Well it's only 50% solved. Its not working on Warning alerts
What's the code you used for warning alerts?

Have you tried with: alert alert-warning ?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: Amazon [Bot], Semrush [Bot] and 76 guests