Dokan Login Form popup works based on custom JavaScript events. I’ll try to explain them as details as possible below,
dokan:login_form_popup:show
This event will start fetching the form by ajax. When ever you need to show the form in your custom code you can trigger this event by using $('body').trigger('dokan:login_form_popup:show')
dokan:login_form_popup:fetching_form
This event will fire before start fetching the form. You can use this event to show any ajax loading animation by using code like this,
$('body').on('dokan:login_form_popup:fetching_form', function () {
// show ajax loading animation
});
dokan:login_form_popup:fetched_form
This event will fire after completed fetching form. So, at this point you can stop showing your ajax loading animation.
$('body').on('dokan:login_form_popup:fetched_form', function () {
// stop ajax loading animation
});
After this event Dokan login popup will be visible.
dokan:login_form_popup:logged_in
This event will fire after a successful login.
$('body').on('dokan:login_form_popup:logged_in', function () {
// do whatever you want to do after a user successfully logged in.
});
After this event the popup will be closed automatically.
-
This reply was modified 5 years, 8 months ago by Edi Amin.