• Resolved s9ric

    (@s9ric)


    Using the [wp_paypal] shortcode does make the payment button appear, and it seems to have all the necessary hidden fields. However, pressing the button results in being redirected to the same page with a ‘#’ on the URL.

    I’m getting no errors or debug logs, but due to the nature of the issue, I suspect that the script that disables the default button behaviour and enables the PayPal payment hasn’t enqueued. I am using PHP to add the shortcode through ajax:

    $shortcode = '[wp_paypal button="buynow" name="' . esc_attr($session_title) . '|' . implode('|', $passed_values) . '" amount="' . number_format($total_due_today, 2) . '" button_text="Pay Now - £' . number_format($total_due_today, 2) . '" return="' . $success_url . '" no_shipping="1" description=""]';

    In the settings for the PayPal checkout, there’s an option for loading scripts globally. Is there a way to do this for the standard payments too? Or is there a chance that something else might be happening here?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Noor Alam

    (@naa986)

    Hi, This shortcode doesn’t use PayPal Checkout. Please provide a link to the page so that we can check what is happening.

    Thread Starter s9ric

    (@s9ric)

    Hi, thanks for your response. I have found what the issue is though and have a resolution. This ticket can now be closed.

    The [wp_paypal] shortcode was being output into a pre-existing form to be used as a submit button. Having looked at the shortcode function, I noticed that it should have been outputting a form around the hidden fields, but didn’t see that in my DOM due to preventing nested forms.

    I moved the shortcode out of the existing form, made it hidden, and used jQuery to submit the PayPal form when the existing form is submitted. This got it working fine.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[wp_paypal] Not Working’ is closed to new replies.