How style QR code on Event Ticket

Home Forums Ticket Products Event Tickets Plus How style QR code on Event Ticket

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1123443
    Sean Sullivan
    Participant

    Hello,

    I’m styling the Ticket email by editing /tickets/email.php (in my own theme, of course).

    I want to style the QR code info to match the rest of my ticket, but *that* code appears to be in QR.php, which is not an editable template file. Is there a way to plug my custom styles into here without editing core files?

    For reference, here’s the code from QR.php:

    /**
    	 * Generates the QR image, stores is locally and injects it into the tickets email
    	 *
    	 * @param $ticket array
    	 *
    	 * @return string
    	 */
    	public function inject_qr( $ticket ) {
    
    		$link = $this->_get_link( $ticket['ticket_id'], $ticket['event_id'] );
    		$qr   = $this->_get_image( $link );
    
    		if ( ! $qr ) {
    			return;
    		}
    		?>
    		<table class="content" align="center" width="620" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" style="margin:15px auto 0; padding:0;">
    			<tr>
    				<td align="center" valign="top" class="wrapper" width="620">
    					<table class="inner-wrapper" border="0" cellpadding="0" cellspacing="0" width="620" bgcolor="#f7f7f7" style="margin:0 auto !important; width:620px; padding:0;">
    						<tr>
    							<td valign="top" class="ticket-content" align="left" width="140" border="0" cellpadding="20" cellspacing="0" style="padding:20px; background:#f7f7f7;">
    								<img src="<?php echo esc_url( $qr ); ?>" width="140" height="140" alt="QR Code Image" style="border:0; outline:none; height:auto; max-width:100%; display:block;"/>
    							</td>
    							<td valign="top" class="ticket-content" align="left" border="0" cellpadding="20" cellspacing="0" style="padding:20px; background:#f7f7f7;">
    								<h3 style="color:#0a0a0e; margin:0 0 10px 0 !important; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-style:normal; font-weight:700; font-size:28px; letter-spacing:normal; text-align:left;line-height: 100%;">
    									<span style="color:#0a0a0e !important"><?php esc_html_e( 'Check in for this event', 'event-tickets-plus' ); ?></span>
    								</h3>
    								<p>
    									<?php esc_html_e( 'Scan this QR code at the event to check in.', 'event-tickets-plus' ); ?>
    								</p>
    							</td>
    						</tr>
    					</table>
    				</td>
    			</tr>
    		</table>
    		<?php
    	}
    
    
    #1123484
    George
    Participant

    Hey @Sean,

    The QR code is generated by a PHP library called phpqrcode—so if you want to modify the output of the QR code itself, you would have to dive into the code of that library (which is in the /vendor directory of the Events Calendar Pro plugin files).

    There is no way to go about making such customizations without modifying core plugin files. 🙁

    Sorry to disappoint!
    George

    #1123518
    Sean Sullivan
    Participant

    Hi George,

    I did a bad job explaining myself.

    I’m only seeking to update the inline CSS styles, e.g., the font-family and font-size attributes.

    #1123685
    George
    Participant

    Thanks for clarifying, @Sean! I’m sorry to bear the news that even changing just those inline styles still requires modifying that core function at this time.

    I’m sorry to disappoint!

    I think this should be a customizable file, and will make a ticket for our developers so that we can possibly make that happen.

    Please let me know if there is anything else I can try to help with.

    — George

    #1130409
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

    #1589123
    Victor
    Member

    Hi Sean!

    Just wanted to share with you that a new release of out plugins is out, where we moved the “QR code” output code to a new template called email-qr.php located at /event-tickets-plus/src/views/tickets-plus/email-qr.php

    This should make things much more easier when needing to customize the QR code.

    Find out more about this release → https://theeventscalendar.com/maintenance-release-for-the-week-29-july-2018/

    We apologize for the delay and appreciate your patience while we worked on this.

    As always, we suggest to setup a dev/staging site so you can make all plugin updates without disrupting the live site.

    Please update the plugins and don’t hesitate to open a new ticket if anything comes up.

    Best,
    Victor

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘How style QR code on Event Ticket’ is closed to new replies.