[SOLVED sort-of]How-to: Show message (popup) on form paypal redirect?

Basdub

Member
Hi,

What is the best way to show a message like "Please wait, you are being redirected to paypal" after the user click the Save or Pay button?

The form is being refreshed and the user thinks that it failed and try again or go away. They do not see that the paypal page has been requested and is currently loading (swirling on the tab).

Thanks
 
The best way would be if Joomla had "show loader" capability in the core - lol....

Given that they don't you would have to come up with a creative alternative solution based on what where and how the page(s) is/are being processed.... The following is a sample Javascript stub that could work in some scenarios:

Code:
$.ajaxSetup({
    beforeSend:function(){
        // show gif here, eg:
        $("#loading").show();
    },
    complete:function(){
        // hide gif here, eg:
        $("#loading").hide();
    }
});

You could use something like that is the calls are Ajax. Also if you are using a Fabrik form - the Fabrik loader should show if you have it turned on and submit the form. It all just depends on where and how the calls are being made to process the request.

Dale
 
I made it happen but by adding a event in the doSubmit in the form.js ... and form-min.js

The event was added in the onComplete of the ajax call where it processes the baseRedirect, under the samepage redirection.It now looks like:
Code:
if (json.redirect_how === 'samepage') {
                                                Fabrik.fireEvent('fabrik.form.onBeforeSamePageRedirect', [this, json]);
                                                window.open(json.url, '_self');
                                            }
                                            else if (json.redirect_how === 'newpage') {
                                                window.open(json.url, '_blank');
                                            }

Then I added the code to my form_X.js like so:
Code:
Fabrik.addEvent('fabrik.form.onBeforeSamePageRedirect', function(form,json){
            Fabrik.loader.start(form.getBlock(), 'Please wait, you are being redirected to Paypal');
        });
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top