WC_Abstract_Legacy_Order::update_fee( object|int $item, array $args )
Update fee for order.
Description Description
Note this does not update order totals.
Parameters Parameters
- $item
-
(Required)
- $args
-
(Required)
Return Return
(int) updated order item ID
Source Source
File: includes/legacy/abstract-wc-legacy-order.php
public function update_fee( $item, $args ) { wc_deprecated_function( 'WC_Order::update_fee', '3.0', 'an interaction with the WC_Order_Item_Fee class' ); if ( is_numeric( $item ) ) { $item = $this->get_item( $item ); } if ( ! is_object( $item ) || ! $item->is_type( 'fee' ) ) { return false; } if ( ! $this->get_id() ) { $this->save(); // Order must exist } $item->set_order_id( $this->get_id() ); $item->set_props( $args ); $item->save(); do_action( 'woocommerce_order_update_fee', $this->get_id(), $item->get_id(), $args ); return $item->get_id(); }