Okay
  Public Ticket #1884231
Ticketing
Closed

Comments

  • hype4events started the conversation

    I want to set up free events, when I want to add an attachment to send to the customer so we can verify they are the ones that booked, i have to change the product type to variable product but after doing that it will no longer appear as an option in the front page as a ticket but rather as a product in the shop.
    How can send to my customers different tickets each for their purchase

  •  867
    Zhivko replied

    Hi,

    Sorry for the delay.

    I'll take a look what can be done. I think it might be possible to attach some sort of 4 or 8 digit code to each purchase.

    I'll contact you when I'm ready with the code.


    Stachethemes Developer

  • hype4events replied

    Thank you for the notification. I''l wait for your contact. 

    As you look into it just notify if it is also the same case with paid tickets?

  •  867
    Zhivko replied

    Open your theme functions.php file and at the end add following filter:

    add_action('woocommerce_add_order_item_meta', function ( $itemId, $values, $key ) {
        if (isset($values['stec_variables'])) {         foreach ($values['stec_variables'] as $var) {             $search = array('stec_book_date');             if (in_array($var['name'], $search)) {
                    wc_add_order_item_meta($itemId, __('Ticket Code', 'stec'), rand(1000, 9999));
                }
            }
        }
    }, 10, 3);

    This will add 4 digit code to each order.



    Stachethemes Developer

  • hype4events replied

    Thank you that worked perfectly. 

    My issue is now how can I control the ticket code sequence and can I attach a downloadable ticket which will have my preferred ticket code or even qr or barcode and ticket design

  •  867
    Zhivko replied

    The ticket code number is generated randomly at the moment from this line:

    wc_add_order_item_meta($itemId, __('Ticket Code', 'stec'), rand(1000, 9999));

    more specifically from here:

    rand(1000, 9999)

    The features you need would require extensive customization and we don't support customizations.

    You can check out https://studio.envato.com/ which offers plugin customizations.



    Stachethemes Developer

  • hype4events replied

    Noted with thanks. I now have different ticket codes for each ticket.

    How can I give the ticket-buyer a downloadable ticket/eticket just after they have ordered?