• Hi,

    Thanks for this great plugin!

    My client wanted the donate form on the homepage, which is set to ‘Your latest posts’ in de Reading settings. I’ve added the shortcode in the index.php file.

    The problem was that the success/failure redirects were not working, I’ve set those to specific pages. It was redirecting to the latest blog post instead, for both success and failure.

    Here is how I fixed it (which is a request for an update to the plugin).
    File: includes/class-start.php
    Before this line:
    $payment = $mollie->payments->create(array(
    I’ve added this:

    if(is_home())
        $redirectBaseUrl = home_url() . '/';
    else
        $redirectBaseUrl = get_page_link();

    And I’ve changed this:
    "redirectUrl" => get_page_link() . '?dmm_id=' . $donation_id,
    To this:
    "redirectUrl" => $redirectBaseUrl . '?dmm_id=' . $donation_id,

    The only thing I’m not sure of, is the is_home() function, not sure how solid it is in recognizing the homepage/blogpage, but maybe you know more about that. In my case it worked at least.

    Kind Regards,
    Sybren Dijkstra

    PS: you got a nice last name ??

    • This topic was modified 7 years, 6 months ago by nerbiz.
Viewing 1 replies (of 1 total)
  • Plugin Author Nick

    (@ndijkstra)

    Hi Sybren,

    Sorry for the very late reply, I missed this topic.

    I’ve added this bug to my ToDo list and will fix this in the next update.

    Best regards,
    Nick

    PS: You got a great last name too ;p

Viewing 1 replies (of 1 total)
  • The topic ‘Form on ‘Latest posts’ page bug + fix’ is closed to new replies.