When collecting a ticket or confirm a event ¿Is posible charge 50%?

When collecting a ticket or confirm a event ¿Is posible charge 50% for the reservation for prepayment o reserve?

Thank you.

  • Michael Bissett

    Hey @mira360, Michael here! :slight_smile:

    Out of the box, Events+ would take whole payments, rather than 50% of the ticket price, that'd be something that would require custom development to achieve.

    I'd be glad to make this into a feature request, though, let me get this moved over into the Features & Feedback section, so that others here in the community can vote on this being considered for a future release.

    Kind Regards,
    Michael

  • mira360

    I have one problem to aply gravity forms to reserve events, please help about it.

    when finish de form ejecute this, but not bookink may be becouse it not have a event_id post-variable. ¿Any idea to solve?

    add_action( 'gform_after_submission_1', 'reservar', 10, 2 );

    function reservar() {
    global $blog_id, $wp_query, $booking, $post, $current_user;
    $event = new Eab_EventModel($post);
    if (isset($_POST['event_id']) && isset($_POST['user_id'])) {
    $booking_actions = array('yes' => 'yes', 'maybe' => 'maybe', 'no' => 'no');

    $event_id = intval($_POST['event_id']);
    $booking_action = $booking_actions[$_POST['action_yes']];
    $user_id = apply_filters('eab-rsvp-user_id', $current_user->ID, $_POST['user_id']);

    do_action( 'incsub_event_booking', $event_id, $user_id, $booking_action );
    if (isset($_POST['action_yes'])) {
    $wpdb->query(
    $wpdb->prepare("INSERT INTO ".self::tablename(self::BOOKING_TABLE)." VALUES(null, %d, %d, NOW(), 'yes') ON DUPLICATE KEY UPDATE status = 'yes';", $event_id, $user_id)
    );
    // --todo: Add to BP activity stream
    do_action( 'incsub_event_booking_yes', $event_id, $user_id );
    $this->recount_bookings($event_id);
    wp_redirect('?eab_success_msg=' . Eab_Template::get_success_message_code(Eab_EventModel::BOOKING_YES));
    exit();
    }
    if (isset($_POST['action_maybe'])) {
    $wpdb->query(
    $wpdb->prepare("INSERT INTO ".self::tablename(self::BOOKING_TABLE)." VALUES(null, %d, %d, NOW(), 'maybe') ON DUPLICATE KEY UPDATE status = 'maybe';", $event_id, $user_id)
    );
    // --todo: Add to BP activity stream
    do_action( 'incsub_event_booking_maybe', $event_id, $user_id );
    $this->recount_bookings($event_id);
    wp_redirect('?eab_success_msg=' . Eab_Template::get_success_message_code(Eab_EventModel::BOOKING_MAYBE));
    exit();
    }
    if (isset($_POST['action_no'])) {
    $wpdb->query(
    $wpdb->prepare("INSERT INTO ".self::tablename(self::BOOKING_TABLE)." VALUES(null, %d, %d, NOW(), 'no') ON DUPLICATE KEY UPDATE status = 'no';", $event_id, $user_id)
    );
    // --todo: Remove from BP activity stream
    do_action( 'incsub_event_booking_no', $event_id, $user_id );
    $this->recount_bookings($event_id);
    wp_redirect('?eab_success_msg=' . Eab_Template::get_success_message_code(Eab_EventModel::BOOKING_NO));
    exit();
    }
    }

    }

  • Michael Bissett

    Hey @mira360,

    I'd be glad to help, but I must remind you of our custom development policy, linked to earlier on in this discussion:

    https://premium.wpmudev.org/manuals/using-wpmu-dev/support-vs-custom-development/

    I'd really need to sit down, work on this code (with an active Gravity Forms installation myself), and debug this code, and that's going to take quite a bit longer than the 10 minutes that we mention.

    This would be something for our Jobs Board, due to the custom nature of the task at hand:

    https://premium.wpmudev.org/wordpress-development/

    Kind Regards,
    Michael

  • mira360

    Now I have the solution for those sites that charge 50% of booking and the remainder to attend or by other means. I hope that will be helpful to others.

    Now I have the solution for those sites that charge 50% of booking and the remainder to attend or by other means. I hope that will be helpful to others.

    I also have the code to integrate reservations gravity forms, it is a code to put in functions.php of your theme, and this is executed when you press button submit the form to do so regoger names of the wizard.

    CODE FOR 50%:
    I edit file events-and-bookings/lib/class_eab_template.php on line 379 aprox.

    if( trim( $data->get_option('paypal_email') ) != '' ) {
    			//Change 50% price
    			$precioreserva= $event->get_price();
    			$precioreserva= $precioreserva/2;

    and in the same public static function get_payment_forms , this line...

    $content .= '<input type="hidden" name="amount" value="' .$event->get_price().'" />';
    change for this...
    $content .= '<input type="hidden" name="amount" value="' . $precioreserva .'" />'; '

    CODE FOR NOMINATE TICKETS WITH GRAVITY FORMS:

    Add on functions.php of your theme

    add_action( 'gform_after_submission', 'reserve', 10, 2 );
    function reserve() {
    
    	global $wpdb, $blog_id, $wp_query, $booking, $post, $current_user;
    	$event = new Eab_EventModel($post);
    
    		//Recogemos variables necesarias
    		$action_yes= $_POST['input_15'];
    		$event_id= $_POST['input_9'];
    		$user_id= $_POST['input_10'];
    
    		if (isset($_POST['input_9']) && isset($_POST['input_10'])) {
    		    $booking_actions = array('yes' => 'yes', 'maybe' => 'maybe', 'no' => 'no');
    		    $event_id = intval($_POST['input_9']);
    		    $booking_action = $booking_actions[$_POST['input_15']];
    		    $user_id = apply_filters('eab-rsvp-user_id', $current_user->ID, $_POST['input_10']);
    		    do_action( 'incsub_event_booking', $event_id, $user_id, $booking_action );
    					$wpdb->prepare("INSERT INTO eb_eab_bookings VALUES(null, %d, %d, NOW(), 'yes') ON DUPLICATE KEY UPDATE <code>status</code> = 'yes';", $event_id, $user_id)
    					);
    				echo "<br>tras db<br>";
    				// --todo: Add to BP activity stream
    				do_action( 'incsub_event_booking_yes', $event_id, $user_id );
    				echo "<br>tras do action incsub_event_booking_yes <br>";
    		}
    	echo "</div>";
    	return false;
    	}

    There are a lot of php and it took me to find everything, but hopefully serve as a reference and help others. :wink:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.