WordPress.org

Forums

Seamless Donations
Custom Thank You Page Upon Completion of Paypal Transaction (4 posts)

  1. Mikejuly
    Member
    Posted 1 year ago #

    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

    http://wordpress.org/plugins/seamless-donations/

  2. allendav
    Member
    Posted 1 year ago #

    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 = 'http://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.

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

    Hope this helps...

    ...Allen

  3. Mikejuly
    Member
    Posted 1 year ago #

    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: http://grandjazzfest.org/give/

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

    MJ

  4. mbmarketing
    Member
    Posted 7 months ago #

    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="http://www.domain.com/landingpage/";</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="http://www.colvinforchange.com/contributions/thank-you-for-your-contribution/";</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.

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

    They get redirected to my custom thank-you page:

    http://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();
    }
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Seamless Donations
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.