WC_Order_Item::apply_changespublicWC 3.2.0

Merge changes with data and clear. Overrides WC_Data::apply_changes. array_replace_recursive does not work well for order items because it merges taxes instead of replacing them.

Метод класса: WC_Order_Item{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WC_Order_Item = new WC_Order_Item();
$WC_Order_Item->apply_changes();

Список изменений

С версии 3.2.0 Введена.

Код WC_Order_Item::apply_changes() WC 10.9.4

public function apply_changes() {
	$this->data    = array_replace( $this->data, $this->changes );
	$this->changes = array();
}