Skip to main content
BoxBuilder provides hooks and filters at major integration points. Use these to customize behavior without modifying plugin files.

Box Builder Actions

boxbuilder_pro_loaded

Fires when the BoxBuilder plugin finishes loading. Use this to initialize your extensions.
add_action( 'boxbuilder_pro_loaded', function() {
    // Plugin is fully loaded — safe to use BoxBuilder functions
});

boxbuilder/order_processing

Fires when an order containing box products moves to processing status.
add_action( 'boxbuilder/order_processing', function( $order ) {
    // Send custom notification, update external system, etc.
    $order_id = $order->get_id();
}, 10, 1 );

boxbuilder/before_checkout_with_boxes

Fires before the checkout form is rendered when the cart contains box products.
add_action( 'boxbuilder/before_checkout_with_boxes', function( $checkout ) {
    // Add custom messaging or validation before checkout
}, 10, 1 );

boxbuilder/order_item_created

Fires when a box order line item is created during checkout.
add_action( 'boxbuilder/order_item_created', function( $item, $order ) {
    // Add custom meta to the order item
    $item->add_meta_data( '_my_custom_field', 'value' );
    $item->save();
}, 10, 2 );

boxbuilder/order_created

Fires when an order containing box products is successfully created.
add_action( 'boxbuilder/order_created', function( $order ) {
    // Post-order processing for box orders
}, 10, 1 );

boxbuilder/mini_cart_boxes

Fires when the mini cart displays box items.
add_action( 'boxbuilder/mini_cart_boxes', function( $box_count ) {
    // Customize mini cart display for boxes
}, 10, 1 );

boxbuilder/stock_reserved Pro

Fires when stock is reserved for a box item (prevents overselling).
add_action( 'boxbuilder/stock_reserved', function( $product_id, $quantity, $session_id ) {
    // Track reserved stock, send alerts, etc.
}, 10, 3 );

boxbuilder/share_created Pro

Fires when a shareable box link is created.
add_action( 'boxbuilder/share_created', function( $share_key, $share_data ) {
    // Track sharing analytics
}, 10, 2 );

boxbuilder/share_loaded Pro

Fires when a shared box configuration is loaded from a URL.
add_action( 'boxbuilder/share_loaded', function( $share_key, $share_data ) {
    // Log shared box views
}, 10, 2 );

boxbuilder/customization_locked Pro

Fires when a subscription box customization window is locked (deadline passed).
add_action( 'boxbuilder/customization_locked', function( $subscription_id ) {
    // Notify admin or trigger fallback logic
}, 10, 1 );

boxbuilder/reminder_sent Pro

Fires when a customization reminder email is sent to a subscription customer.
add_action( 'boxbuilder/reminder_sent', function( $subscription_id, $product_id, $customer_email ) {
    // Track reminder delivery
}, 10, 3 );

Box Builder Filters

boxbuilder/pricing_models

Filter the available pricing models for boxes.
add_filter( 'boxbuilder/pricing_models', function( $models ) {
    // Add a custom pricing model
    $models['wholesale'] = [
        'label' => 'Wholesale Pricing',
        'description' => 'Special pricing for wholesale customers',
    ];
    return $models;
}, 10, 1 );

boxbuilder/price_html

Filter the HTML output of box prices on the frontend.
add_filter( 'boxbuilder/price_html', function( $price_html, $product, $pricing_model ) {
    // Add "per box" suffix to fixed prices
    if ( $pricing_model === 'fixed' ) {
        $price_html .= ' <small>per box</small>';
    }
    return $price_html;
}, 10, 3 );

boxbuilder/default_sizes Pro

Filter the default box size templates.
add_filter( 'boxbuilder/default_sizes', function( $sizes ) {
    // Add a custom default size
    $sizes[] = [
        'id'       => 'jumbo',
        'label'    => 'Jumbo',
        'capacity' => 48,
        'price'    => 99.99,
    ];
    return $sizes;
}, 10, 1 );

Extensibility Hook Points

These hooks are registered as integration points for extending BoxBuilder. They can be used by add-ons and custom code:
HookTypeDescription
boxbuilder/box_added_to_cartActionFires when a box is added to cart
boxbuilder/before_product_gridActionFires before the product grid renders
boxbuilder/after_add_to_cart_buttonActionFires after the add to cart button in the builder
boxbuilder/product_metabox_fieldsActionAdd custom fields to the BoxBuilder product metabox
boxbuilder/save_product_metaActionSave custom product metabox fields
boxbuilder/available_productsFilterFilter which products are available for a box
boxbuilder/box_priceFilterModify the calculated box price
boxbuilder/item_low_stockActionFires when a box item drops below stock threshold

WooCommerce Integration Hooks

BoxBuilder hooks into standard WooCommerce hooks. You can add your own callbacks at a later priority:

Cart Hooks

// BoxBuilder adds box data to cart items (priority 10)
add_filter( 'woocommerce_add_cart_item_data', 'boxbuilder_pro_add_box_data', 10, 3 );

// BoxBuilder displays box contents in cart (priority 10)
add_filter( 'woocommerce_get_item_data', 'boxbuilder_pro_display_box_data', 10, 2 );

// BoxBuilder hides child items from cart display (priority 10)
add_filter( 'woocommerce_cart_item_visible', 'boxbuilder_pro_hide_child_items', 10, 3 );

// BoxBuilder adjusts child item prices based on pricing model (priority 10)
add_action( 'woocommerce_before_calculate_totals', 'boxbuilder_pro_adjust_prices', 10, 1 );

Order Hooks

// BoxBuilder saves box data to order items (priority 10)
add_action( 'woocommerce_checkout_create_order_line_item', 'boxbuilder_pro_save_order_data', 10, 4 );

// BoxBuilder hides child items in order display (priority 10)
add_filter( 'woocommerce_order_item_visible', 'boxbuilder_pro_hide_order_children', 10, 2 );

// BoxBuilder customizes meta display in admin (priority 10)
add_filter( 'woocommerce_order_item_display_meta_key', 'boxbuilder_pro_meta_key', 10, 3 );
add_filter( 'woocommerce_order_item_display_meta_value', 'boxbuilder_pro_meta_value', 10, 3 );

Email Hooks

// BoxBuilder adds box content display to order emails
add_filter( 'woocommerce_email_order_items_args', 'boxbuilder_pro_email_args', 10, 1 );

Hook Priority Guide

BoxBuilder uses priority 10 for all its hooks. To run your code:
  • Before BoxBuilder: Use priority 5 or lower
  • After BoxBuilder: Use priority 15 or higher
  • Override BoxBuilder: Use the same priority (10) and remove BoxBuilder’s callback first
// Remove BoxBuilder's callback and replace with your own
remove_filter( 'woocommerce_cart_item_visible', 'boxbuilder_pro_hide_child_items', 10 );
add_filter( 'woocommerce_cart_item_visible', 'my_custom_visibility', 10, 3 );