How to Change the events CPT Slug

By default, Event Espresso 4 uses the /events/ Custom Post Type (CPT) slug (permalink) to organize your events. The word “events” is a generic term for all types of happenings, classes, conferences, workshops, fundraisers, virtual events, etc. If your organization hosts one type of event, or uses a different word or translated word, it may add clarity to your events by renaming the events CPT slug to the single type of event that you host, e.g. “workshops” or “conferences”.

To Change the Custom Post Type (CPT) Slug

Login to your WordPress dashboard (WP-admin) and go to Events –> Templates. Then look for the Events List Pages section and then Event Slug. Change events to your new slug (e.g. workshops, courses, classes, etc) and save changes by clicking on the save button.

change-events-custom-post-types-slug

Then immediately go to Settings (your WordPress settings not Event Espresso settings) –> Permalinks to refresh your permalink on your WordPress site. This step is important.

More Information
For more information about re-declaring/changing a plugin’s Custom Post Type slug, please check this post on the WordPress Stack Exchange website: http://wordpress.stackexchange.com/questions/41988/redeclare-change-slug-of-a-plugins-custom-post-type

Want to change the custom post type slug for venues? See this tutorial

Want to change the custom post type slug for people (People add-on)? See this tutorial

Posted in | Comments Off on How to Change the events CPT Slug

How to Add a PayPal is Optional Message to Registration Checkout

In this tutorial we will explain how to add a message to registration checkout to let your registrants know that a PayPal account is optional. This will only work for PayPal premier and business account holders. Additionally, PayPal disables guest checkout for buyers in certain countries. If you are not sure if you have the correct account, then please get in touch with PayPal support.

Enable Guest Checkout through your PayPal Account

Login to your PayPal.com account. Then click on Profile. On the next page, locate the Selling online section and then Website preferences. Click on the Update link for Website preferences. Scroll down the page until you see the setting for PayPal Account Optional. Set it to On and then click on the Save button which appears at the end of the page.

Change the Current PayPal Messaging

The existing PayPal messaging can be changed using a gettext filter for WordPress. Below we have some sample code that will do that for you:

function ee_payment_options_paypal_optional( $translated, $original, $domain ) {
$strings = array(
 'After finalizing your registration, you will be transferred to the PayPal.com website where your payment will be securely processed.' => 'Upon clicking on the Finalize Registration button, you will be transferred to PayPal.com where your payment will be securely processed. A <strong>PayPal account is not required</strong> and you can pay with a credit or debit card.'
 );
if ( isset( $strings[$original] ) ) {
 $translations = &get_translations_for_domain( $domain );
 $translated = $translations->translate( $strings[$original] );
 }
return $translated;
}
add_filter( 'gettext', 'ee_payment_options_paypal_optional', 10, 3 );

The filter above works by looking for a match for the existing messaging for PayPal and then replacing it with something else. The sample code can be copied and pasted into a site specific plugin. Be sure to save your edits and then you can go to an event and begin a registration to see how it appears.

Here is what our sample code looks like on the registration checkout page:

registration-checkout-paypal-optional-message

You can take this tutorial a step further by changing the default PayPal logo to one that shows the PayPal logo and major credit cards. See this additional resource for more information:

https://gist.github.com/lorenzocaum/831c531ca80906af2353

Posted in | Comments Off on How to Add a PayPal is Optional Message to Registration Checkout

How to Setup a Default Value of 1 for the Ticket Selector

By default the ticket selector will have different quantities of tickets available — usually 0 through 10. It may be useful to have the ticket selector set to a certain value for certain events. For example, if you are hosting a training course or an online meeting or webinar, then it would be helpful to have the ticket selector default to a value of 1. This will speed up the registration checkout process since the registrant would not need to adjust the ticket selector from 0 to 1.

In the first part of this tutorial, we’ll create a ticket that has a minimum and maximum quantity and in the second part we’ll setup a code snippet of jQuery to handle removing the 0 value. Once both of these are in place, then the ticket selector will default to a value of 1.

This workaround is no longer needed in the current version of Event Espresso 4. You can set a ticket to required via the advanced options in the ticket editor and it will be automatically set the ticket quantity to 1.

Create a Ticket with a Minimum and Maximum Quantity of 1

Login to your WordPress admin. Then find Event Espresso in your WordPress admin menu and click on Events. Now look for your event in the event overview page and click on it. This will take you to the Event Editor.

If this is a new event, then go ahead and setup your event by adding a title, description, venue, tickets, etc and then save your event as a draft. If this is an existing event, then scroll down to the Event Tickets & Datetimes area. Then click on the gear to access the advanced options for this ticket. Now set the Minimum Quantity to 1 and set the Maximum Quantity to 1:

event-editor-minimum-maximum-quantity

Use jQuery to Remove the Value of 0

Next, we need to add some jQuery to remove the value of 0. Below we have some sample code that will do that for you:

function ee_default_ticket_selector_one() {
 $post = get_the_id();
 if( $post == 123 ) {
 ?>
 <script type="text/javascript">
 jQuery(document).ready(function () {
 jQuery("#ticket-selector-tbl-qty-slct-123-1 option[value='0']").remove();
});
 </script>
 <?php
 }
}
add_action( 'wp_footer', 'ee_default_ticket_selector_one' );

It checks to see if you are on a specific single event page. Then it removes the option value of 0.

The sample code above can be copied and pasted into a site specific plugin.

Then change the number 123 (used twice in the sample code above) to the post id of your actual event. The post id appears to the left of the event name when viewing the events overview screen. It also appears at the end of the URL when viewing an event in the event editor. Be sure to save changes after updating the sample code. Then view your event page on the front end and the quantity selector should now default to 1.

Here is what the ticket selector for our example event looks like:

front-end-ticket-selector-quantity-1

Additional Examples

If you would like to remove the 0 value for an event with a post id of 123 and an additional event with a post id of 456, then you could use the sample code below.

function ee_default_ticket_selector_one_multiple_events() {
 $post = get_the_id();
 ?>
 <script type="text/javascript">
 jQuery(document).ready(function () {
 jQuery("#ticket-selector-tbl-qty-slct-123-1 option[value='0']").remove();
 jQuery("#ticket-selector-tbl-qty-slct-456-1 option[value='0']").remove();
});
 </script>
 <?php
 }
add_action( 'wp_footer', 'ee_default_ticket_selector_one_multiple_events' );

If you would like to remove the 0 value for all events, then you could use the sample code below.

function ee_default_ticket_selector_one_all_events() {
 ?>
 <script type="text/javascript">
 jQuery(document).ready(function () {
 jQuery("option[value='0']").remove();
});
 </script>
 <?php
 }
add_action( 'wp_footer', 'ee_default_ticket_selector_one_all_events' );

Be advised that it will remove the value of 0 from all select menus on your site since the conditional check for a specific single event page and CSS id targetting is no longer in place.

Posted in | Comments Off on How to Setup a Default Value of 1 for the Ticket Selector

How to Style the Registration Checkout Buttons using CSS

In this guide, we’ll show you how to style the buttons that are used on the front end for Event Espresso. Below we have examples of the buttons that you’ll see during registration checkout. The buttons below are from the Twenty Twelve theme which includes basic styling for buttons.

event-espresso-proceed-to-payment-options-button This button is used after entering registrant details and will take you to the payment options page
event-espresso-finalize-registration-button This button is used to finish up a registration and will take you to the thank you page
event-espresso-process-payment-button This button is used to process a payment if the initial payment attempt fails
event-espresso-update-registration-details-button This button is used to update the registration details for an existing registration

 

Some themes include existing styling for buttons while others do not. If your theme does not have existing styles for buttons, then your buttons may appear as a default grey.

These buttons can be styled to any color by using CSS and these styles can be added to your child theme’s stylesheet or through a plugin like My Custom CSS or Reaktiv CSS Builder.

Proceed to Payment Options button style

A tool like Firebug or Chrome Developer Tools can be used to inspect the buttons to see the CSS classes and ids that are in use. Here is an example from Chrome Developer Tools for the Proceed to Payment Options button:

proceed-to-payment-options-chrome-developer-tools

The screenshot shows that there is a CSS id of spco-go-to-step-payment_options-btn and a CSS class of spco-next-step-btn. We can then use this information to change the style for our button. The following code will change the color for the Proceed to Payment Options button from grey to blue:

#spco-go-to-step-payment_options-btn {
   border-top: 1px solid #96d1f8;
   background: #65a9d7;
   padding: 5px 10px;
   -webkit-border-radius: 5px;
   -moz-border-radius: 5px;
   border-radius: 5px;
   -webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
   -moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
   box-shadow: rgba(0,0,0,1) 0 1px 0;
   text-shadow: rgba(0,0,0,.4) 0 1px 0;
   color: white;
   font-size: 14px;
   text-decoration: none;
   vertical-align: middle;
   }
#spco-go-to-step-payment_options-btn:hover {
   border-top-color: #28597a;
   background: #28597a;
   color: #ccc;
   }
#spco-go-to-step-payment_options-btn:active {
   border-top-color: #1b435e;
   background: #1b435e;
   }

To apply these new styles, just copy and paste them into your child theme’s stylesheet or into a plugin like My Custom CSS or Reaktiv CSS Builder.

Finalize Registration button style & Process Payment button style & Update Registration Details button style

The Finalize Registration button, Process Payment button, and Update Registration Details button have a CSS id of spco-go-to-step-finalize_registration-btn and a CSS class of spco-next-step-btn. The following code will change the color for the Finalize Registration button, Process Payment button, and Update Registration Details button from grey to blue:

#spco-go-to-step-finalize_registration-btn {
   border-top: 1px solid #96d1f8;
   background: #65a9d7;
   padding: 5px 10px;
   -webkit-border-radius: 5px;
   -moz-border-radius: 5px;
   border-radius: 5px;
   -webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
   -moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
   box-shadow: rgba(0,0,0,1) 0 1px 0;
   text-shadow: rgba(0,0,0,.4) 0 1px 0;
   color: white;
   font-size: 14px;
   text-decoration: none;
   vertical-align: middle;
   }
#spco-go-to-step-finalize_registration-btn:hover {
   border-top-color: #28597a;
   background: #28597a;
   color: #ccc;
   }
#spco-go-to-step-finalize_registration-btn:active {
   border-top-color: #1b435e;
   background: #1b435e;
   }

To apply these new styles, just copy and paste them into your child theme’s stylesheet or into a plugin like My Custom CSS or Reaktiv CSS Builder.

View Details and Register Now button style

The following buttons are not using during registration checkout but CSS examples are included below.

event-espresso-view-details-button This button is used on the event list page
event-espresso-register-now-button This button is used on the single event pages

 

The View Details buttons and Register Now buttons will have different CSS ids for each event. For example, if our event had a post id of 123, then the CSS id would be ticket-selector-submit-123-btn.

The following code will change the color for the View Details button and Register Now button for a specific event with a post id of 123 from grey to blue:

#ticket-selector-submit-123-btn {
   border-top: 1px solid #96d1f8;
   background: #65a9d7;
   padding: 5px 10px;
   -webkit-border-radius: 5px;
   -moz-border-radius: 5px;
   border-radius: 5px;
   -webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
   -moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
   box-shadow: rgba(0,0,0,1) 0 1px 0;
   text-shadow: rgba(0,0,0,.4) 0 1px 0;
   color: white;
   font-size: 14px;
   text-decoration: none;
   vertical-align: middle;
   }
#ticket-selector-submit-123-btn:hover {
   border-top-color: #28597a;
   background: #28597a;
   color: #ccc;
   }
#ticket-selector-submit-123-btn:active {
   border-top-color: #1b435e;
   background: #1b435e;
   }

The CSS class of ticket-selector-submit-btn applies to all View Details and Register Now buttons. The following code will change the color for all View Details buttons and Register Now buttons from grey to blue:

.ticket-selector-submit-btn {
   border-top: 1px solid #96d1f8;
   background: #65a9d7;
   padding: 5px 10px;
   -webkit-border-radius: 5px;
   -moz-border-radius: 5px;
   border-radius: 5px;
   -webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
   -moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
   box-shadow: rgba(0,0,0,1) 0 1px 0;
   text-shadow: rgba(0,0,0,.4) 0 1px 0;
   color: white;
   font-size: 14px;
   text-decoration: none;
   vertical-align: middle;
   }
.ticket-selector-submit-btn:hover {
   border-top-color: #28597a;
   background: #28597a;
   color: #ccc;
   }
.ticket-selector-submit-btn:active {
   border-top-color: #1b435e;
   background: #1b435e;
   }

To apply these new styles, just copy and paste them into your child theme’s stylesheet or into a plugin like My Custom CSS or Reaktiv CSS Builder.

There are several resources available for creating CSS buttons:

CSS tricks button maker

CSS portal button generator

CSS drive button generator

Posted in | Comments Off on How to Style the Registration Checkout Buttons using CSS

How to Customize the Checkout Registration Button Text

In this article, we’ll show you how to customize the text that is used for these buttons. Below we have examples of the buttons that you’ll see during registration checkout:

event-espresso-proceed-to-payment-options-button This button is used after entering registrant details and will take you to the payment options page
event-espresso-finalize-registration-button This button is used to finish up a registration and will take you to the thank you page
event-espresso-update-registration-details-button This button is used to update the registration details for an existing registration

 

These changes will be applied using WordPress filters. Its best to add the sample code snippets below to a site specific plugin. You can view our guide on creating a site specific plugin for WordPress.

Some Example code

Here’s some example code that’s intended to be instructional. If you’re familiar with the WordPress Plugin API you’ll note the use of the add_filters() function:

Specific, one-off examples

How to change the Proceed to Payment Options button text

The following code will change the only the text for the Proceed to Payment Options button:

function ee_proceed_to_button( $submit_button_text, EE_Checkout $checkout ) {
 if ( ! $checkout instanceof EE_Checkout || ! $checkout->current_step instanceof EE_SPCO_Reg_Step || ! $checkout->next_step instanceof EE_SPCO_Reg_Step ) {
  return $submit_button_text;
 } 
 if ( $checkout->next_step->slug() == 'payment_options' ) {
  $submit_button_text = 'Go to Payment Processing';
 }
 return $submit_button_text;
}

add_filter ( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_proceed_to_button', 10, 2 );

To apply this function, you copy and paste the code into your site specific plugin. You can change “Go to Payment Processing” to something else and save your changes.

How to change the Finalize Registration button text

The following code will change only the text for the Finalize Registration button:

function ee_finalize_registration_button( $submit_button_text, EE_Checkout $checkout ) {
 if ( ! $checkout instanceof EE_Checkout || ! $checkout->current_step instanceof EE_SPCO_Reg_Step || ! $checkout->next_step instanceof EE_SPCO_Reg_Step ) {
  return $submit_button_text;
 }
 if ( $checkout->next_step->slug() == 'finalize_registration' ) {
  $submit_button_text = 'Complete My Registration';
 }
 return $submit_button_text;
}

add_filter ( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_finalize_registration_button', 10, 2 );

The function for ee_finalize_registration_button will only change “Finalize Registration” to “Complete My Registration”.

To apply this function, you copy and paste it into your site specific plugin. Then change “Complete My Registration” to something else and save changes.

How to change the Update Attendee Information button text

The following code will change the text only for the Update Attendee Information button:

function ee_update_registration_details_button( $submit_button_text, EE_Checkout $checkout ) {
 if ( ! $checkout instanceof EE_Checkout || ! $checkout->current_step instanceof EE_SPCO_Reg_Step || ! $checkout->next_step instanceof EE_SPCO_Reg_Step ) {
  return $submit_button_text;
 } 
 if ( $checkout->current_step->slug() == 'attendee_information' && $checkout->revisit ) {
  $submit_button_text = 'Yes I Want To Change My Registration Details';
 }
 return $submit_button_text; 
}

add_filter ( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_update_registration_details_button', 11, 2 );

The function for ee_update_registration_details_button will change only “Update Attendee Informations” to “Yes I Want To Change My Registration Details.”

To apply this function, you copy and paste it into your site specific plugin. Then change “Yes I Want To Change My Registration Details” to something else and save changes.

How to change the View Details and Register Now button text

The following buttons are not using during registration checkout but code snippets are included below should you need them.

event-espresso-view-details-button This button is used on the event list page
event-espresso-register-now-button This button is used on the single event pages

 

The following code will change the text for the View Details button:

function ee_view_details_button() {
 return 'Learn More About This Event';
}

add_filter ('FHEE__EE_Ticket_Selector__display_view_details_btn__btn_text', 'ee_view_details_button');

The above code will change “View Details” to “Learn More About This Event.”

To apply this function, you copy and paste it into your site specific plugin. Then change “Learn More About This Event” to something else and save changes.

The following code will change the text for the Register Now button:

function ee_register_now_button() {
 return 'Buy';
}

add_filter ('FHEE__EE_Ticket_Selector__display_ticket_selector_submit__btn_text', 'ee_register_now_button');

The above code will change “Register Now” to “Buy”.

To apply this function, you copy and paste it into your site specific plugin. Then change “Buy” to something else and save changes.

Posted in | Comments Off on How to Customize the Checkout Registration Button Text

How to Setup a Golf Tournament with Event Espresso

golf-tournament-pic-300-200In this guide, we’ll setup ticketing for a golf tournament using Event Espresso. Before we begin setting up our event, lets take a look at the information that we will be using for this event.

Venue

Avila Golf and Country Club
943 Guisando De Avila, Tampa, FL 33613

Datetimes

June 22, 2014 from 11AM to 6PM ET

Ticket Options

Golf Teams (Foursome) @ $1000

Individuals @ $250

Hole Sponsor (0-10) @ $200

Additional Casino Party Ticket (0-10) @ $150

Create our Venue with the Venue Editor

Login to the WordPress admin and locate Event Espresso in the admin menu. Then click on Venues. On the next page click on the Add New Venue button which appears at the top of the page.

You’ll now be viewing the Venue Editor and you can begin entering information about the venue that is hosting your event. We recommend entering at least a name, description, and address for your venue. Then enable Google Map for this venue by setting the toggle to Yes and then save changes to your venue.

Create our Golf Tournament with the Event Editor

Now we want to go to the Event Espresso Event Editor so that we can create our golf tournament.

Locate Event Espresso in the WordPress admin menu and then click on Events. Then click on the Add New Event button which appears at the top of the page. You will now be viewing the Event Editor. Begin by entering a title for your event such as Golf Tournament and then a description. You can then select your venue from the Venue Details area:

event-espresso-golf-tournament-venues

Next we will setup our datetime for our golf tournament:

event-espresso-golf-tournament-datetimes

The next step is to setup our ticket options. For the first ticket, we need to enter a name, then select a start date and end date for ticket sales. The price should be set to $250. Then click on the advanced options (small gear). Then set the minimum and maximum quantity to 4. This will ensure that only a group of four tickets ($250 multiplied by 4 equals $1000) can be purchased for this specific ticket option.

To create the second ticket, click on the Create Ticket button. This will add an additional ticket. Add a title for this ticket and set the start date and end date for ticket sales. Then we’ll set the price to $250.

We’ll then apply similar steps to create ticket option 3 and ticket option 4. Once we are done, it will appear like this:

event-espresso-golf-tournament-ticket-options

Now that we have finished setting up our tickets, we can select the information that we want to collect from our registrants. For our tournament, we’ll ask for the contact information from  the primary registrant and only the name and email for additional registrants:

event-espresso-golf-tournament-registrant-question-groups event-espresso-golf-tournament-primary-registrant-question-groups

We’ll then double-check our event to make sure that we haven’t missed anything and then publish our event by clicking on the Publish button in Update Event widget. From here we can go to the front end to view our event. Here is an example of what our tickets appear like on the front end:

event-espresso-golf-tournament-tickets

Notes:

The first ticket option is restricted to purchasing in a batch of 4. The other ticket options will allow a quantity from 1 through 10.

The primary registrant will be asked for their contact information along with their address. Any additional registrants will only be asked for an name and email.

It is possible to collect additional information from registrants by setting up new questions and question groups.

Posted in | Comments Off on How to Setup a Golf Tournament with Event Espresso

How to Create a Site Specific Plugin for your WordPress Site

Today we will learn how to create a site specific plugin for our WordPress site. Before we get started on creating the file, lets briefly talk about why these plugins are helpful.

In the past, if you wanted to add a code snippet to your site then you might use your theme’s functions.php file which is usually in this location:

wp-content/themes/yourthemefolder/functions.php

One problem with this approach is that it does not account for theme updates which means there is a risk of losing your customizations if you update your theme. This is especially true if your theme has a convenient one-click update feature from within the WordPress admin. A site specific plugin is a better choice since your customizations will be in organized in one location. Additionally, if you add your code through the WordPress Plugin Editor, then WordPress will check your code to ensure that it won’t cause any fatal errors and take your site offline. Finally, some customizations require loading the code early in the request, so by the time the theme’s functions.php file loads it’s too late!

The Solution: Create your Site Specific Plugin

To get started, you will need to login to your WordPress root with an SFTP or FTP client. Cyberduck and FileZilla are free options that are available on multiple platforms. This will require an SFTP or FTP login which can be provided by your web host.

1) After logging in to your WordPress root, browse to this location:

wp-content/plugins

2) Now create a new folder. In this example, we’ll create one called myexamplesite:

site-specific-create-folder

3) Next, open the new folder that you just created.

4) We now need to create a file. In this example, we will create a file called myexamplesite-customizations.php:

site-specific-create-file

5) Then, copy the sample code below:

<?php
/*
Plugin Name: Site plugin for myexamplesite.com
Description: Site specific code for myexamplesite.com
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */

/* Stop Adding Functions */

6) Return to your SFTP or FTP client and paste the header code above into the file. You can change “myexamplesite.com” to something else such as your own site URL. Be sure to save changes to the file.

6b) You add your custom functions. Be sure to save changes to the file.

6c) You may need to update the file permissions for the file. Check with your web host for the required file permissions.

7) Now login to your WordPress admin and go to the Plugins page and click the Activate link to activate the new plugin.

8) Optional, and generally not recommended: You can also make edits to the plugin by going to Plugins → Editor. Select your new plugin from the dropdown in the top right corner:
site-specific-select-plugin

You can now add your code snippets to this file and save changes by clicking on Update File.

Remember, by using the WordPress Plugins Editor, WordPress will check your code to ensure that it won’t crash your site.

References:

http://ottopress.com/2011/creating-a-site-specific-snippets-plugin/

http://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/

Posted in | Comments Off on How to Create a Site Specific Plugin for your WordPress Site

How to Change the Countries that are used in Event Espresso

In this guide, we’ll learn how to adjust the countries that are used in the country drop-down menus for Event Espresso. Additionally, we’ll cover how to add additional provinces/states for a country that does not already include them.

You can manage which countries, states, and provinces appear in registration forms by following these steps:

Event Espresso Countries

  1. Navigate to Event Espresso → General Settings → Countries
  2. Select a Country to edit
  3. Set Country Appears in Dropdown Select Lists to Yes
  4. Click the “Save Country Details” button
  5. Repeat steps 2 – 4 for additional countries

Adjust the Countries that are Available in the Country Dropdown

To remove a country from the country dropdown, first select it using the Select Country drop-down menu. Then just under the Country Details section you’ll see an option for Country Appears in Dropdown Select Lists. If you would like to remove a country, set the option to No and then scroll down to the bottom of the page and click on the Save Country Details button. To add a country, you’ll follow the steps above up until the Country Appears in Dropdown Select Lists option. You’ll then select Yes (to enable this country) and then scroll down to the bottom of the page and click on Save Country Details.

watch-a-video

Be sure to toggle full screen in the bottom corner of the video.

 

Notes: in the video above we use Australia as an example. You can use the steps shown to disable or enable any country that you wish.

 

Adjust the States/Provinces that are Available in the State/Province Dropdown

You can access the states/provinces for various countries in a similar manner. First you’ll need to select your country using the Select Country drop-down menu. Then towards the right side of the screen you’ll see a section for States/Provinces. These are currently included for the United States and Canada. Information for other countries are in the works. If your country is missing information, then you can easily add it. The format should be: Code = Abbreviation Name = State/Province Here is an example for Australia:

ACT Australian Capital Territory event-espresso-act-australian-capital-territory

After entering the information, be sure to click on the Add New State/Province button. Similar to the Country dropdown select list, you can enable or disable certain states/provinces for the state/province dropdown list. Just locate your state/province in your list and select Yes or No. Then scroll down and click on Save States/Provinces.

 

Changing Your Organization Country to Change the Currency

IMPORTANT: In the General Settings > Your Organization, please be sure to select the Country of where your business is located/registered, as this setting affects the currency that is displayed throughout your website. This also affects the currency that will be used when accepting payments for registration.

Posted in | Comments Off on How to Change the Countries that are used in Event Espresso

Supported Date Formats

Dates and times are inherently important to events. Event Espresso uses the date and time settings of your WordPress website general settings to manage when events start selling, stop selling, when events close, and in the communication to attendees. If the timezone settings in the WordPress > Settings > General screen are not correct, your events may not function correctly or attendees may be confused.

Thus, it is important that you configure or confirm the date and time settings for you WordPress website. Here are a few examples of supported date formats that you can use when you set up the date format and time on the WordPress > Settings > General screen.

  • F j, Y — January 15, 2019
  • j.F.Y — 15.January.2019
  • Y/m/d — 2019/01/15
  • m/d/Y — 01/15/2019
  • d-m-y — 15-01-2019
  • y-m-d — 19-01-15

Each format character represents:

  • F = Full textual name for the month.
  • M = Abbreviated textual name for the month.
  • m = The month with leading zeros.
  • n = The month without leading zeros.
  • d = The day of the month, with leading zeros.
  • j = The day of the month without leading zeros.
  • Y = The year in 4 digits. (lower-case y gives the year’s last 2 digits)

A note from the official PHP documentation explains how the month and day are determined when converted from a string:

Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed.

Examples of non-supported formats that PHP can’t disambiguate follow:

  • d/m/Y
  • j, F Y

Posted in | Comments Off on Supported Date Formats

How to Show a Ticket with a Price of Zero as Free

In this post we’ll learn how to show tickets that have a cost of zero as free and remove the dollar amount showing from the pricing option (ticket) selector. Lets begin by taking a look at a screenshot below of the default configuration of the price of a free (0.00) ticket:

ticket-selector-zero-pricing

We can see in the screenshot that the default configuration for a free ticket has a pricing of zero (shown as 0.00). Now, to show the price as “free” instead of “0.00.” you can will change this default configuration on your own site with a filter.

function convert_zero_to_free( $amount, $return_raw ) {

    if ( ! $return_raw || ! is_admin() ) {

     $amount = $amount == 0 ?  __( 'free', 'event_espresso' ) : $amount; 

    }
    return $amount;
}
add_filter( 'FHEE__EEH_Template__format_currency__amount', 'convert_zero_to_free', 10, 2 );

There are a couple ways to add the filter above to your site. The first is to add the code to your theme’s functions.php file. However, this edit may be lost if you update your theme and it removes and replaces the functions.php file. We strongly recommend a safer method of applying this filter to your site to protect it from being overwritten by theme updates by creating a custom/site-specific plugin.

Once this filter is in place, go to any events on your site that has a 0.00 priced ticket and you’ll see that the pricing has been transformed from 0.00 to free:

ticket-selector-free-pricing

Posted in | Comments Off on How to Show a Ticket with a Price of Zero as Free

Event Espresso