Is there a possible solution to trigger a notification modal via Javascript?

Top WooCommerce & WordPress Plugins Forums Popup Notices for WooCommerce Is there a possible solution to trigger a notification modal via Javascript?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #99905
    Malwin Böhringer
    Guest

    Hi there, thank you so much for this Plugin. It’s what I was looking for, but as i’m develeping some additional WC functionalities (REST API)… is there a possible solution to trigger a custom notification modal via Javascript? That would be awesome. All the Best! Malwin

    #99906
    Pablo Pacheco
    Participant

    Thanks for the kind words 🙂

    I believe you could try something like this:

    document.addEventListener('DOMContentLoaded', function () {
    	ttt_pnwc.clearPopupMessages();
    	ttt_pnwc.messages.push({message: 'Message 1', type: 'success'});
    	ttt_pnwc.messages.push({message: 'Message 2', type: 'error'});
    	ttt_pnwc.messages.push({message: 'Message 3', type: 'info'});	
    	ttt_pnwc.addMessagesToPopup();
    	ttt_pnwc.openPopup();
    });
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.