WooTickets Email Ticket Styling

Home Forums Ticket Products Event Tickets Plus WooTickets Email Ticket Styling

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #115769
    Tony
    Participant

    I’m styling the customers email tickets and can’t figure out out to pull in the venue’s state and zip following <?php echo $venue_city;?>. I’m not a coder and it’s really just a matter of me not knowing what to specify following “$venue_”
    Thanks, in advance.

    #116011
    Barry
    Member

    Hi – great question!

    So there are two aspects to this. If I can refer you to the original, unmodified version of the tickets/email.php around lines 262-269 you should see a block of code like this:

    if ( ! empty( $venue ) ) {
    	$venue_name    = $venue->post_title;
    	$venue_phone   = get_post_meta( $venue_id, '_VenuePhone', true );
    	$venue_address = get_post_meta( $venue_id, '_VenueAddress', true );
    	$venue_city    = get_post_meta( $venue_id, '_VenueCity', true );
    	$venue_web     = get_post_meta( $venue_id, '_VenueURL', true );
    	$venue_email   = get_post_meta( $venue_id, '_VenueEmail', true );
    }

    So that shows the general pattern for pulling in venue fields – and in the original template, variables for the state and zip are not defined. To add them you should add these lines within that same block:

    $venue_state = get_post_meta( $venue_id, '_VenueStateProvince', true );
    $venue_zip = get_post_meta( $venue_id, '_VenueZip', true );

    Now you have access to that data and can use it wherever you see fit further down in the template just by echoing it out:

    echo esc_html( $venue_zip );

    Does that help at all?

    #116026
    Tony
    Participant

    Brilliant; that did the trick. Thanks Barry!

    #118468
    Leah
    Member

    Hi todyhy,

    Glad to hear you got things working! By the way if you have a minute or two, we will love it if you could leave us a review here. Thank you for your support!

    Best,

    Leah

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘WooTickets Email Ticket Styling’ is closed to new replies.