Total lost when triggering validation

WordPress Event Management, Calendars & Registration Forums General Question Total lost when triggering validation

This topic contains 7 replies, has 2 voices, and was last updated by  Alex Steer 9 years, 8 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #17596

    Hi, Is there a way to stop the total being lost when the validation is triggered? Not sure if this problem is just occuring for me.

    The inputs retain there value but the total does not calculate – if you add more tickets to the inputs it will ignore the ones already set and total the new ones added.

    Please investigate.

    Thanks

    • This topic was modified 9 years, 8 months ago by  Alex Steer.
    Alex Steer
    #17601

    Hi Alex,

    Sorry that the plug-in isn’t working for you. Can you outline the steps to reproduce this problem, it’s not one I’ve seen before.

    Thanks,
    Stephen

    Stephen Harris
    #17603

    Hi Stephen.

    Im sure you will have the answer!

    1. User selects tickets generating total
    2. User completes form and submits but has created a validation error – (server side val not browser)
      (non selection of payment gateway – causing the validation error)
    3. Page refreshes showing error notices and total is lost – inputs still have values but do not add to total.

    Please let me know if that is not clear.

    • This reply was modified 9 years, 8 months ago by  Alex Steer.
    Alex Steer
    #17606

    Is there a way to select a gateway as default?

    Alex Steer
    #17611

    Great, thanks! It seems that updating the ticket value triggers the display of the total (and correctly), so a simple fix is just to refresh the views once the models have been set up. I’ve checked the latest development branch and this problem doesn’t occur, so I’ll release a patch in the next day or so to fix this until the next minor release (1.11.0).

    Re. pre-selecting gateways:

    add_action( 'eventorganiser_get_event_booking_form', 'my_prefill_booking_form' );
    function my_prefill_booking_form( $form ){
    
        $gateway = $form->get_element( 'gateway' );
    
        if( !$gateway->get_value() ){
            $gateway->set_value( 'stripe' );
        }
    
    }
    
    Stephen Harris
    #17613

    Cool, I knew you would have the answer. – I look forward to the update.

    I assume paypal would be:

    add_action( 'eventorganiser_get_event_booking_form', 'my_prefill_booking_form' ); function my_prefill_booking_form( $form ){ $gateway = $form->get_element( 'gateway' );
        if( !$gateway->get_value() ){
            $gateway->set_value( 'paypal' );
        }
    }
    
    • This reply was modified 9 years, 8 months ago by  Alex Steer.
    • This reply was modified 9 years, 8 months ago by  Alex Steer.
    • This reply was modified 9 years, 8 months ago by  Alex Steer.
    • This reply was modified 9 years, 8 months ago by  Stephen Harris.
    Alex Steer
    #17619

    That’s correct.

    Just so you know, the forum uses markdown. To display code you can write it ‘as is’, then highlight it and select the code icon ({})

    Stephen Harris
    #17620

    Ok, my bad. Sorry.

    I will use that next time.

    Thanks

    Alex Steer
Viewing 8 posts - 1 through 8 (of 8 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.