Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Last active December 4, 2019 14:57
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 Pebblo/8cac847b47569479e33307699dcfcdd7 to your computer and use it in GitHub Desktop.
Save Pebblo/8cac847b47569479e33307699dcfcdd7 to your computer and use it in GitHub Desktop.
An example of how to include a 'View Invoice' button next to the View confirmation order button on the thank you page. Place this template within your theme root directory. (Note the Invoice button will only be visible if BOTH the Receipt and Invoice message types are active)
<?php
/** @var EE_Transaction $transaction */
/** @var boolean $revisit */
/** @var string $order_conf_desc */
do_action( 'AHEE__thank_you_page_overview_template__top', $transaction );
?>
<div id="espresso-thank-you-page-overview-dv" class="width-100" >
<?php if ( ! $revisit ) : ?>
<div class="ee-attention">
<div class="extra-padding-sides">
<?php echo apply_filters(
'FHEE__thank_you_page_overview_template__order_conf_desc',
sprintf(
$order_conf_desc,
'<h3 class="">',
'</h3>',
'<br />'
)
);
$TXN_invoice_url = $transaction->invoice_url( 'html');
if ( ! empty( $TXN_receipt_url )) : ?>
<br/>
<div class="jst-rght">
<?php //Output a button for the Invoice if available
if( ! empty( $TXN_invoice_url) ) : ?>
<a class="ee-button ee-roundish indented-text big-text" href="<?php echo $TXN_invoice_url;?>"><span class="ee-icon ee-icon-PDF-file-type"></span><?php _e('View Invoice', 'event_espresso' ); ?></a>
<?php endif; ?>
<a class="ee-button ee-roundish indented-text big-text" href="<?php echo $TXN_receipt_url;?>"><span class="ee-icon ee-icon-PDF-file-type"></span><?php echo apply_filters( 'FHEE__thank_you_page_overview_template__order_conf_button_text', __( 'View Full Order Confirmation Receipt', 'event_espresso' )); ?></a>
</div>
<?php endif; ?>
</div>
</div>
<br/>
<?php endif; ?>
<br/>
<?php do_action( 'AHEE__thank_you_page_overview_template__content', $transaction ); ?>
</div>
<!-- end of espresso-thank-you-page-overview-dv -->
<?php do_action( 'AHEE__thank_you_page_overview_template__bottom', $transaction ); ?>
<?php
/* IMPORTANT - rename this file to remove the 2 from the filename, to use this file the template must be named thank-you-page-overview.template.php */
/** @var EE_Transaction $transaction */
/** @var boolean $revisit */
/** @var string $order_conf_desc */
do_action( 'AHEE__thank_you_page_overview_template__top', $transaction );
?>
<div id="espresso-thank-you-page-overview-dv" class="width-100" >
<?php if ( ! $revisit ) : ?>
<div class="ee-attention">
<div class="extra-padding-sides">
<?php echo apply_filters(
'FHEE__thank_you_page_overview_template__order_conf_desc',
sprintf(
$order_conf_desc,
'<h3 class="">',
'</h3>',
'<br />'
)
);
$TXN_invoice_url = $transaction->invoice_url( 'html');
//Output a button for the Invoice if available
if ( ! empty( $TXN_invoice_url )) : ?>
<br/>
<div class="jst-rght">
<a class="ee-button ee-roundish indented-text big-text" href="<?php echo $TXN_invoice_url;?>"><span class="ee-icon ee-icon-PDF-file-type"></span><?php _e('View Invoice', 'event_espresso' ); ?></a>
</div>
<?php endif; ?>
</div>
</div>
<br/>
<?php endif; ?>
<br/>
<?php do_action( 'AHEE__thank_you_page_overview_template__content', $transaction ); ?>
</div>
<!-- end of espresso-thank-you-page-overview-dv -->
<?php do_action( 'AHEE__thank_you_page_overview_template__bottom', $transaction ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment