WC_Order::get_date_paid()publicWC 1.0

Get date paid.

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

Хуки из метода

Возвращает

WC_DateTime|NULL. object if the date is set or null if there is no date.

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

$WC_Order = new WC_Order();
$WC_Order->get_date_paid( $context );
$context(строка)
What the value is for. Valid values are view and edit.
По умолчанию: 'view'

Код WC_Order::get_date_paid() WC 8.7.0

public function get_date_paid( $context = 'view' ) {
	$date_paid = $this->get_prop( 'date_paid', $context );

	if ( 'view' === $context && ! $date_paid && version_compare( $this->get_version( 'edit' ), '3.0', '<' ) && $this->has_status( apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? 'processing' : 'completed', $this->get_id(), $this ) ) ) {
		// In view context, return a date if missing.
		$date_paid = $this->get_date_created( 'edit' );
	}
	return $date_paid;
}