Support

Home Forums Event Espresso Premium Display Early Bird Pricing on Event Archive Page

Display Early Bird Pricing on Event Archive Page

Posted: December 10, 2014 at 11:11 am

Viewing 7 reply threads


Greg Dietrich

December 10, 2014 at 11:11 am

Is there a way to display the early bird registration cost on the event archive page (https://eventsignup.org/event-registration/)? It does show it on the specific event page, just not the overall page.


Josh

  • Support Staff

December 10, 2014 at 4:40 pm

Hi Greg,

Yes, there is and it does involve a bit of PHP programming to make it display the early discount pricing.

If you open up the event_list_display.php file around line 80 you’ll find:

event_cost; ?>

The very last part of that actually displays the price:
echo $org_options['currency_symbol'].$event->event_cost;

You can change it to be:
echo '$' . espresso_return_single_price($event_id, 0);

The espresso_return_single_price() function will display more price info including the early registration price if applicable.

As an aside, it looks like the espresso_return_single_price() function handles the formatting differently for the early discount pricing. Please let me know if you’d like help with getting the formatting consistent between the regular price and discounted price if you go this route.


Greg Dietrich

December 10, 2014 at 5:00 pm

OK, this did what I was hoping it would…though, it stripped out the surcharge from the pricing.


Josh

  • Support Staff

December 10, 2014 at 5:35 pm

Are you sure it stripped out the surcharge from price? 12.50+2.50 = $15.00, right?


Greg Dietrich

December 10, 2014 at 5:56 pm

My bad…moving too fast, it is actually right.

Now one more follow-up…the zero is getting dropped on the event archive page (https://eventsignup.org/event-registration/) for pricing. So instead of displaying $12.5, how can I get it to $12.50.


Josh

  • Support Staff

December 10, 2014 at 6:14 pm

Hi Greg,

When testing this out on my local site I noticed this too. If you open up includes/functions/pricing.php you’ll find where the espresso_return_single_price() function is defined starting around line 37.

On line 63 you’ll see where it returns the $event_cost when there’s an early registration discount. It doesn’t have the number_format() applied to it like the non-discounted prices do. I just pushed a fix for this for Event Espresso 3.1.37.p, and you can apply the same fix by changing that line to:

$event_cost = number_format( $early_price_data['event_price'], 2, '.', '' );


Greg Dietrich

December 10, 2014 at 6:30 pm

OK, easy enough…thanks a lot!


Dean

December 11, 2014 at 12:01 am

Glad you got it sorted, is there anything else we can help with in respect to this forum thread?

Viewing 7 reply threads

The support post ‘Display Early Bird Pricing on Event Archive Page’ 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