Support

Home Forums Event Espresso Premium Free Event is not free

Free Event is not free

Posted: December 22, 2013 at 10:11 am

Viewing 21 reply threads


d37toastmasters

December 22, 2013 at 10:11 am

I have event with base price set to $0 and registration form includes a question that modifies the event price: http://d37toastmasters.org/wp-content/uploads/2013/12/ee-pic1_12-22-2103.jpg

I would like to permanently remove “Free Event” description just above the Start Date.

Thank you,

Jake


Dean

December 23, 2013 at 12:32 am

Hi Jake,

If you want to remove it from ALL events it’s a just a little bit of CSS:

/* for the event list */
.event_price { display: none; }

/* for the single registration page */
.event_prices { display: none; }

If you have events where the price needs to be displayed, you are going to have to edit the appropriate templates and do an IF statement to hide the price only if event price equals 0.00


d37toastmasters

December 23, 2013 at 3:39 am

Hi Dean,

It is only for events with price = $0. Can you provide a name of php file (template) that needs to be modified and a simple code snipet?

Thank you,

Jake


Josh

  • Support Staff

December 23, 2013 at 1:03 pm

Hi Jake,

You might be on an older version of Event Espresso because the “Free Event” label was removed from the registration page in version 3.1.36. If you look in pricing.php ~ line 441 you’ll see the line of code that displays the price there:

$html .= '<span class="event_price_label">' . __('Price:', 'event_espresso') . '</span> <span class="event_price_value">' . $org_options['currency_symbol'] . number_format($result->event_cost, 2) . $message . $surcharge . '</span>';

This, and other instances where the price gets displayed can be wrapped in an if statement like Dean described. Here is one example:

if ( $result->event_cost != '0.00' ) {
                $html .= '<span class="event_price_label">' . __('Price:', 'event_espresso') . '</span> <span class="event_price_value">' . $org_options['currency_symbol'] . number_format($result->event_cost, 2) . $message . $surcharge . '</span>';
                }


d37toastmasters

December 24, 2013 at 3:57 am

Hi Josh,

We are running the latest version 3.1.36.1.P. Also, in what folder is pricing.php file located?

Jake


Josh

  • Support Staff

December 24, 2013 at 10:28 am

Hi Jake,

It’s in /includes/functions/


d37toastmasters

December 25, 2013 at 1:26 pm

I made the recommended change with the “if” statement listed above but my event is still showing “Free Event” verbiage. This event has a base price set to $0.00. Was this tested on your site and it it working for you as expected? Just to recap as to what my goal is here, I want to show the price for events with price != 0 and for the events with price = $0 I do not want to show “Free Event” verbiage. For these events I do not want to display any verbiage.

Thank you,

Jake


Josh

  • Support Staff

December 26, 2013 at 11:04 am

Hi Jake,

Was this tested on your site and it it working for you as expected?

Of course, here’s a screenshot:

screenshot

Did you earlier make modifications to the event_espresso_price_dropdown function and have it loading elsewhere? That might explain why you’re still seeing the “Free Event” text. The Free Event text was removed from the event_espresso_price_dropdown function in Event Espresso 3.1.36 and shouldn’t be displaying there anyway.


d37toastmasters

December 27, 2013 at 2:20 am

Hi Josh,

Thank you for the screenshot. My changes with the “if” statement are identical to yours. I do not recall ever making changes to event_espresso_price_dropdown function, but would be happy to check the details if you let me know where and what to look for. I also asked the hosting company to reset the caching used on the backend just to be sure there are no caching issues.

Thank you,

Jake


d37toastmasters

December 27, 2013 at 2:22 am

I just realized that I’m also using Event Espresso – Price Modifier plugin, version 0.0.3.1.B. Not sure if this could be the culprit.

Jake


Dean

December 27, 2013 at 6:07 am

Hi Jake,

Josh’s code does work, but only for the event registration page. I think, like me, you are still seeing the price on the event list.

If that is the case you could edit the event_list_display.php file at approx line 78, where it states:

			<?php 
				if ( $event->event_cost != '0.00' ) {
			?>
					<p id="p_event_price-<?php echo $event_id ?>" class="event_price"><span class="section-title"><?php  echo __('Price: ', 'event_espresso'); ?></span> <?php echo  $org_options['currency_symbol'].$event->event_cost; ?></p>
			<?php } else { ?> 
					<p id="p_event_price-<?php echo $event_id ?>" class="event_price"><span class="section-title"><?php  echo __('Price: ', 'event_espresso'); ?></span> <?php echo __('Free Event', 'event_espresso'); ?></p>
			<?php } ?>

And remove the code from the else statement, like so:

			<?php 
				if ( $event->event_cost != '0.00' ) {
			?>
					<p id="p_event_price-<?php echo $event_id ?>" class="event_price"><span class="section-title"><?php  echo __('Price: ', 'event_espresso'); ?></span> <?php echo  $org_options['currency_symbol'].$event->event_cost; ?></p>
			<?php } else { ?> 

			<?php } ?>

This will not display the price if it is zero – http://d.pr/i/hnCp


d37toastmasters

December 27, 2013 at 6:20 am

Hi Dean,

I do not believe I have event list defined. The “Free Event” verbiage is being displayed directly on the event registration page: http://d37toastmasters.org/wp-content/uploads/2013/12/ee_Free_Event_12-27-2013.jpg

Thank you,

Jake


Dean

December 27, 2013 at 7:21 am

Hi Jake,

OK, you were partially right, it’s the Seating Chart addon that is causing the issue.

So, assuming you have that add on installed, in registration_page_display.php find (line 80 approx):

if (defined('ESPRESSO_SEATING_CHART')) {
						$seating_chart_id = seating_chart::check_event_has_seating_chart($event_id);
						if ($seating_chart_id !== FALSE) {
							$display_price_dropdown = FALSE;
						}
					} 

and change it to

if ( $event_cost != '0.00' ) {

					if (defined('ESPRESSO_SEATING_CHART')) {
						$seating_chart_id = seating_chart::check_event_has_seating_chart($event_id);
						if ($seating_chart_id !== FALSE) {
							$display_price_dropdown = FALSE;
						}
					}
}

If you dont have Seating Chart installed please advise what plugins you do have.


d37toastmasters

December 27, 2013 at 7:29 am

Hi Dean,

I do not have the Seating Chart plugin. I have the following plugins installed:

Event Espresso by Event Espresso version 3.1.36.1.P
Calendar by Event Espresso version 2.2.0.p
Members Addon by Event Espresso version 1.9.8.p
Permissions by Event Espresso version 1.5.5.p
Price Modifier by Event Espresso version 0.0.3.1.B
Ticketing by Event Espresso version 2.1.p
API Plugin by Event Espresso version 2.0.2.p

Thank you,

Jake


Tony

  • Support Staff

December 27, 2013 at 8:21 am

Hi Jake,

I notice from your previous threads you have the Custom Files Add-on installed (custom_functions.php) can you check in there for the event_espresso_price_dropdown function.


d37toastmasters

December 27, 2013 at 8:51 am

Hi Tony,

I’d be happy to check. What folder is this file suppose to be located in ?

Jake


Tony

  • Support Staff

December 27, 2013 at 9:00 am

If you are still currently using it it should be within

/wp-content/uploads/espresso/


d37toastmasters

December 27, 2013 at 9:08 am

There are four subfolders there (gateways, languages, logs and templates) but I do not see the file there at all. Is it possible the file/folder is hidden?

Thank you,

Jake


Josh

  • Support Staff

December 27, 2013 at 3:43 pm

Hi Jake,

Typically files are not hidden when you view them in an FTP client. The name of the file is custom_functions.php. However, Event Espresso functions can also be override by a custom snippets plugin (located in the plugins folder) or within a theme’s functions.php file.


d37toastmasters

December 28, 2013 at 9:46 am

Ok, I think I figured it out. I downloaded all the web files locally on my computer and then ran Windows Grep to search for “Free Event” text string. I got the following list:

wp-content\plugins\member_functions.php
wp-content\plugins\event-espresso\includes\event_functions.php
wp-content\plugins\event-espresso\includes\cart.php
wp-content\plugins\event-espresso\includes\pricing.php
wp-content\plugins\event-espresso\includes\template_files.php
wp-content\plugins\event-espresso\templates\event_list_display.php

By changing the verbiage in each file I was able to determine that the changes needs to be done in wp-content\plugins\member_functions.php. By commenting out the line 455 I was able to successfully remove “Free Events” verbiage from my event description. Do I need to comment the line 456 as well?

455 //$html .= ‘<span class=”free_event”>’ . __(‘Free Event’, ‘event_espresso’) . ‘</span>’;
456 $html .= ‘<input type=”hidden” name=”payment’ . $multi_name_adjust . ‘” id=”payment-‘ . $event_id . ‘” value=”‘ . __(‘free event’, ‘event_espresso’) . ‘”>’;

Thank you,

Jake


Dean

December 30, 2013 at 5:01 am

Hi Jake,

Please do not comment out the hidden input, it’s used by the plugin to help process to registration.


d37toastmasters

December 30, 2013 at 7:48 am

Ok, thanks.

Jake

Viewing 21 reply threads

The support post ‘Free Event is not free’ 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