Skip to content

Instantly share code, notes, and snippets.

View Pebblo's full-sized avatar
🏠
Working from home

Tony Warwick Pebblo

🏠
Working from home
  • Event Espresso
  • Liverpool, UK
View GitHub Profile
@Pebblo
Pebblo / espresso_create_wp_user.php
Last active December 30, 2015 11:49 — forked from sethshoultes/espresso_create_wp_user.php
A function to create a new WP member using the registration details provided for the event, this function also adds the event they have just registered onto into the my events database so the initial events is displayed within 'My Events'
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action('action_hook_espresso_save_attendee_data','espresso_create_wp_user', 10, 1);
function espresso_create_wp_user($attendee_data) {
if( email_exists( $attendee_data['email'] ) == NULL ) {
global $org_options;
// Generate the password and create the user
$password = wp_generate_password( 12, false );
@Pebblo
Pebblo / 0_reuse_code.js
Created April 2, 2014 22:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Pebblo
Pebblo / functions.md
Last active November 18, 2015 16:43 — forked from joshfeck/template-parts.md
Alters the order of single event details to display the description -> datetimes -> ticket selector. Coded by Josh.
@Pebblo
Pebblo / add-GST-to-invoice.php
Last active August 29, 2015 14:14 — forked from joshfeck/add-GST-to-invoice.php
A simple GST line itemizer for the Event Espresso 3 invoice template function file. Works in conjunction with https://gist.github.com/Pebblo/3477fb76d952684fe239
<?php
//* Please do NOT include the above opening php tag
function my_itemised_surcharge( $attendees ){
$options = get_option( 'events_organization_settings' );
$currency = $options['currency_symbol'];
$this->SetFillColor( 239,239,239 );
//var_dump($attendees);
@Pebblo
Pebblo / add-to-template.php
Last active August 29, 2015 14:14 — forked from joshfeck/add-to-template.php
This gist works in conjunction with https://gist.github.com/Pebblo/48b2ce8b15b898a2611f. You can add the following to /gateways/invoice/template.php to display the price without surcharge and surcharge amount as line items on the invoice.
// suggested code placement is right after the line that says:
// $pdf->ImprovedTable($header, $attendees, $w, $alling);
$pdf->Ln(1);
$pdf->my_itemised_surcharge($attendees);
@Pebblo
Pebblo / avada.css
Last active February 4, 2022 12:58 — forked from joshfeck/avada.css
Avada theme responsive tickets fix
@media (max-width: 640px) {
.tkt-slctr-tbl,
.spco-ticket-details {
table-layout: fixed;
font-size: .8em;
}
.tkt-slctr-tbl tr td {
padding-left: 2px;
padding-right: 0;
}
@Pebblo
Pebblo / ee_taxonomy_body_class.php
Last active April 18, 2018 21:44 — forked from joshfeck/ee_taxonomy_body_class.php
Add event's category slug to registration checkout and thank you page's body class
<?php //Please do not add the opening PHP tag if you already have one
// add category slug to registration checkout and thank you page's body class
add_filter( 'body_class', 'jf_ee_return_event_tax_term_on_spco' );
function jf_ee_return_event_tax_term_on_spco( $classes ){
// get out if this isn't the reg checkout page
if (! is_page( 'thank-you' ) && ! is_page( 'registration-checkout' ) ){
return $classes;
}
@Pebblo
Pebblo / functions.php
Last active May 8, 2017 09:32 — forked from joshfeck/details_waiting_list.md
Add a ninja form to a Sold out Event Espresso 4 event. This is useful if you want to capture names and contact info from people that want to be signed up for a waiting list.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
// Display a contact form when the event is sold out
// to be used as a waiting list
function ee_espresso_clean_event_status( $event ) {
//$event = EEH_Event_View::get_event( $EVT_ID );
$status = $event instanceof EE_Event ? $event->get_active_status() : 'inactive';
return $status;
}
@Pebblo
Pebblo / csv_transaction.php
Last active December 2, 2020 12:03 — forked from joshfeck/csv_transaction.php
add a column to the Event Espresso 4 Registrations CSV report that displays the total tax amount for the transaction
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter( 'FHEE__EventEspressoBatchRequest__JobHandlers__RegistrationsReport__reg_csv_array', 'espresso_add_total_taxes_column', 10, 2);
function espresso_add_total_taxes_column( $reg_csv_array, $reg_row ) {
$sub_line_item_details = array();
$registration = EEM_Registration::instance()->get_one_by_ID( $reg_row['Registration.REG_ID'] );
if( $registration instanceof EE_Registration && $registration->is_primary_registrant() ) {
@Pebblo
Pebblo / espresso-events-table-template.template.php
Last active October 24, 2018 15:09 — forked from joshfeck/espresso-events-table-template.template.php
[Test] An example template for the Event Espresso 4 events table template that adds the ticket selector to the table
<?php
// Options
$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
// Load Venue View Helper
EE_Registry::instance()->load_helper('Venue_View');
// EE_Registry::instance()->load_helper( 'Template' );
//Defaults
$reg_button_text = !isset($reg_button_text) ? __('More Info', 'event_espresso') : $reg_button_text;
$alt_button_text = !isset($alt_button_text) ? __('More Info', 'event_espresso') : $alt_button_text;//For alternate registration pages