PluginProbe
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 2.0.1
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v2.0.1
4.7.2 4.7.1 4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 All 281 releases
surecart / app / src / Controllers / Admin / Invoices / InvoicesViewController.php
InvoicesViewController.php
49 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SureCart\Controllers\Admin\Invoices;
4
5 use SureCart\Controllers\Admin\AdminController;
6 use SureCart\Controllers\Admin\Invoices\InvoicesListTable;
7
8 /**
9 * Handles product admin requests.
10 */
11 class InvoicesViewController extends AdminController {
12 /**
13 * Invoices index.
14 */
15 public function index() {
16 $table = new InvoicesListTable();
17 $table->prepare_items();
18 $this->withHeader(
19 [
20 'invoices' => [
21 'title' => __( 'Invoices', 'surecart' ),
22 ],
23 ]
24 );
25 return \SureCart::view( 'admin/invoices/index' )->with(
26 [
27 'table' => $table,
28 ]
29 );
30 }
31
32 /**
33 * Coupons edit.
34 */
35 public function edit() {
36 // enqueue needed script.
37 add_action( 'admin_enqueue_scripts', \SureCart::closure()->method( InvoiceScriptsController::class, 'enqueue' ) );
38 // return view.
39 return '<div id="app"></div>';
40 }
41
42 public function archive( $request ) {
43 // flash an error message
44 \SureCart::flash()->add( 'errors', 'Please enter a valid email address.' );
45 // redirect to order index page.
46 return \SureCart::redirect()->to( \SureCart::getUrl()->index( 'invoice' ) );
47 }
48 }
49