Support

Home Forums Event Espresso Premium I want to display price and category name in [espresso_table]

I want to display price and category name in [espresso_table]

Posted: August 23, 2013 at 3:10 am

Viewing 3 reply threads


Ion Paciu

    August 23, 2013 at 3:10 am

    Hi,

    I’ve managed to customise the table layout but I need to display the prices for the events and event’s category name in the table header.

    I can’t find the “event price” and the “category name” variables to display them into the table layout.

    this is what I did:

    td class="td-group">
    <?php echo $event->event_cost ?> //this is not working
    </td>
    <td class="td-group">
    <?php echo $open_spots ?>
    </td>

    I’ve also added a small change to display “closed” instead of “register” when the open_spots < 1, like this:

    if ( $open_spots < 1 ) { $register_button = 'Closed'; }
    else {
    $register_button = 'id.'" href="'.get_option('siteurl').'/?page_id='.$event_page_id.'&regevent_action=register&event_id='.$event->id.'&name_of_event='.stripslashes_deep($event->event_name).'">Register';
    }

    is this correct? it appears to be working…

    And the last question, I want to modify that “register” link to load the registration form into a specified page, if I change page_id to a custom page, will the registration form work?

    Thank you for your help, I’m not the best coder :)

    • This topic was modified 11 years, 1 month ago by Ion Paciu. Reason: the code tag was wrong


    Josh

      August 23, 2013 at 9:48 am

      For the price and the category name you can use these shortcodes in a do_shortcode:

      <?php echo do_shortcode('[EVENT_PRICE event_id="'.$event->id.'" number="0"]');?>

      http://staging.eventespresso.com/wiki/shortcodes-template-variables/#event-price

      <?php echo do_shortcode('[CATEGORY_NAME event_id="'.$event->id.'"]');?>

      http://staging.eventespresso.com/wiki/shortcodes-template-variables/#event-category

      And the last question, I want to modify that “register” link to load the registration form into a specified page, if I change page_id to a custom page, will the registration form work?

      I’m afraid that will not work. The registration page is the page that has the [ESPRESSO_EVENTS] and is set to be the main registration page in Event Espresso>General Settings.


      Ion Paciu

        August 23, 2013 at 2:21 pm

        Hi Josh,

        Thank you so much for the above, it works, but only after foreach.. what can I do to use them (at least to use the category name), before the foreach section, for example, I want to use it into the <th> section, bit above that.

        Thank you again for your great support.


        Josh

          August 23, 2013 at 2:48 pm

          Hi Ion,

          You’d need to create another foreach loop for the area where you want to display an event category name for each event.

          Viewing 3 reply threads

          The support post ‘I want to display price and category name in [espresso_table]’ is closed to new replies.

          Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

          Event Espresso - Staging Server