Support » Plugin: GiveWP - Donation Plugin and Fundraising Platform » Why are Field values being cleared on Gateway Change?

  • Resolved David Bee



    First off: what a fantastic plugin! Thanks for the incredible work on it!

    As I’m exploring things further, I noticed a strange behavior that I’m hoping you can help with. Here are the steps to replicate it on your end: Enable both the Paypal and Stripe gateways on the basic multi-step form. Now go to the front-end and get to step 3 (payment). I can change the gateway, the new gateway loads and all is good.

    However, this is where things get weird. If I am logged out, upon changing the gateway, any personal fields (including First Name, Last Name, Company, Email, Comment…) all get cleared. Any values that I entered get removed when I change the gateway.

    In digging through the code, I can see that this is most likely happening due to the following JS in wp-content/plugins/give/src/Views/Form/Templates/Sequoia/assets/js/form.js:

    // Refresh personal information section.
    $( document ).on( 'give_gateway_loaded', refreshPersonalInformationSection );

    And/or the equivalent of that code in wp-content/plugins/give/assets/dist/js/give-sequoia-template.js.

    The question is what is the reasoning behind refreshing that field data from the database every time the gateway is changed? Shouldn’t this be run only once when clicking “Cancel” on the Checkout Login form?

    Looking forward to your thoughts!

    • This topic was modified 3 months, 2 weeks ago by David Bee.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.