Support

Home Forums Event Espresso Premium Display Early Bird in Event Listings

Display Early Bird in Event Listings

Posted: February 22, 2013 at 12:56 pm

Viewing 3 reply threads


mbrammall

February 22, 2013 at 12:56 pm

Hi there, We are having difficulties displaying the Early Bird incentive on the event listings/detail pages and wonder if you can help? The site is: http://agilekrc.com/agile-project-management-training-calendar/ At present, the ‘Early pricing’ only displays on the Cart page. Ideally, each applicable course title would have an ‘Early Bird Discount’ heading shown next to it or something to that effect. I have searched the forum and found a reply saying to activate the ‘Display Short Descriptions in Event Listings’ but this hasn’t changed anything. If you can advise on how to make this happen that would be great. Many thanks, melanie


Dean

February 25, 2013 at 3:43 am

Hi Melanie,

One way to do this would be a small edit in the event_list.php and event_list_display.php files

In the event_list.php around line 282 below foreach ($events as $event) { add

$earlybird = $event->early_disc;

and then in event_list_display.php around line 43 add something like this inside the H3 tag (so that it is displayed after the title)

    <?php if($earlybird != '' && $earlybird >= date('Y-m-d')) {echo "Early Bird Discount Available";}  ?>


Neal Otto

March 8, 2013 at 2:45 am

Thank you for this. I tried it and it works. It now shows Early Bird Discount Available.

In addition, is it possible to show the actual discounted amount as well?


Josh

  • Support Staff

March 8, 2013 at 11:51 am

Hi Neal,

Yes, this is possible. It involves adding a few more variables to the event_list.php template:

$early_perc = $event->early_disc_percentage;
$early_full_cost = $event->event_cost;
$early_disc_date = $event->early_disc_date;

Then some logic in event_list_display.php:

<?php 
// add Early Bird Discount to the listing page 
if ($early_perc == 'Y') {
$show_early = $early_full_cost / 100 * $earlybird;
} else {
$show_early = $early_full_cost - $earlybird;
} ?>

Then where you want the discount to display:

<?php if($earlybird != '' && $early_disc_date >= date('Y-m-d')) {
 echo 'Early Bird Discount Available of ' . $org_options['currency_symbol'].number_format($show_early, 2, '.', '');
}  ?>

There’s an additional check added there to make sure that the discount only displays before the early registration cut-off date.

Viewing 3 reply threads

The support post ‘Display Early Bird in Event Listings’ 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