• Resolved Md Nurullah

    (@nirob19)


    Hello,

    I am using the following function to add custom form field ( Additional Vehicle Pass) for charging extra $15 for every Vehiche pass.

    `function my_em_add_donation($paypal_vars, $EM_Booking, $EM_Gateway_Paypal){
    $amount = $EM_Booking->booking_meta[‘booking’][‘vehicle_pass’];
    $amount = ($amount * 15);
    if ( !empty($amount) ){
    $itemcount = 1;
    $itemcount = (count($EM_Booking->get_tickets_bookings()->tickets_bookings) + 1);
    $paypal_vars[‘item_name_’.$itemcount] = wp_kses_data(“Additional Vehicle Pass”);
    $paypal_vars[‘quantity_’.$itemcount] = $amount / 15;
    $paypal_vars[‘amount_’.$itemcount] = 15 ;
    }

    return $paypal_vars;
    }
    add_filter(’em_gateway_paypal_get_paypal_vars’,’my_em_add_donation’,1,3);

    Now i want to use same function for another filed called “Shower Charge”, which field id is, shower_pass but i cant do marge 2 function there. Anyone help me plz.

    https://wordpress.org/plugins/events-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Combine 2 function for em_gateway_paypal_get_paypal_vars hook’ is closed to new replies.