Okay
  Public Ticket #3212492
adjust tickets qty
Closed

Comments

  •  3
    Trevor Lee started the conversation

    Hi,  We seem so get a few customers change their mind as to what event they are doing or tell us they are not coming, but they don't want a refund -
    (something is cool) , anyhow how is there a way to add back tickets availability to a specific date for an event?

  •  781
    Zhivko replied

    Hi,

    That's very tricky. Not a refund and yet empty the slot.

    It can be done but you will have to do it manually.

    This is the code you need:

    /**
     * Manually set tickets sold for specific event
     * 1) Place this code in your theme or child-theme functions.php file.
     * 2) Run it once by simply visit your website.
     * 3) Remove this code afterwards.
     */
    add_action('init', function () {
        /**
         * CONFIG. Set up correct numbers
         */
        $EVENT_ID            = 1; // The event id
        $EVENT_REPEAT_OFFSET = 0; // If the event is repeated the repeat offset number     
                                  // is seen at the end of the event single page url. Otherwise leave 0.
        $TICKET_ID           = 2; // The ticket id number
        $TICKETS_SOLD        = 0; // The new number of sold tickets
        // end of config 
        
        $event = new \Stachethemes\Stec\Event_Post($EVENT_ID);
        \Stachethemes\Stec\Booking::set_tickets_sold($event, $TICKETS_SOLD, $TICKET_ID, $EVENT_REPEAT_OFFSET);
    });
    
    4604816630.png

    Stachethemes Developer