id( 'customer-invoices-preview' )
->with(
[
'allLink' => add_query_arg(
[
'tab' => $this->getTab(),
'model' => 'invoice',
'action' => 'index',
]
),
'isCustomer' => User::current()->isCustomer(),
'query' => apply_filters(
'surecart/dashboard/invoice_list/query',
[
'customer_ids' => array_values( User::current()->customerIds() ),
'status' => [ 'paid', 'open' ],
'page' => 1,
'per_page' => 5,
]
),
]
)->render( ( $attributes['title'] ?? __( 'Invoices', 'surecart' ) ) ? "" . ( $attributes['title'] ?? __( 'Invoices', 'surecart' ) ) . '' : '' )
);
}
/**
* Index.
*/
public function index() {
if ( ! is_user_logged_in() ) {
return;
}
ob_start();
?>
id( 'customer-invoices-index' )
->with(
[
'heading' => __( 'Invoices', 'surecart' ),
'isCustomer' => User::current()->isCustomer(),
'query' => apply_filters(
'surecart/dashboard/invoice_list/query',
[
'customer_ids' => array_values( User::current()->customerIds() ),
'status' => [ 'paid', 'open' ],
'page' => 1,
'per_page' => 10,
]
),
]
)->render()
);
?>