Malwin Boehringer

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Malwin Boehringer
    Participant

    Hi 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)
    }
    Malwin Boehringer
    Participant

    Hi 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

Viewing 2 posts - 1 through 2 (of 2 total)