WooCommerce Pre-Orders: Hooks and Filters

This document explains the main hooks and filters available in WooCommerce Pre-Orders, with practical examples you can adapt for your store.

If you are looking for merchant setup guidance, see WooCommerce Pre-Orders documentation.

For general WooCommerce hook fundamentals, see Introduction to hooks, actions, and filters and WooCommerce actions and filters.

Scope of support:

We are unable to provide support for customizations under our Support Policy. If you need to customize a snippet or extend its functionality, we recommend working with a Woo Agency Partner or a WooCommerce developer on Codeable.

How Pre-Orders Hooks Are Used

↑ Back to top

Pre-Orders uses both actions and filters throughout product display, checkout, status transitions, and admin workflows.

  • Filters let you modify values such as availability date text, supported product types, or gateway lists.
  • Actions let you react to events such as a status change, release date change, completion, or cancellation.

Key Filters

↑ Back to top
FilterPurpose
wc_pre_orders_localized_availability_dateCustomize the formatted availability date shown on the frontend
wc_pre_orders_localized_availability_timeCustomize the formatted availability time shown on the frontend
wc_pre_orders_get_utc_availability_datetime_timestampAdjust raw UTC timestamp before localization
wc_pre_orders_product_messageCustomize pre-order product messaging
wc_pre_orders_product_can_be_pre_orderedControl whether a product can currently be pre-ordered
wc_pre_orders_product_supports_pre_order_featureControl whether a product can support pre-orders at all
wc_pre_orders_supported_product_typesAdd or remove globally supported product types
wc_pre_orders_remove_unsupported_gatewaysModify available gateways during pre-order checkout
wc_pre_orders_feeModify pre-order fee label/amount/tax setup
wc_pre_orders_cart_item_metaCustomize cart/checkout pre-order metadata row

Key Actions

↑ Back to top
ActionPurpose
wc_pre_order_status_changedRuns on every pre-order status transition
wc_pre_order_status_{new_status}Runs when status is updated to a specific value
wc_pre_order_status_{old_status}_to_{new_status}Runs on a specific from/to transition
wc_pre_orders_pre_order_date_changedRuns when a release date is changed
wc_pre_orders_pre_order_completedRuns when a pre-order is completed
wc_pre_orders_pre_order_cancelledRuns when a pre-order is cancelled
wc_pre_orders_process_pre_order_completion_payment_{gateway_id}Runs gateway-specific completion payment logic

Availability Date Example

↑ Back to top

This is a common request: changing how {availability_date} appears to customers.

add_filter(
    'wc_pre_orders_localized_availability_date',
    function ( $formatted_date, $product, $none_text ) {
        if ( empty( $formatted_date ) || $formatted_date === $none_text ) {
            return $formatted_date;
        }

        $timestamp = WC_Pre_Orders_Product::get_utc_availability_datetime_timestamp( $product );

        if ( ! $timestamp ) {
            return $formatted_date;
        }

        return wp_date( 'D, M j, Y', $timestamp, wp_timezone() );
    },
    10,
    3
);

Related setting path: WooCommerce > Settings > Pre-Orders

Product Eligibility Example

↑ Back to top

This example prevents guest users from placing pre-orders.

add_filter(
    'wc_pre_orders_product_can_be_pre_ordered',
    function ( $can_be_pre_ordered, $product, $variant ) {
        if ( ! is_user_logged_in() ) {
            return false;
        }

        return $can_be_pre_ordered;
    },
    10,
    3
);

Priority

↑ Back to top

When multiple callbacks use the same hook, priority controls execution order. Higher numbers run later.

If another customization already uses the same hook at priority 10, try 20 for your callback.

add_filter( 'wc_pre_orders_localized_availability_date', 'my_custom_date_format', 20, 3 );

More Examples

↑ Back to top

Customize cart metadata label

add_filter(
    'wc_pre_orders_cart_item_meta',
    function ( $meta, $cart_item ) {
        if ( ! is_array( $meta ) ) {
            return $meta;
        }

        $meta['name'] = __( 'Pre-order release', 'your-text-domain' );
        return $meta;
    },
    10,
    2
);

Run custom logic when pre-orders complete

add_action(
    'wc_pre_orders_pre_order_completed',
    function ( $order, $message ) {
        if ( ! $order instanceof WC_Order ) {
            return;
        }

        // Replace with your own integration.
        error_log( 'Pre-order completed: #' . $order->get_id() );
    },
    10,
    2
);

Troubleshooting

↑ Back to top
  • Hook not firing: confirm your code runs in the correct context (frontend/admin).
  • No visual change: verify callback priority and accepted argument count.
  • Date values not changing: confirm the product has a release timestamp.
  • Gateway behavior not changing: confirm cart mode is pre-order and expected charge type is active.
↑ Back to top