Posted: May 16, 2013 at 11:59 am
|
Hey Chaps, My client has a rather complicated pricing structure which we are trying to get around. First a clarification, we are using espresso for sports coaches to sign up their various teams to events, so we’re essentially selling ‘team entries’ rather than tickets to the public, if that makes sense. So with that in mind, for some events, she charges per team and for some she charges per age group. We are essentially using ‘tickets’ as a means of totalling up an event booking. To cut a long story short, we want to continue to use tickets as a way of totalling up an order, but we need to be able to change some wording beside the ticket selection based on the pricing structure for the event. Is there a way of removing the ‘Number of Tickets’ wording from the below piece of code, and replacing it with a my_meta_key, which she can then use to either type ‘Number of Teams’ or ‘Number of Age Groups’ into each event she creates?? [code]echo event_espresso_additional_attendees($event_id, $additional_limit, $number_available_spaces, __(‘Number of Tickets’, ‘event_espresso’), true, $event_meta);[/code] |
|
Hi, If you have no objection to editing a php template, then what I would do is edit the registration_page_display.php and where it says (approx line 238) echo event_espresso_additional_attendees($event_id, $additional_limit, $number_available_spaces, __('Number of Tickets', 'event_espresso'), true, $event_meta); Change it to $dean = do_shortcode('[EE_META type="event_meta" name="one"]'); if($dean != '') { echo event_espresso_additional_attendees($event_id, $additional_limit, $number_available_spaces, $dean, true, $event_meta); } else { echo event_espresso_additional_attendees($event_id, $additional_limit, $number_available_spaces, __('Number of Tickets', 'event_espresso'), true, $event_meta); } Change the XXXXX to the name of the custom meta field. So all this does is grab the meta field content and check if it is empty, if not it uses the value of the meta field, if it is empty it shows the default Number of Tickets. |
|
Aghhhh Dean, you LEGEND!!! Worked perfectly. Thanks very much mate. |
|
Dean, could we go one step further and make the Event Meta ‘Key’ a default one, much like you’ve done with the Event_hashtag, Event_format, and Event_livestreamed? Is there much involved to doing that? |
There is some sample code in the ee-meta documentation that you can modify and copy to the custom files add-on’s custom_functions.php file. The first value is the meta key, and the second value is the default value. https://eventespresso.com/wiki/shortcodes-template-variables/#ee-meta |
|
|
Thanks Josh, Id love access to the custom_functions.php file, but it won’t let me. Says I need a business licence, or a VIP membership. As you can see from my account, I do have VIP membership, but not a business license. Not sure how to get those files?!? |
|
I am sorry if this is a duplicate, I thought I had responded earlier to this. Basically, the documentation should be available to view, I logged in under your account and viewed it with no issues. The Custom Files add on, is only available via the Business Licence or a separate purchase. |
|
Hi Dean, Yes I can see the small amount of documentation on the custom files addon, (one paragraph and a yellow info box saying i need a business license OR VIP access) – I don’t have a business license, but I have purchased VIP Access, so I should be able to access custom_functions.php, no?
|
Hi there, You only get access to the files for products you own. Since the custom files add-on isn’t included with the personal license, you’d need to purchase the custom files add-on separately or upgrade to the business license. |
|
|
I see. No worries, thanks Josh. |
|
Hi Jeanette, We are now currently working on giving VIP’s access to all/most of the documentation, regardless of ownership. Obviously though to make use of the documentation you will need the appropriate licence/add plugin. |
|
Yes that makes sense Dean. I shall contact my client (Jeanette) and recommend purchasing the plugin you guys are suggesting. Best, Andrew |
The support post ‘Using my_meta_key in place of 'Number of Tickets' – Can It Be Done?’ 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.