Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi,

    You could use something like this:

    {fully_booked} Enough {/fully_booked}
    {has_spaces} #_AVAILABLESPACES {/has_spaces}

    https://wp-events-plugin.com/documentation/conditional-placeholders/

    Thread Starter bocaj_vo

    (@bocaj_vo)

    Thank you but I mean if there is 5 spaces left: don`t worry there is enough free.
    if there is less than 5 spaces show them the actual number of available spaces.

    <strong>Is there a way to do that?</strong>

    If it is fully booked it says full I got that with
    {fully_booked} full{/fully_booked}

    Thread Starter bocaj_vo

    (@bocaj_vo)

    Is there any way to create something like a if #_AVAILABLESPACES>5 than “enough” function???

    To do that you’d need to create a custom conditional placeholder:

    https://wp-events-plugin.com/tutorials/creating-conditional-placeholders-for-events/

    Thread Starter bocaj_vo

    (@bocaj_vo)

    Hi
    I a not really good in poetry so I wonder what the necessary tweaks would be for my problem. Can anybody help ?

    `

    add_action(’em_event_output_condition’,’my_em_styles_event_output_condition’, 1, 4);
    function my_em_styles_event_output_condition($replacement, $condition, $match, $EM_Event){
    if( is_object($EM_Event) && preg_match(‘/^has_style_(.+)$/’,$condition, $matches) && is_array( $EM_Event->styles ) ){
    if( in_array($matches[1],$EM_Event->styles) ){
    $replacement = preg_replace(“/\{\/?$condition\}/”, ”, $match);
    }else{
    $replacement = ”;
    }
    }
    return $replacement;
    }

    like where fill I in my #_AVALIABLESPACES thing?

    Plugin Support angelo_nwl

    (@angelo_nwl)

    if you can code you can try to look into this snippet

    if( $EM_Event->get_bookings()->get_available_spaces() <= 5 ){
    …
    }
    Thread Starter bocaj_vo

    (@bocaj_vo)

    Wow that is cool, I even understand what is going on in the snippet. Now a real noob question where do I enter it?

    Plugin Support angelo_nwl

    (@angelo_nwl)

    you can replace the tutorial if statement with the above snippet.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘#_AVAILABLESPACES’ is closed to new replies.