Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active September 21, 2016 21:09
Show Gist options
  • Save joshfeck/978e59dfe92272047f549119097733c1 to your computer and use it in GitHub Desktop.
Save joshfeck/978e59dfe92272047f549119097733c1 to your computer and use it in GitHub Desktop.
add a sponsor section to EE4 Single Page Checkout, requires the Advanced Custom Fields plugin
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action( 'AHEE__attendee_information__reg_step_start', 'ee_reg_steps_area' );
function ee_reg_steps_area() {
$checkout = EE_Registry::instance()->SSN->checkout();
if ( $checkout instanceof EE_Checkout ) {
$transaction = $checkout->transaction;
if ( $transaction instanceof EE_Transaction ) {
$registrations = $transaction->registrations();
$registration = reset( $registrations );
if ( $registration instanceof EE_Registration ) {
$event = $registration->event();
if ( $event instanceof EE_Event ) {
?>
<div class="sponsordetails">
<h3><span class="dashicons dashicons-heart"></span>Event Sponsor</h3>
<h4><img align="right" src="<?php the_field( 'sponsor_logo_image', $event->ID() ); ?>">
<strong><a href="<?php the_field( 'sponsor_website', $event->ID() ); ?>">
<?php the_field( 'sponsor_company', $event->ID() ); ?>
</a></strong>
</h4>
<?php the_field( 'sponsor_bio', $event->ID() ); ?>
</div>
<?php
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment