woocommerce_ajax_order_item

woocommerce_ajax_order_item

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_ajax_order_item') is found 1 times:

  • /includes/class-wc-ajax.php line 1075
    1071
    1072
    1073
    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
        /* translators: %s: error message */
        throw new Exception( sprintf( __( 'Error: %s', 'woocommerce' ), $validation_error->get_error_message() ) );
    }
    $item_id                 = $order->add_product( $product, $qty, array( 'order' => $order ) );
    $item                    = apply_filters( 'woocommerce_ajax_order_item', $order->get_item( $item_id ), $item_id, $order, $product );
    $added_items[ $item_id ] = $item;
    $order_notes[ $item_id ] = $product->get_formatted_name();
     
    // We do not perform any stock operations here because they will be handled when order is moved to a status where stock operations are applied (like processing, completed etc).
     
    do_action( 'woocommerce_ajax_add_order_item_meta', $item_id, $item, $order );