Automattic\WooCommerce\Internal\Admin\Notes

OrderMilestones::possibly_add_note()publicWC 1.0

Add milestone notes for other significant thresholds.

Method of the class: OrderMilestones{}

No Hooks.

Return

null. Nothing.

Usage

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

OrderMilestones::possibly_add_note() code WC 7.1.1

public function possibly_add_note() {
	if ( ! self::can_be_added() ) {
		return;
	}
	$current_milestone = $this->get_current_milestone();
	$this->set_last_milestone( $current_milestone );

	// We only want one milestone note at any time.
	Notes::delete_notes_with_name( self::NOTE_NAME );
	$note = $this->get_note_by_milestone( $current_milestone );
	$note->save();
}