Skip to content

Action Hooks Reference

This page provides the complete directory of all action hooks prefixed with qcw_ across the plugin lifecycle, order processing, ticket allocation, instant wins, and frontend rendering.


Fires when a scheduled competition officially opens for entries.

  • Arguments: (int $product_id)
add_action( 'qcw_started', function( $product_id ) {
// Notify channels (Discord, Telegram, marketing lists)
} );

Fires immediately before transitioning a competition into the closed state.

  • Arguments: (int $product_id)

Fires when a competition closes (either automatically upon reaching the deadline, selling out, or via admin action).

  • Arguments: (int $product_id)

Fires after winners are chosen and saved.

  • Arguments: (int $product_id)
add_action( 'qcw_won', function( $product_id ) {
// Custom winner webhook or external API sync
} );

Fires when an administrator extends a competition’s closing date.

  • Arguments: (int $product_id, string $new_end_date)

Fires immediately before relisting an expired competition.

  • Arguments: (int $product_id)

Fires during execution of the competition relist routine.

  • Arguments: (int $product_id)

Fires after a competition has been successfully relisted.

  • Arguments: (int $product_id)

Fires during admin product save after competition meta has been processed.

  • Arguments: (int $product_id, WP_Post $post)

Fires inside the WooCommerce Product Data “Competition” panel for custom admin field injection.


Fires when a customer completes an order containing competition tickets.

  • Arguments: (int $order_id, array $data)

Fires after ticket records and participant entries are successfully committed to database tables.

  • Arguments: (int $order_id, int $product_id, array $tickets)

Fires if ticket assignment fails during order checkout processing.

  • Arguments: (int $order_id, int $product_id)

Fires after order meta and extra participant details are saved.

  • Arguments: (int $order_id)

Fires when a customer’s participation is cancelled (e.g. order cancelled or failed).

  • Arguments: (int $order_id)

Fires if cancelling participation fails.

  • Arguments: (int $order_id, string $reason)

Fires when removing or disqualifying entries that submitted incorrect skill answers.

  • Arguments: (int $product_id, int $order_id)

Fires if an order attempts to claim duplicate tickets, triggering administrator alerts.

  • Arguments: (int $order_id, int $ticket_number)

Fires if an order is completed without expected tickets allocated.

  • Arguments: (int $order_id)

Fires when an admin manually removes a participant entry from the admin participants list.

  • Arguments: (int $log_id, int $product_id)

Fires when a competition order is refunded (either full or partial).

  • Arguments: (int $order_id, int $refund_id)

Fires specifically on partial order refunds.

  • Arguments: (int $order_id, int $refund_id)

Fires specifically when an entire order is refunded, releasing all assigned tickets.

  • Arguments: (int $order_id, int $refund_id)

Fires the exact moment an instant win ticket is awarded during order completion.

  • Arguments: (array $data)
    • $data['ticket'] (string|int): Winning ticket number.
    • $data['user_id'] (int): Customer User ID.
    • $data['order_id'] (int): WooCommerce Order ID.
    • $data['prize'] (string): Awarded prize title.
    • $data['product_id'] (int): Competition Product ID.
add_action( 'qcw_instant_won', function( $data ) {
$ticket_num = $data['ticket'];
$prize_name = $data['prize'];
$order_id = $data['order_id'];
// Custom instant prize fulfillment or webhook notification
}, 10, 1 );

Fires when one or more instant prizes have been detected in an order, triggering transactional emails.

  • Arguments: (array $email_args)
    • $email_args['instant_winning_tickets'] (array): Array of winning ticket objects.
    • $email_args['user_id'] (int): Customer User ID.
    • $email_args['order_id'] (int): Order ID.
    • $email_args['product_id'] (int): Competition Product ID.

Fires after the order processor finishes checking all purchased tickets for instant win prizes.

  • Arguments: (array $ticket_numbers, int $product_id, int $user_id, int $order_id, array $log_ids, WC_Order_Item_Product $item, int $item_id)

Fires before rendering the table header in the frontend instant prizes list.

Fires after rendering the table header in the frontend instant prizes list.


qcw_before_single_entry_table / qcw_after_single_entry_table

Section titled “qcw_before_single_entry_table / qcw_after_single_entry_table”

Fires before and after the single competition entry/participant table.

  • Arguments: (int $product_id)

Fires inside the entry table content container.

  • Arguments: (int $product_id)

qcw_before_single_entry / qcw_single_entry / qcw_after_single_entry

Section titled “qcw_before_single_entry / qcw_single_entry / qcw_after_single_entry”

Fires around and within individual entry row items.

  • Arguments: (int $product_id, object $entry)

Fires before the buy/participate form on product pages.

Fires on product pages when a competition has not yet opened.

Fires immediately before rendering the ticket numbers grid or tabs.

Fires when handling AJAX state changes in the participation form.

Fires via AJAX when the frontend countdown clock reaches zero.

  • Arguments: (int $product_id)

Fires when loading scripts and styles for the live draw wheel screen.

qcw_product_loop_lotteries_winners_header / qcw_product_loop_lotteries_winners_body

Section titled “qcw_product_loop_lotteries_winners_header / qcw_product_loop_lotteries_winners_body”

Fires within product loops when displaying winner lists.

Fires when rendering custom templates via shortcodes.

Fires before rendering the competition search widget form.

Fires when an exported competition history CSV file is deleted.