• Resolved cybermatrixmedia

    (@cybermatrixmedia)


    I am trying to use WooCommerce PDF Invoices to make event tickets by modifying the layout of the invoice to create an online ticket to printout. I’ve successful reformatted the layout and it works like a charm except for one thing.

    The problem I have is that no matter what is bought the invoice reads “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” or “This is a receipt” 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?

    https://wordpress.org/plugins/woocommerce-pdf-invoices/

Viewing 1 replies (of 1 total)
  • Thread Starter cybermatrixmedia

    (@cybermatrixmedia)

    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 ‘Turn Invoice into Ticket System’ is closed to new replies.