diff --git a/includes/Templates/Login.php b/includes/Templates/Login.php index 51de265..9be1905 100644 --- a/includes/Templates/Login.php +++ b/includes/Templates/Login.php @@ -43,6 +43,7 @@ public function get_template(): void { $error_string .= '

' . $error[0] . '

'; } } else { + wp_set_current_user( $user->ID ); $this->login_success( $user ); exit; } @@ -66,6 +67,13 @@ public function get_template(): void { private function login_success( WP_User $user ) { $auth_service = Auth::instance(); $user_data = $auth_service->get_user_data( $user ); + $stores = array_map( + function ( $store ) { + return $store->get_data(); + }, + wcpos_get_stores() + ); + $user_data['stores'] = $stores; $credentials = wp_json_encode( $user_data ); echo '
-

+

- ' . $message . '

' . "\n"; - } + if ( ! empty( $message ) ) { + echo '

' . $message . '

' . "\n"; + } - if ( ! empty( $error_string ) ) { - echo '
' . $error_string . '
'; - } - ?> -
+ if ( ! empty( $error_string ) ) { + echo '
' . $error_string . '
'; + } + ?> +

@@ -60,14 +60,14 @@

- - -

- -

- + + +

+ +

+ - +
diff --git a/woocommerce-pos.php b/woocommerce-pos.php index 0dc4d13..50da1fc 100644 --- a/woocommerce-pos.php +++ b/woocommerce-pos.php @@ -3,7 +3,7 @@ * Plugin Name: WooCommerce POS * Plugin URI: https://wordpress.org/plugins/woocommerce-pos/ * Description: A simple front-end for taking WooCommerce orders at the Point of Sale. Requires WooCommerce. - * Version: 1.4.3 + * Version: 1.4.4 * Author: kilbot * Author URI: http://wcpos.com * Text Domain: woocommerce-pos @@ -22,7 +22,7 @@ namespace WCPOS\WooCommercePOS; // Define plugin constants. -const VERSION = '1.4.3'; +const VERSION = '1.4.4'; const PLUGIN_NAME = 'woocommerce-pos'; const SHORT_NAME = 'wcpos'; \define( __NAMESPACE__ . '\PLUGIN_FILE', plugin_basename( __FILE__ ) ); // 'woocommerce-pos/woocommerce-pos.php'