Automattic\WooCommerce\Internal\Admin\Notes

OrderMilestones::get_current_milestone()publicWC 1.0

Calculate the current orders milestone.

Based on the threshold values in $this->milestones.

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

Хуков нет.

Возвращает

int. Current orders milestone.

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

$OrderMilestones = new OrderMilestones();
$OrderMilestones->get_current_milestone();

Код OrderMilestones::get_current_milestone() WC 7.1.0

public function get_current_milestone() {
	$milestone_reached = 0;
	$orders_count      = $this->get_orders_count();

	foreach ( $this->milestones as $milestone ) {
		if ( $milestone <= $orders_count ) {
			$milestone_reached = $milestone;
		}
	}

	return $milestone_reached;
}