Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-sales domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-click-to-tweet domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-amazon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-stats domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114 Ticketing + S2member Levels + Custom | Event Espresso - Staging Server
I have S2Member set up with 2 levels, Single and Family. Each gets a discount on tickets off the General Admission Price, differeing per events.
I am trying to customize the Registration Page so that the Ticket Price Dropdown will show only the Tickets for that Logged-in User’s Level.
Currently, EE handles Members (Logged In), but I need this to go another level. I created 2 member tickets, named “member family” and “member single”.
So using Files, I added a custom function that checks if the ticket name begins with “member” and then the next word “family” or “single” matches the user’s role. If so, it gets added to the dropdown, if not, move on to the next ticket.
In the Default column, I added a General Admission Ticket and a Meal Ticket.
The standard Registration shows “Member Single” and “Family Single” in the dropdown. My slightly modified version shows “General Admission” and “Meal Ticket”. Not good.
I looked in the data, and was not happy to see 2 records, General Admission and Meal Ticket, the 1st linked to Member Single ticket, the Meal ticket linked to Member Family.
I hadn’t realized your Ticket form was a “lazy row”. Now I have to figure out how to accommodate both single and family tickets. Also, I still don’t know why my modified page is showing only Standard Tickets – I added below to custom functions. I created a new action that I call from the Register_event_display.php template. I added debugging text too.
`
/*
Creates dropdowns if multiple prices are associated with an event
* @source plugins/espresso/includes/pricing.php
* @params int $event_id
* @params int $atts
* – bool multi_reg If this is a mutliple regsitration, then it cahnges the registration proerties
* – bool show_label Show the label above the dropdown
* – var current_value pass the price id to show a selected price by default
*/
function nanba_event_espresso_price_dropdown($event_id, $atts) {
do_action(‘action_hook_espresso_log’, FILE, FUNCTION, ”);
//Attention:
//If changes to this function are not appearing, you may have the members addon installed and will need to update the function there.
//echo “”.print_r($atts,true).””;
extract($atts);
global $wpdb, $org_options;
$html = '';
$label = $label == '' ? ''.__('Choose an Option: ', 'event_espresso').'' : $label;
//Will make the name an array and put the time id as a key so we know which event this belongs to
$multi_name_adjust = isset($multi_reg) && $multi_reg == true ? "[$event_id]" : '';
$surcharge_text = isset($org_options['surcharge_text']) ? $org_options['surcharge_text'] : __('Surcharge', 'event_espresso');
$results = $wpdb->get_results("SELECT id, event_cost, surcharge, surcharge_type, price_type FROM " . EVENTS_PRICES_TABLE . " WHERE event_id='" . $event_id . "' ORDER BY id ASC");
if ($wpdb->num_rows > 1) {
//Create the label for the drop down
$html .= $show_label == 1 ? '' . $label . '' : '';
//Create a dropdown of prices
$html .= '';
foreach ($results as $result) {
First off, if you activate member, you want to use wp-content/plugins/espresso-members/member_functions.php::event_espresso_price_dropdown. I copied it into /wp-content/uploads/espresso/custom_functions.php, adding code that inspects all member tickets, named “member <>”. If the 2nd word matches the logged in user’s role, it gets added to the dropdown, otherwise not.
I had to create 2 General Admission Tickets to accommodate the 2 member levels. FEATURE REQUEST: Add 1-to-m ticket ‘classes’ with multiple Public (not default prices) as well as multiple member prices. UI: First, create the classes (or category) of tickets, then tickets you assign to 1 or more classes. You can then have Public Adult, Public Kid, Public Senior Tix as well as multiple Members, as well as Food Tickets.
1 more thing: s2member assigns s2member_level[n] to users, not the label names like single or family. I hardcoded an array to translate single or family to that format when checking roles.
Wow. Thank you for the explanation of what you are wanting. I am definitely going to add this to our feature request list so our developers will be aware of your suggestion. I will link back to this post so they can see your explanation.
Thanks again.
Viewing 2 reply threads
The support post ‘Ticketing + S2member Levels + Custom’ 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.