Title: Custom pdf invoice
Last modified: August 21, 2016

---

# Custom pdf invoice

 *  Resolved [cybermatrixmedia](https://wordpress.org/support/users/cybermatrixmedia/)
 * (@cybermatrixmedia)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/custom-pdf-invoice/)
 * So I had to get creative to create a decent event ticketing module that could
   sell tickets and products in the same transaction. I used the Wooevents module
   that set up the date and location. I then used woocommerce and created 4 tickets
   as a variable product that I put as a link on the event page. Then I used WooCommerce
   PDF Invoices modifying the layout of the invoice to create a ticket.
 * The problem I have is that no matter what is bought the invoice say “This is 
   a ticket” which I hardcoded into the invoice design. What I would like is an 
   if/then statement inserted into the invoice design that will print between “This
   is a ticket” and “This is a reciept” depending on if they purchase one of the
   4 ticket items. Is this possible? If so, can anyone give me a direction to find
   the coding for this?
 * I’m an html/asp programmmer. Im only good enough to modify php coding. I can’t
   code it from scratch. So any help is appreciated.

Viewing 1 replies (of 1 total)

 *  Thread Starter [cybermatrixmedia](https://wordpress.org/support/users/cybermatrixmedia/)
 * (@cybermatrixmedia)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/custom-pdf-invoice/#post-5066152)
 * I found a solution. Create sku codes for the tickets you create and insert them
   within the coding below.
 *     ```
       <?php
           $printticket = false;
            $items = $wpo_wcpdf->get_order_items();
            if( sizeof( $items ) > 0 ) {
               foreach( $items as $item )
            {
                  if (($item['sku'] === 'skucode1') || ($item['sku'] === 'skucode2')  || ($item['sku'] === 'skucode3')  ||($item['sku'] === 'skucode4'))  { $printticket = true; };
             };
            };
         if ($printticket) { echo '***This is a Ticket***';} else { echo "***This is a Receipt***";};
       ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Custom pdf invoice’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [cybermatrixmedia](https://wordpress.org/support/users/cybermatrixmedia/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/custom-pdf-invoice/#post-5066152)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
