woocommerce_rest_set_order_item

woocommerce_rest_set_order_item

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

do_action('woocommerce_rest_set_order_item') is found 2 times:

  • /includes/rest-api/Controllers/Version1/class-wc-rest-orders-v1-controller.php line 797
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    /**
     * Action hook to adjust item before save.
     * @since 3.0.0
     */
    do_action( 'woocommerce_rest_set_order_item', $item, $posted );
     
    // Save or add to order
    if ( 'create' === $action ) {
        $order->add_item( $item );
    } else {
        $item->save();
  • /includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller.php line 1072
    1068
    1069
    1070
    1071
    1072
    1073
    1074
    1075
    1076
    1077
    1078
    * @param array         $posted The item data.
     *
     * @since 4.5.0.
     */
    do_action( 'woocommerce_rest_set_order_item', $item, $posted );
     
    // If creating the order, add the item to it.
    if ( 'create' === $action ) {
        $order->add_item( $item );
    } else {
        $item->save();