MarketPress Checkout Bug

When using the Paypal Express and Stripe payment gateways together, it doesn't allow me to proceed when clicking the "Continue Checkout >>" button. It appears that “input type=”submit” name=”mp_payment_submit” id=”mp_payment_confirm” value=”Continue Checkout »” is displayed twice in the form, which may be the source of the problem.

The problem exists on this page: https://www.ductworks.net/store/shopping-cart/checkout/, but you may have to add something to cart and go through the process to get to it.

  • netherworks
    • WPMU DEV Initiate

    UPDATE:

    I moved:

    //$content .= '<p class="mp_cart_direct_checkout">';
          //$content .= '<input type="submit" name="mp_payment_submit" id="mp_payment_confirm" value="' . __('Continue Checkout &raquo;', 'mp') . '" />';
          //$content .= '</p>';

    From marketpress-gateways.php to template-functions.php just above the

    $content .= '</form>';

    This took care of the problem with duplicate submit buttons and revealed that the real problem is that the CC form isn't being validated when clicking on the button even though PayPal is selected.

    Each payment method should probably be wrapped in it's own form or something like that.

  • aecnu
    • WP Unicorn

    Greetings netherworks,

    Simply amazing, you present a problem and offer the solution - outstanding work!

    And thank you for this, it is greatly appreciated.

    Some rep points sent your way!

    I shall alert the lead developer to your code snippet and suggestion.

    Thank you for being a WPMU Dev Member!

    Cheers, Joe

  • netherworks
    • WPMU DEV Initiate

    I believe I have come up with a very simple fix for the Stripe form validation issue that is holding up the checkout process. You'll need to edit the stripe_token.js file located in marketpress > marketpress-includes > plugins-gateway > stripe-files.

    Add:
    if($('#stripe').is(':visible')) {
    After:
    $("#mp_payment_form").submit(function(event) {

    then close it out with a right curly brace before the last two like so:

    return false; // submit from callback
    		};
    	});
    });

    See screenshot for final product.
    Hope this helps.

  • Timothy Bowers
    • Chief Pigeon

    Hey there, just checking in.

    Aaron is currently away but he has been flagged to this post and will assess your fix when he gets back. Paul is handling his tickets and is working through the extra load as well.

    If you need anything further then please feel free to reopen the thread or create a new one if needed.

    Take care and have a great day!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.