Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created February 26, 2018 22:00
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/c200ab21043e578725bd8fcd903c4673 to your computer and use it in GitHub Desktop.
Save joshfeck/c200ab21043e578725bd8fcd903c4673 to your computer and use it in GitHub Desktop.
Example code for when two or more tickets being bought have a note that says, “Please ensure the correct information is entered for each participant”
<?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', 'my_add_inline_script_ts_multiple_ticket_select', 20);
function my_add_inline_script_ts_multiple_ticket_select() {
$custom_js = 'jQuery(document).ready(function($){
$(".ticket-selector-tbl-qty-slct").change(function(){
if($(this).val() >= 2)
alert("Please ensure the correct information is entered for each participant");
});});';
wp_add_inline_script('ticket_selector', $custom_js);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment