Viewing 15 replies - 16 through 30 (of 36 total)
  • Thread Starter afreyer

    (@afreyer)

    backend. it is in ticket-editor the first line, called “Description”.

    Thread Starter afreyer

    (@afreyer)

    AH, sorry.
    i forgot, that i defined it by myself.

    function my_em_add_default_tickets($tickets,$EM_Bookings){
      if ( empty($tickets->event_id) ){
       $ticket_data = array();
       $ticket_data[0] = array('ticket_name'=>'Karten','ticket_description'=>'5,-€ / 4,-€ erm??igt','ticket_spaces'=>50);
       if ( is_array($tickets->tickets) )unset($tickets->tickets);
       foreach ($ticket_data as $ticket){
         $EM_Ticket = new EM_Ticket($ticket);
         $tickets->tickets[] = $EM_Ticket;
       }
     }
     return $tickets;
    }
    add_filter('em_bookings_get_tickets','my_em_add_default_tickets',10,2);

    [Moderator Note: Please post code & markup between backticks (not single quotes) or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Thread Starter afreyer

    (@afreyer)

    nobody knows what i want.

    @robert Bai – this is not your thread – if you need help, please start your own – it causes much confusion to have multiple people posting in the same thread.

    I’ve deleted your most recent post.

    @afreyer I’m confused when you say you’ve defined it yourself. There’s already field called Description for each ticket – is that what you want to display?

    Or something else?

    Thread Starter afreyer

    (@afreyer)

    @caimin_nwl: yes, you are right. the desription for each ticket i need.

    Aha! Now we’re getting somewhere ?? Where are you trying to display the description? In an email or a template?

    Thread Starter afreyer

    (@afreyer)

    sorry, this other post has really confused me. ??

    it is the template for the single post type event, for an output like this.

    Plugin Support angelo_nwl

    (@angelo_nwl)

    hmm, you mean showing ticket description using a placeholder which you can use outside of the booking or #_BOOKINGTICKETDESCRIPTION, is that correct ?

    Thread Starter afreyer

    (@afreyer)

    right. i need a placeholder, shortcode or template-tag.

    Have you familiarised yourself with how to make custom placeholders?

    https://wp-events-plugin.com/tutorials/create-a-custom-placeholder-for-event-formatting/

    Thread Starter afreyer

    (@afreyer)

    could you give me a hint for my first steps?

    You can use the code on the page Phil linked to to create your own custom placeholder. You’d need to write your own function that grabs the data.

    Actually, if you only want to use the ticket description in the single event page, I think you’ll be able to access it using

    $post->ticket_description

    That may mean you won’t need to create a complete custom placeholder, unless you need to.

    Thread Starter afreyer

    (@afreyer)

    hey caimin_nwl,

    thank you. i dont need custom placeholder, because the field allready does exist.

    i tried echo $post->ticket_description; but it doesnt work. no output..

    Plugin Support angelo_nwl

    (@angelo_nwl)

    hi,

    maybe you can try to create custom placeholder for this instead – https://wp-events-plugin.com/tutorials/create-a-custom-placeholder-for-event-formatting/ and then use something like

    $EM_Tickets = $EM_Event->get_tickets();
    foreach($EM_Tickets as $EM_Ticket){
    	$replace .= $EM_Ticket->ticket_name."<br/>";
    	$replace .= $EM_Ticket->ticket_description;."<br/>";
    }

    As for where to paste custom codes : https://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/

Viewing 15 replies - 16 through 30 (of 36 total)
  • The topic ‘Show Ticket Description’ is closed to new replies.