• Resolved cybermatrixmedia

    (@cybermatrixmedia)


    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

    (@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 ‘Custom pdf invoice’ is closed to new replies.