Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Joe Dolson

    (@joedolson)

    Yes, using the function mt_ticket_purchase_id()

    Coincidentally, I need this functionality as well. I’ve copied receipt.php into my own theme folder and added the following:

    	<div class='receipt'>
    		<p>
    			<code>#<?php mt_receipt_id(); ?></code>
    		</p>
    		<p>
    			<code>Purchase ID #<?php mt_ticket_purchase_id(); ?></code>
    		</p>
    	</div>

    But it’s not showing the purchase ID: https://i.imgur.com/jHGlJ7s.png

    Later.. I did a bit of diagnosing and added some temp echos to this function:

    function mt_get_ticket_purchase_id( $ticket_id = false ) {
    	if ( ! $ticket_id ) {
    		echo 'Getting ticket_id; ';
    		$ticket_id = mt_get_ticket_id();
    	}
    	echo 'ticket_id ['; echo $ticket_id; echo ']; ';
    	$purchase    = get_post_meta( mt_get_ticket( $ticket_id )->ID, '_' . $ticket_id, true );
    	$purchase_id = $purchase['purchase_id'];
    
    	return $purchase_id;
    }

    ticket_id is blank so mt_get_ticket_id() isn’t working as expected?

    Ahh just released this post was about getting the purchase ID on the ticket. I’m looking at getting it on the receipt.

    Later still… found the function for me: mt_receipt_purchase_id()

    All sorted!

    Plugin Author Joe Dolson

    (@joedolson)

    Yes, the receipt and the ticket have different starting information, so they use different functions to get that value. Glad you found it!

    Thread Starter djdavit1990

    (@djdavit1990)

    Hey joe.

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Payment id’ is closed to new replies.