Okay
  Public Ticket #3564857
“Mark as Scanned” button is missing
Closed

Comments

  •  2
    Abril Castro started the conversation

    The plugin doesn’t show the “Mark as Scanned” button after scanning a ticket.

    Also, I need the RSVP tickets to generate a QR Code also, my site doesn't sell tickets, all tickets are FREE but I need people to register and fill a registration form.


    Thank you

    Attached files:  Screen Shot 2024-01-18 at 11.00.47 PM.png

  •  783
    Zhivko replied

    Hi,

    "Mark as Scanned" button appears only when the order status is set to "Completed".


    Stachethemes Developer

  •  2
    Abril Castro replied

    The problem is that none of my orders are mark as Completed because the tickets are marked as free, how can I changed this?

  •  783
    Zhivko replied

    You can set your orders automatically as "completed" via a hook I wrote for you.

    Open your theme or child-theme functions.php file and somewhere at the bottom insert:

    /**
     * Stachethemes Event Calendar Mod
     * 
     * Executes after a WooCommerce order is placed.
     *
     * This function checks if the order contains any tickets. If it does, and the order's status is 'processing',
     * it will update the order's status to 'completed'.
     *
     * @param int $order_id The ID of the WooCommerce order.
     */
    add_action('woocommerce_thankyou', function($order_id) {
        if (!class_exists('Stachethemes\Stec\Stachethemes_Event_Calendar')) {
            return;
        }
        if (!$order_id) {
            return;
        }
        $order             = wc_get_order($order_id);
        $order_has_tickets = \Stachethemes\Stec\Booking::order_has_tickets($order);
        if (true === $order_has_tickets) {
            if ($order->get_status() === 'processing') {
                $order->update_status('completed');
            }
        }
        
    }, 10);
    

    5790283612.png

    Stachethemes Developer

  •  2
    Abril Castro replied

    Thank you for your help. It's working perfectly!!! You are awesome.