Automattic\WooCommerce\Internal\Admin\Notes

OrderMilestones::can_be_added()publicWC 1.0

Checks if a note can and should be added.

Method of the class: OrderMilestones{}

No Hooks.

Return

true|false.

Usage

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

OrderMilestones::can_be_added() code WC 7.1.1

public function can_be_added() {
	// If the milestone notes have been disabled via filter, bail.
	if ( ! $this->are_milestones_enabled() ) {
		return false;
	}

	$last_milestone    = $this->get_last_milestone();
	$current_milestone = $this->get_current_milestone();

	if ( $current_milestone <= $last_milestone ) {
		return false;
	}

	return true;
}