• Resolved zabadak

    (@zabadak)


    Hi, I’m very new on WP and EM plugin and maybe I will need an extra help. I’m at a learning center and want to use EM to reserve courses.

    I want to edit the price in the form with a formula/factor [e.g. y=3x+10], starting at 2 spaces. It is not possible to write all because there are a lot of available spaces (I also want to change the name ‘spaces’ to ‘weeks’, but need the Pro version for that).

    2 spaces [3*2+10] = 16 .-
    3 spaces [3*3+10] = 19 .-
    4 spaces [3*4+10] = 22 .-

    I know it’s an awkward system , but necessary.
    It is possible to do that with the ‘regular’ version? If use filters, how can access to ‘spaces selected’ data?

    Thanks!, and sorry for my English

    https://www.ads-software.com/extend/plugins/events-manager/

Viewing 9 replies - 1 through 9 (of 9 total)
  • to change spaces to weeks; try this similar thread -> https://www.ads-software.com/support/topic/plugin-events-manager-change-ticket-table-column-headings?replies=5

    change pricing computation, maybe you can hook into em_booking_get_price filter to do this.

    Thread Starter zabadak

    (@zabadak)

    Hi agelonwl, I used the info in the previous post to edit the ‘spaces’ and it works, great!

    ..about the prices, how do I use the variables in the em_booking_get_price filter?
    I modified this brief example but I don’t know how to access to the data price ??

    function my_em_booking_get_price($content){
    		$content .= "Hello!";
    	return $content;
    }
    add_filter('em_booking_get_price','my_em_booking_get_price');

    Thanks.

    this snippet might give you an idea –

    function my_em_booking_price($format = false, $EM_Booking){
     $discount = 1; //no discount
     if( $EM_Booking->booking_spaces > 2 ){
    	$discount = 0.75; //25% discount
     }
     $price = $EM_Ticket->price * $discount;
     if($format){
    	return em_get_currency_symbol().number_format($price,2);
     }
     return $price;
    }
    add_action('em_booking_get_price', 'my_em_booking_price', 10, 2);
    Thread Starter zabadak

    (@zabadak)

    I’ll take a look agelonwl, thank you very much for your help ??

    Thread Starter zabadak

    (@zabadak)

    Another doubt, how do I restrict spaces to 2 as minimum?
    I mean, you can only reserve from 2 to 10 ‘spaces’.

    that could be in the ticket form min/max required per booking when adding/editing event

    Thread Starter zabadak

    (@zabadak)

    Yeah, thanks again!

    Thread Starter zabadak

    (@zabadak)

    Hi, I tried with this code code and do nothing. The formula I’m using is y=3x+10

    function my_em_booking_price($EM_Ticket){
      return 3*$EM_Ticket->price + 10;
    }
    add_action('em_booking_get_price', 'my_em_booking_price', 1, 1);

    I didn’t include $format and $EM_Booking variables, but added $EM_Ticket.

    Thanks in advance.

    Thread Starter zabadak

    (@zabadak)

    Any idea?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Change behaviour of the price in the form for reserves’ is closed to new replies.