Sound Notification when New Order get

WPPizza – A Restaurant Plugin for WordPress Support User contributions Sound Notification when New Order get

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #23675
    itsolution
    Participant

      Note by admin: the below is completely irrelevant with WPPizza v3.x+ ( as it’s inbuilt – wppizza -> settings -> new order notifications) and only here for historical reasons (i.e if still using WPPizza 2.x)

      any one guide how to put this code and run proper Order History with sound notification
      Steps…

      
      /*************************************************************************
      play sound on new order in order history.
      repeats every 5 sec (5000 ms) until there's no
      new order anymore (just change the status)....
      set timeout (5000) to whatever timeinterval is required
      set soundfile (notifySound)  to whatever sound is supposed to be played
      if using IE, use an mp3 file instead of .wav
      ***************************************************************************/
      add_action('admin_footer', 'wppizza_notify_new_orders');
      function wppizza_notify_new_orders(){
      global $current_screen;
      if(isset($current_screen) && $current_screen->id=='wppizza_page_wppizza-order-history'){
      echo"<script type='text/javascript'>
      /* <![CDATA[ */
      jQuery(document).ready(function($){
      var notifySound = '".get_template_directory_uri()."/notify.wav';
      var notifyNewOrders = new Audio(notifySound);
      var notifyNewOrdersInterval=setInterval(function(){
      if($('.wppizza-ord-status-new').length>0){       
      notifyNewOrders.play();
      }},(5000));
      });
      /* ]]> */
      </script>";
      }
      }
      

      [edited by admin: wrap code in code tags please]

    Viewing 1 post (of 1 total)
    • The topic ‘Sound Notification when New Order get’ is closed to new replies.