Support

Home Forums Event Espresso Premium How to display event price range in template

How to display event price range in template

Posted: October 24, 2014 at 6:03 am


Sam Hastings

October 24, 2014 at 6:03 am

I’m using WordPress 4.0 and a brand new installation of EE 4.4.3.p with no add-ons.

I’m trying to create a custom theme for EE to fit in with the rest of my site but right now I can’t work out how to display the price of the event (this needs to be displayed on the event archive page). Ideally it should display a range (eg £100–£200) if there are multiple ticket prices.

I’ve looked through core code and I can’t find any functions or methods which will return this.

Is there any way of getting this info? If custom PHP code is the answer that’s fine, but I’d still appreciate a point in the right direction.


Sam Hastings

October 24, 2014 at 6:08 am

Having studied the database structure a little bit I’ve just written the following query which grabs the info I want.

Obviously if there’s a cleaner way than directly querying the database I’d love to hear it 🙂

SELECT MIN(t.TKT_PRICE)
     , MAX(t.TKT_PRICE)
  FROM wp_esp_datetime d
INNER
  JOIN wp_esp_datetime_ticket dt
    ON dt.DTT_ID = d.DTT_ID
INNER
  JOIN wp_esp_ticket t
    ON t.TKT_ID = dt.TKT_ID
 WHERE d.EVT_ID = 1549;


Dean

October 27, 2014 at 1:45 am

Hi,

I can’t see any pre-built functions for this, so I think you are about right going ahead with a direct database query.

The support post ‘How to display event price range in template’ 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