render_costs_tracker_widget_content(); ?>
get_all_cost_trackers_by_sites( array( $site_id ) );
if ( is_array( $site_costs ) ) {
$site_costs = current( $site_costs ); // for current site.
}
if ( ! is_array( $site_costs ) ) {
$site_costs = array();
}
?>
|
|
|
column_default( $item, $col );
echo $row; // phpcs:ignore -- ok.
}
?>
name );
break;
case 'price': // for client widget.
$array_costs = array(
'weekly' => 0,
'monthly' => 0,
'quarterly' => 0,
'yearly' => 0,
'lifetime' => 0,
);
if ( 'active' === $item->cost_status ) {
$price = 0;
if ( 'single_site' === $item->license_type ) {
$price = $item->price;
} elseif ( 'multi_site' === $item->license_type && ! empty( $item->count_sites ) ) {
$price = $item->price / $item->count_sites;
}
if ( 'lifetime' === $item->type ) {
$array_costs['lifetime'] += $price;
} elseif ( isset( $array_costs[ $item->renewal_type ] ) ) {
$array_costs[ $item->renewal_type ] += $price;
}
$order_val += $price;
}
$out = Cost_Tracker_Utility::get_separated_costs_price( $array_costs );
break;
case 'actions':
ob_start();
?>
' . $out . '';
} else {
$out = '' . $out . ' | ';
}
return $out;
}
}