Skip to content

Commit

Permalink
Version 1 Release!
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbot committed May 3, 2023
1 parent e47537f commit 4890c28
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 9 deletions.
6 changes: 6 additions & 0 deletions includes/API/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ public function generate_token( WP_REST_Request $request ) {
);
}

/**
* @TODO
* I'm not sure if this is the best way, but I need the user to be logged in for subsequent processing
*/
wp_set_current_user( $user->ID );

/** Valid credentials, the user exists create the according Token */
$issued_at = time();

Expand Down
7 changes: 4 additions & 3 deletions includes/API/Stores.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ public function get_stores() {
$this->get_store(),
);

return $data;

// return rest_ensure_response( $data );
/**
*
*/
return apply_filters( 'woocommerce_pos_stores', $data, $this );
}


Expand Down
2 changes: 1 addition & 1 deletion includes/Templates/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function footer(): void {
'avatar_url' => get_avatar_url( $user->ID ),
'wp_nonce' => wp_create_nonce( 'wp_rest' ),
),
'store' => $store_settings->get_store(),
'stores' => $store_settings->get_stores(),
);

/**
Expand Down
4 changes: 4 additions & 0 deletions includes/Templates/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ public function get_template(): void {
wp_die( esc_html__( 'Sorry, this order has already been paid for.', 'woocommerce-pos' ) );
}

// get cashier from order meta_data with key _pos_user
$cashier = $order->get_meta( '_pos_user', true );
$cashier = get_user_by( 'id', $cashier );

// set customer
wp_set_current_user( $order->get_customer_id() );

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wcpos/woocommerce-pos",
"version": "1.0.0-rc.1",
"version": "1.0.0",
"description": "A simple front-end for taking WooCommerce orders at the Point of Sale.",
"main": "index.js",
"workspaces": {
Expand Down
11 changes: 9 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: kilbot
Tags: cart, e-commerce, ecommerce, inventory, point-of-sale, pos, sales, sell, shop, shopify, store, vend, woocommerce, wordpress-ecommerce
Requires at least: 5.6 & WooCommerce 5.3
Tested up to: 6
Stable tag: 0.4.27
Tested up to: 6.2
Stable tag: 1.0.0
License: GPL-3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -62,3 +62,10 @@ There is more information on our website at [https://wcpos.com](https://wcpos.co
1. WooCommerce POS main screen

== Changelog ==

= 1.0.0 =
* Complete rewrite of the plugin with improved functionality and performance.
* Although extensive testing has been done, there may still be bugs.
* We recommend updating only when you have time to deal with potential issues.
* You can always revert to the old version if necessary, https://wordpress.org/plugins/woocommerce-pos/advanced/
* If you need assistance, join our Discord chat at https://wcpos.com/discord for support.
14 changes: 14 additions & 0 deletions templates/payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@
margin-bottom: 20px;
}

.cashier {
padding: 5px;
}

.cashier .cashier-name {
font-size: 14px;
font-weight: bold;
}

.current-user {
padding: 5px;
margin-bottom: 20px;
Expand Down Expand Up @@ -205,6 +214,11 @@
<div class="woocommerce">
<?php woocommerce_output_all_notices(); ?>

<div class="cashier">
<span><?php esc_html_e( 'Cashier: ', 'woocommerce-pos' ); ?></span>
<span class="cashier-name"><?php echo esc_html( $cashier->display_name ); ?></span>
</div>

<div class="current-user">
<span><?php esc_html_e( 'Paying as customer: ', 'woocommerce-pos' ); ?></span>
<?php $woocommerce_pos_customer = wp_get_current_user(); ?>
Expand Down
4 changes: 2 additions & 2 deletions woocommerce-pos.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="http://wordpress.org/plugins/woocommerce/">WooCommerce</a>.
* Version: 1.0.0-rc.1
* Version: 1.0.0
* Author: kilbot
* Author URI: http://wcpos.com
* Text Domain: woocommerce-pos
Expand All @@ -23,7 +23,7 @@
use Dotenv\Dotenv;

// Define plugin constants.
const VERSION = '1.0.0-rc.1';
const VERSION = '1.0.0';
const PLUGIN_NAME = 'woocommerce-pos';
const SHORT_NAME = 'wcpos';
\define( __NAMESPACE__ . '\PLUGIN_FILE', plugin_basename( __FILE__ ) ); // 'woocommerce-pos/woocommerce-pos.php'
Expand Down

0 comments on commit 4890c28

Please sign in to comment.