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.
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;
I can’t see any pre-built functions for this, so I think you are about right going ahead with a direct database query.
Viewing 2 reply threads
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.
Support forum for Event Espresso 3 and Event Espresso 4.