• Hi Allen,

    First off excellent work on this plugin. I rate it 5 stars for ease of use and functionality.

    My question regards the ‘thank you page’. Currently, the visitor is returned to the page where the shortcode is installed upon completion of the Paypal transaction, and works as designed with the field data from the dashboard.

    What I want to do is instead of this, direct the visitor to a separate landing page elsewhere on the site. I suspect this can be achieved by modifying the code found on the “seamless-donations/dgx-donate-paypalstd.php” page of the plugin editor – specifically I’m referring to this code approximately halfway down the page:

    $successUrl .= “thanks=1&sessionid=”;
    $successUrl .= “$sessionID”;

    Can you please provide insights as to how I can accomplish this?

    Also, is there a way I can test this functionality without repeatedly making a donation?

    Thanks Allen!

    MJ

    mikejuly.com

    https://www.ads-software.com/plugins/seamless-donations/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Mike!

    Thank you for your vote of support!

    I wouldn’t recommend modifying the code of the plugin (’cause your changes would be lost in the next upgrade).

    I will try to add a send-them-to-a-specified-page option in an upcoming release. In the meantime, try returning something like this in dgx_donate_display_thank_you() – which you can find near line 158 of dgx-donate.php

    <script>
        window.location = 'https://www.example.com/newlocation';
    </script>

    To test without donating, you can just put ?thanks=1 at the end of the URL for your donation page, e.g.

    https://www.example.com/donate/?thanks=1

    Hope this helps…

    …Allen

    Thread Starter Mikejuly

    (@mikejuly)

    Thanks Allen. If my changes aren’t going to stick when I update the plugin, I am not going to mess with it.

    One other thing you may care to consider is adding the option of changing the language in the field headers. I modified them in the .php files… you can see my changes here: https://grandjazzfest.org/give/

    It might be nice not to have to update them with every new version of the plugin.

    MJ

    mbmarketing

    (@mbmarketing)

    After trying a number of different code configurations, I was successful with the following segment.

    I used the die function with a javascript re-direct and I put it at the top of the dgx_donate_display_thank_you() function:


    die(‘<script type=”text/javascript”>window.location.href=”https://www.domain.com/landingpage/&#8221;;</script>’);

    Here is my actual code, just substitute your thank-you page url and you should be good to go.

    Remember, this will be overwritten during the next update. Hopefully, it will include the feature a feature for a custom thank-you page ??


    function dgx_donate_display_thank_you()

    {
    die(‘<script type=”text/javascript”>window.location.href=”https://www.colvinforchange.com/contributions/thank-you-for-your-contribution/&#8221;;</script>’);

    $output = “<p>”;
    $thankYouText = get_option(‘dgx_donate_thanks_text’);
    $thankYouText = nl2br($thankYouText);
    $output .= $thankYouText;
    $output .= “</p>”;

    return $output;
    }

    Now when the donor/contributor returns from PayPal to my original donor page with the thank you parameter.

    https://www.colvinforchange.com/contributions/?thanks=1

    They get redirected to my custom thank-you page:

    https://www.colvinforchange.com/contributions/thank-you-for-your-contribution/

    It seems to be working fine so far. Since the Header() function has already be called, you should not have any header conflicts.

    If you do, the following code segment may be helpful:

    // $url should be an absolute url
    function redirect($url){
    if (headers_sent()){
    die(‘<script type=”text/javascript”>window.location.href=”‘ . $url . ‘”;</script>’);
    }else{
    header(‘Location: ‘ . $url);
    die();
    }
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Thank You Page Upon Completion of Paypal Transaction’ is closed to new replies.