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.
1. Lifecycle & Administration
Section titled “1. Lifecycle & Administration”qcw_started
Section titled “qcw_started”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)} );qcw_before_close
Section titled “qcw_before_close”Fires immediately before transitioning a competition into the closed state.
- Arguments:
(int $product_id)
qcw_close
Section titled “qcw_close”Fires when a competition closes (either automatically upon reaching the deadline, selling out, or via admin action).
- Arguments:
(int $product_id)
qcw_won
Section titled “qcw_won”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} );qcw_do_extend
Section titled “qcw_do_extend”Fires when an administrator extends a competition’s closing date.
- Arguments:
(int $product_id, string $new_end_date)
qcw_before_relist_competition
Section titled “qcw_before_relist_competition”Fires immediately before relisting an expired competition.
- Arguments:
(int $product_id)
qcw_do_relist
Section titled “qcw_do_relist”Fires during execution of the competition relist routine.
- Arguments:
(int $product_id)
qcw_after_relist_competition
Section titled “qcw_after_relist_competition”Fires after a competition has been successfully relisted.
- Arguments:
(int $product_id)
qcw_competition_product_save_data
Section titled “qcw_competition_product_save_data”Fires during admin product save after competition meta has been processed.
- Arguments:
(int $product_id, WP_Post $post)
qcw_product_options_competition
Section titled “qcw_product_options_competition”Fires inside the WooCommerce Product Data “Competition” panel for custom admin field injection.
2. Orders, Participation & Tickets
Section titled “2. Orders, Participation & Tickets”qcw_participate
Section titled “qcw_participate”Fires when a customer completes an order containing competition tickets.
- Arguments:
(int $order_id, array $data)
qcw_participate_added
Section titled “qcw_participate_added”Fires after ticket records and participant entries are successfully committed to database tables.
- Arguments:
(int $order_id, int $product_id, array $tickets)
qcw_participate_not_added
Section titled “qcw_participate_not_added”Fires if ticket assignment fails during order checkout processing.
- Arguments:
(int $order_id, int $product_id)
qcw_after_adding_extra_info
Section titled “qcw_after_adding_extra_info”Fires after order meta and extra participant details are saved.
- Arguments:
(int $order_id)
qcw_cancel_participation
Section titled “qcw_cancel_participation”Fires when a customer’s participation is cancelled (e.g. order cancelled or failed).
- Arguments:
(int $order_id)
qcw_cancel_participation_failed
Section titled “qcw_cancel_participation_failed”Fires if cancelling participation fails.
- Arguments:
(int $order_id, string $reason)
qcw_remove_participants_if_wrong_answer
Section titled “qcw_remove_participants_if_wrong_answer”Fires when removing or disqualifying entries that submitted incorrect skill answers.
- Arguments:
(int $product_id, int $order_id)
qcw_duplicate_ticket_in_order_found
Section titled “qcw_duplicate_ticket_in_order_found”Fires if an order attempts to claim duplicate tickets, triggering administrator alerts.
- Arguments:
(int $order_id, int $ticket_number)
qcw_missing_ticket_in_order_found
Section titled “qcw_missing_ticket_in_order_found”Fires if an order is completed without expected tickets allocated.
- Arguments:
(int $order_id)
qcw_delete_participate_entry
Section titled “qcw_delete_participate_entry”Fires when an admin manually removes a participant entry from the admin participants list.
- Arguments:
(int $log_id, int $product_id)
3. Order Refunds
Section titled “3. Order Refunds”qcw_order_refunded
Section titled “qcw_order_refunded”Fires when a competition order is refunded (either full or partial).
- Arguments:
(int $order_id, int $refund_id)
qcw_order_partially_refunded
Section titled “qcw_order_partially_refunded”Fires specifically on partial order refunds.
- Arguments:
(int $order_id, int $refund_id)
qcw_order_fully_refunded
Section titled “qcw_order_fully_refunded”Fires specifically when an entire order is refunded, releasing all assigned tickets.
- Arguments:
(int $order_id, int $refund_id)
4. Instant Wins
Section titled “4. Instant Wins”qcw_instant_won
Section titled “qcw_instant_won”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 );qcw_instant_prizes_send_email
Section titled “qcw_instant_prizes_send_email”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.
qcw_after_check_for_instant_prize
Section titled “qcw_after_check_for_instant_prize”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)
qcw_before_instant_prize_table_header
Section titled “qcw_before_instant_prize_table_header”Fires before rendering the table header in the frontend instant prizes list.
qcw_after_instant_prize_table_header
Section titled “qcw_after_instant_prize_table_header”Fires after rendering the table header in the frontend instant prizes list.
5. Frontend & Template Hooks
Section titled “5. Frontend & Template Hooks”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)
qcw_single_entry_table
Section titled “qcw_single_entry_table”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)
qcw_before_participate
Section titled “qcw_before_participate”Fires before the buy/participate form on product pages.
qcw_participate_future
Section titled “qcw_participate_future”Fires on product pages when a competition has not yet opened.
qcw_before_ticket_numbers
Section titled “qcw_before_ticket_numbers”Fires immediately before rendering the ticket numbers grid or tabs.
qcw_ajax_change_participate
Section titled “qcw_ajax_change_participate”Fires when handling AJAX state changes in the participation form.
qcw_ajax_lottery_counter_ended
Section titled “qcw_ajax_lottery_counter_ended”Fires via AJAX when the frontend countdown clock reaches zero.
- Arguments:
(int $product_id)
qcw_enqueue_live_draw
Section titled “qcw_enqueue_live_draw”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.
qcw_templates_shortcode_template
Section titled “qcw_templates_shortcode_template”Fires when rendering custom templates via shortcodes.
qcw_pre_get_competition_search_form
Section titled “qcw_pre_get_competition_search_form”Fires before rendering the competition search widget form.
qcw_delete_competition_history_csv
Section titled “qcw_delete_competition_history_csv”Fires when an exported competition history CSV file is deleted.