Support

Home Forums Event Espresso Premium Customizing EE3 Registration page

Customizing EE3 Registration page

Posted: November 16, 2015 at 1:15 pm

Viewing 3 reply threads


Steven Hoskinson

November 16, 2015 at 1:15 pm

Hi
i have 2 issues

1- Where do i place customized grid view template for EE3 in order for it to work?

2- On EE3 registration page, i want to replace the price options’ dropdown menu with radio buttons

Here is the function i edited

function event_espresso_price_dropdown2($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 "<pre>".print_r($atts,true)."</pre>";
		extract($atts);
        global $wpdb, $org_options;
       	
		$html = '';
		
		$label = $label == '' ? '<span class="'.espresso_template_css_class('section_title','section-title', false).'">'.__('Choose an Option:', 'event_espresso').'</span>' : $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( $wpdb->prepare("SELECT id, event_cost, surcharge, surcharge_type, price_type FROM " . EVENTS_PRICES_TABLE . " WHERE event_id='%d' ORDER BY id ASC", $event_id) );

        if ($wpdb->num_rows > 1) {
           //Create the label for the drop down
			$html .= $show_label == 1 ? '<label for="event_cost">' . $label . '</label>' : '';
	
			//Create a dropdown of prices

            foreach ($results as $result) {

			  $selected = isset($current_value) && $current_value == $result->id ? ' selected="checked" ' : '';

                // Addition for Early Registration discount
                if ($early_price_data = early_discount_amount($event_id, $result->event_cost)) {
                    $result->event_cost = $early_price_data['event_price'];
                    $message = __(' Early Pricing', 'event_espresso');
                } else {
					$message = '';
				}

                $surcharge = '';

                if ($result->surcharge > 0) {
                    $surcharge = " + {$org_options['currency_symbol']}{$result->surcharge} " . $surcharge_text;
                    if ($result->surcharge_type == 'pct') {
                        $surcharge = " + {$result->surcharge}% " . $surcharge_text;
                    }
                }

                //Using price ID
                $html .= '<input type="radio" ' . $selected . ' name="radio" value="' . $result->id . '|' . stripslashes_deep($result->price_type) . '">' . stripslashes_deep($result->price_type) . ' (' . $org_options['currency_symbol'] . number_format($result->event_cost, 2) . $message . ') ' . $surcharge . ' <br>';
            }
        } else if ($wpdb->num_rows == 1) {
            foreach ($results as $result) {

                // Addition for Early Registration discount
                if ($early_price_data = early_discount_amount($event_id, $result->event_cost)) {
                    $result->event_cost = $early_price_data['event_price'];
                    $message = sprintf(__(' (including %s early discount) ', 'event_espresso'), $early_price_data['early_disc']);
                }

                $surcharge = '';

                if ($result->surcharge > 0) {
                    $surcharge = " + {$org_options['currency_symbol']}{$result->surcharge} " . $surcharge_text;
                    if ($result->surcharge_type == 'pct') {
                        $surcharge = " + {$result->surcharge}% " . $surcharge_text;
                    }
                }
                $message = isset($message) ? $message : '';

                /*if ( $result->event_cost != '0.00' ) {
                    $html .= '<span class="'.espresso_template_css_class('event_price_label','event_price_label', false).'">' . __('Price:', 'event_espresso') . '</span> <span class="'.espresso_template_css_class('event_price_value','event_price_value', false).'">' . $org_options['currency_symbol'] . number_format($result->event_cost, 2) . $message . $surcharge . '</span>';
                    $html .= '<input type="hidden" name="price_id' . $multi_name_adjust . '" id="price_id-' . $result->id . '" value="' . $result->id . '" />';
                    $html .= '<span class="'.espresso_template_css_class('free_event','free_event', false).'">' . $result->price_type . '</span>';
				}*/

				$html .= '<span class="'.espresso_template_css_class('event_price_label','event_price_label', false).'">' . __('Price:', 'event_espresso') . '</span> <span class="'.espresso_template_css_class('event_price_value','event_price_value', false).'">' . $org_options['currency_symbol'] . number_format($result->event_cost, 2) . $message . $surcharge . '</span>';
				$html .= '<input type="hidden" name="price_id' . $multi_name_adjust . '" id="price_id-' . $result->id . '" value="' . $result->id . '" />';
            }
        }
       	echo $html;
		return;
    }
	add_action('espresso_price_select2', 'event_espresso_price_dropdown2', 20, 2);

i edited this function to get the desired display
but when i proceed to confirm registration page, the price is $0.00 no matter which radio button i select
Can you please guide me on how can i save the value from checked radio button?

Thanks !!


Josh

  • Support Staff

November 16, 2015 at 5:54 pm

Hi Steven,

It will check in your theme, but you’ll need to add a folder with the name espresso-template-{template_name}/ in the theme. So for example in your child theme you add a folder named espresso-template-events-table and put your custom template.php in that folder.

There’s some documentation here:
https://eventespresso.com/wiki/custom-templates-add-on-create-a-template/

For your code modification, I think the name="radio" part of your code might be breaking something.


Steven Hoskinson

November 20, 2015 at 5:48 am

Hi
i worked out another solution around the radio button issue

but for the first issue, i am already using a customized table template
what i want now is to customize the index.php file in grid view add-on which is a separate add-on that works with custom template add-on


Tony

  • Support Staff

November 20, 2015 at 11:31 am

Hi Steven,

Currently the grid template add-on doesn’t allow for a custom template to be loaded, however the latest development version of that add-on does allow for this. It has an index.php and template.php file, the template file can be loaded from your theme as describe above.

If you would like to to test that copy I can send it to the email address link your your account?

Viewing 3 reply threads

The support post ‘Customizing EE3 Registration 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