3

I am working on project in Opencart 2.0.1.1 version. I want to show a sound notification in admin dashboard without page load whenever user place a new order from front end. please help me regarding this I have spend many hours on internet but didn't find any solution yet. Or any suggestions how can it possible notifications process in PHP ?

OBAID
  • 943
  • 1
  • 14
  • 37
  • You will have to use `AJAX` for this. – Ali Zia Jan 08 '16 at 07:28
  • Good question. You should use event system to do so. The event system is provided by default in opencart. Just trigger it at the right place. – Vidhyut Pandya Jan 08 '16 at 11:36
  • 1
    Thanks guys for your help yes i was wondering to do it this by using live notifications but php don't support this so using ajax polling for this .... – OBAID Jan 09 '16 at 09:34
  • Yeah, you need ajax long pooling with setTimeout() function eg: 5 second delay, which will check db table status (after each five seconds) if new order comes, will make sound (mp3) – Abid Jan 19 '16 at 07:14

1 Answers1

4

Use a Manual Ajax call over the database at regular interval to check the last order id key is changed from current or not.

  1. Get last order Id While loading
  2. Call Ajax to check last order id is different or not
  3. If differs do the push notification