Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created September 25, 2019 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/c553d579962480410be45f51df074144 to your computer and use it in GitHub Desktop.
Save joshfeck/c553d579962480410be45f51df074144 to your computer and use it in GitHub Desktop.
An example that shows how to conditionally not include a registration form question when a specific ticket is in the cart. Event Espresso 4
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action( 'wp_enqueue_scripts', 'rc_ee_hide_custom_questions_convention', 99 );
function rc_ee_hide_custom_questions_convention() {
wp_add_inline_script(
'single_page_checkout',
'jQuery( document ).ready( function( $ ) {
if($("#spco-attendee_information-dv").find(".spco-attendee-ticket-910").length !== 0) {
$(".ee-reg-qstn-34-input-dv").hide();
}
});'
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment