Implement shop search and refactor

This commit is contained in:
Almira Krdzic
2018-10-17 00:36:19 +02:00
parent afab22a30b
commit 8769606a4b
24 changed files with 379 additions and 182 deletions

View File

@@ -7,6 +7,9 @@ class Wiaas_Admin_CL_Shop {
add_action( 'admin_menu', array( __CLASS__, 'add_customers_page' ), 9 );
}
/**
* Add customer menu page for commercial lead
*/
public static function add_customers_page() {
add_menu_page(
__( 'Customers', 'wiaas' ),
@@ -18,10 +21,9 @@ class Wiaas_Admin_CL_Shop {
'66.0' );
}
public static function output_orders() {
}
/**
* Render content for customer menu page
*/
public static function output_customers() {
$organization_id = wiaas_get_current_user_organization_id();
@@ -52,13 +54,13 @@ class Wiaas_Admin_CL_Shop {
$customer_id = absint($_POST['customer_order_type']['customer_id']);
$order_type = sanitize_key($_POST['customer_order_type']['order_type']);
Wiaas_Shop_Data_Store::update_shop_customer_order_type(
Wiaas_Shop::update_shop_customer_order_type(
$organization_id,
$customer_id,
$order_type);
}
$customers = Wiaas_Shop_Data_Store::get_shop_customers($organization_id);
$customers = Wiaas_Shop::get_shop_customers($organization_id);
require 'views/html-admin-cl-customers-page.php';
}