Skip to content

Commit

Permalink
1.4.0-beta.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbot committed Nov 21, 2023
1 parent 9f96196 commit edbac8d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions includes/API/Product_Variations_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ public function wcpos_variation_response( WP_REST_Response $response, WC_Data $v
// Add the barcode to the product response
$data['barcode'] = $this->wcpos_get_barcode( $variation );

/*
* Backwards compatibility for WooCommerce < 8.3
*
* WooCommerce added 'parent_id' and 'name' to the variation response in 8.3
*/
if ( ! isset( $data['parent_id'] ) ) {
$data['parent_id'] = $variation->get_parent_id();
}
if ( ! isset( $data['name'] ) ) {
$data['name'] = \function_exists('wc_get_formatted_variation') ? wc_get_formatted_variation( $variation, true, false, false ) : '';
}

// Make sure we parse the meta data before returning the response
$variation->save_meta_data(); // make sure the meta data is saved
$data['meta_data'] = $this->wcpos_parse_meta_data( $variation );
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.4.0-beta.2",
"version": "1.4.0-beta.3",
"description": "A simple front-end for taking WooCommerce orders at the Point of Sale.",
"main": "index.js",
"workspaces": {
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.4.0-beta.2
* Version: 1.4.0-beta.3
* Author: kilbot
* Author URI: http://wcpos.com
* Text Domain: woocommerce-pos
Expand All @@ -24,7 +24,7 @@
use Dotenv\Dotenv;

// Define plugin constants.
const VERSION = '1.4.0-beta.2';
const VERSION = '1.4.0-beta.3';
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 edbac8d

Please sign in to comment.