Jump to content

Find code push notification in admin when add customer success


o0ozinkyo0o

Recommended Posts

Hi all,

 

When i create success new customer or complete any an order, in admin has get push notification and show number on icon at header. I just found out code for get notification but don't know code for push after add success be located at where in Core. Can you help me to find it? 

Thanks you very much.

Link to comment
Share on other sites

Hi,

 

used tmp-file: your_admin/themes/default/template/header.tpl (id="header_notifs_icon_wrapper")

after your admin page load Prestashop create ajax-query to the ajax.php with param `getNotification` for place data to the container

if (Tools::isSubmit('getNotifications'))
{
 $notification = new Notification;
 die(Tools::jsonEncode($notification->getLastElements()));
}

so you need to view Notification class for customize some actions related with this logic

 

Regards

Link to comment
Share on other sites

Hi Alex, 

Thanks for reply,

My problem is find out code which push notification after while we add success. It's mean when Object::add() == true then it will response to Back Office. And your solution just get and show it in BO. 

 

Regards.

Link to comment
Share on other sites

Hi again,

 

so you need investigate whole process,

1) you can start from view js/notification.js file witch initiate ajax-request with the `updateElementEmployee` param 

2) then admin/ajax.php run $notification->updateEmployeeLastElement() function for update `employer` table 

3) Notification::updateEmployeeLastElement() is the point of code where update DB is triggered

 

Regards

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...