Forum Replies Created
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
September 30, 2024 at 2:19 pm in reply to: Is there a possible solution to trigger a notification modal via Javascript? #150903
Malwin Boehringer
ParticipantHi Pablo, Thank you for the suggestion but I could not get it to work as expected.
So I simply copied the frontend functions direct from the pluginfolder,
now it works fine with the use of some woocommerce native php function if the page reloads “wc_add_notice( __(‘hello world’, ‘mytheme’ ), ‘info’ );”:
—function showStatusMessage (text, msgtype) { if (typeof text !== 'string' || typeof msgtype !== 'string') { console.error('Invalid input: text and msgtype must be strings') return } jQuery('#ttt-pnwc-notice').find('.ttt-pnwc-content').empty() const value = { type: msgtype, message: text } jQuery('#ttt-pnwc-notice .ttt-pnwc-content').append(` <div class='ttt-pnwc-notice ${value.type} ttt-static'> <i class='ttt-pnwc-notice-icon default-icon'></i> <div class='ttt-pnwc-message'>${value.message}</div> </div> `) MicroModal.show('ttt-pnwc-notice') setTimeout(() => { MicroModal.close() }, 4000) }September 11, 2024 at 2:27 pm in reply to: Is there a possible solution to trigger a notification modal via Javascript? #149946Malwin Boehringer
ParticipantHi Pablo,
I get some trouble with the implementation after updating from V. 1.3.5 to V 1.5.
Did the name of the class function “ttt_pnwc…” change somehow?
Old solution gets a console error by trying to push a message: “Uncaught ReferenceError: ttt_pnwc is not defined”
Thank you in Advanced. Malwin -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)