Skip to content

Commit

Permalink
v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbot committed Jan 11, 2024
1 parent 4246ac1 commit fdc4f66
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 25 deletions.
4 changes: 2 additions & 2 deletions includes/API/Product_Variations_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ public function wcpos_variation_response( WP_REST_Response $response, WC_Data $v
*/
public function wcpos_insert_product_variation_object( WC_Data $object, WP_REST_Request $request, bool $creating ): void {
$barcode_field = $this->wcpos_get_barcode_field();
$barcode = $request->get_param( 'barcode' );
if ( $barcode ) {
if ( $request->has_param( 'barcode' ) ) {
$barcode = $request->get_param( 'barcode' );
$object->update_meta_data( $barcode_field, $barcode );
$object->save_meta_data();
}
Expand Down
4 changes: 2 additions & 2 deletions includes/API/Products_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ public function wcpos_product_response( WP_REST_Response $response, WC_Product $
*/
public function wcpos_insert_product_object( WC_Data $object, WP_REST_Request $request, bool $creating ): void {
$barcode_field = $this->wcpos_get_barcode_field();
$barcode = $request->get_param( 'barcode' );
if ( $barcode ) {
if ( $request->has_param( 'barcode' ) ) {
$barcode = $request->get_param( 'barcode' );
$object->update_meta_data( $barcode_field, $barcode );
$object->save_meta_data();
}
Expand Down
29 changes: 16 additions & 13 deletions includes/Gateways/Cash.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ public function __construct() {
$this->enabled = 'no';

// Actions
add_action('woocommerce_pos_update_options_payment_gateways_' . $this->id, array(
$this,
'process_admin_options',
));
add_action(
'woocommerce_pos_update_options_payment_gateways_' . $this->id,
array(
$this,
'process_admin_options',
)
);
add_action( 'woocommerce_thankyou_pos_cash', array( $this, 'calculate_change' ) );
}

Expand Down Expand Up @@ -86,7 +89,7 @@ public function payment_fields(): void {
*/
public function process_payment( $order_id ): array {
// Check nonce
if ( !isset( $_POST['pos_cash_payment_nonce_field'] ) || !wp_verify_nonce( $_POST['pos_cash_payment_nonce_field'], 'pos_cash_payment_nonce' ) ) {
if ( ! isset( $_POST['pos_cash_payment_nonce_field'] ) || ! wp_verify_nonce( $_POST['pos_cash_payment_nonce_field'], 'pos_cash_payment_nonce' ) ) {
wp_die( __( 'Nonce verification failed', 'woocommerce-pos' ) );
}

Expand Down Expand Up @@ -117,11 +120,11 @@ public function process_payment( $order_id ): array {
'total_tax' => 0,
)
);
// $fee->set_name( __( 'Partial Payment', 'woocommerce-pos' ) );
// $fee->set_amount( '-' . $tendered );
// $fee->set_total( '-' . $tendered );
// $fee->set_total_tax( '0' );
// $fee->set_tax_status( 'none' );
// $fee->set_name( __( 'Partial Payment', 'woocommerce-pos' ) );
// $fee->set_amount( '-' . $tendered );
// $fee->set_total( '-' . $tendered );
// $fee->set_total_tax( '0' );
// $fee->set_tax_status( 'none' );
$fee->add_meta_data( 'date_paid_gmt', gmdate( 'Y-m-d\TH:i:s' ), true );
$fee->set_order_id( $order_id );
$fee->save();
Expand All @@ -135,9 +138,9 @@ public function process_payment( $order_id ): array {
}

// Return thankyou redirect
// $redirect = add_query_arg(array(
// 'wcpos' => 1,
// ), get_home_url( null, '/wcpos-checkout/order-received/' . $order->get_id() ));
// $redirect = add_query_arg(array(
// 'wcpos' => 1,
// ), get_home_url( null, '/wcpos-checkout/order-received/' . $order->get_id() ));

return array(
'result' => 'success',
Expand Down
2 changes: 1 addition & 1 deletion includes/Templates/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function head(): void {
public function footer(): void {
$development = isset( $_ENV['DEVELOPMENT'] ) && $_ENV['DEVELOPMENT'];
$user = wp_get_current_user();
$github_url = 'https://wcpos.github.io/managed-expo/';
$github_url = 'https://cdn.jsdelivr.net/gh/wcpos/[email protected]/';
$auth_service = Auth::instance();
$stores = array_map(
function ( $store ) {
Expand Down
12 changes: 9 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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.5
Tested up to: 6.4
Stable tag: 1.3.12
License: GPL-3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -63,8 +63,14 @@ There is more information on our website at [https://wcpos.com](https://wcpos.co

== Changelog ==

= 1.4.0 - 2023/11/XX =

= 1.4.0 - 2024/01/11 =
* Added: Support for High-Performance Order Storage (HPOS)
* Added: New API for Variation Barcode Search
* Pro: Set unique Product Price and Tax Status for each Store
* Pro: Fix Store login for Authorized Users
* Pro: Fix Analytics for POS vs Online Orders
* Pro: New updater
* Plus: Add a lot of PHPUnit Tests, fixed numerous bugs for a more stable POS!

= 1.3.12 - 2023/09/29 =
* Fix: WordPress database error Not unique table/alias: 'wp_postmeta' for query
Expand Down
8 changes: 4 additions & 4 deletions woocommerce-pos.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* 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.4.0-beta.5
* Version: 1.4.0
* Author: kilbot
* Author URI: http://wcpos.com
* Text Domain: woocommerce-pos
* License: GPL-3.0+
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
* Domain Path: /languages
* WC tested up to: 8.1
* WC tested up to: 8.4
* WC requires at least: 5.3.
*
* @author Paul Kilmurray <[email protected]>
Expand All @@ -22,7 +22,7 @@
namespace WCPOS\WooCommercePOS;

// Define plugin constants.
const VERSION = '1.4.0-beta.5';
const VERSION = '1.4.0';
const PLUGIN_NAME = 'woocommerce-pos';
const SHORT_NAME = 'wcpos';
\define( __NAMESPACE__ . '\PLUGIN_FILE', plugin_basename( __FILE__ ) ); // 'woocommerce-pos/woocommerce-pos.php'
Expand All @@ -32,7 +32,7 @@
// minimum requirements.
const WC_MIN_VERSION = '5.3';
const PHP_MIN_VERSION = '7.4';
const MIN_PRO_VERSION = '1.4.0-beta.3';
const MIN_PRO_VERSION = '1.4.0';

// load .env flags (for development).
function load_env( $file ) {
Expand Down

0 comments on commit fdc4f66

Please sign in to comment.