Automattic\WooCommerce\Internal\Admin\Notes
OrderMilestones::get_current_milestone()
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() OrderMilestones::get current milestone WC 9.2.3
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; }