Commit 35ebae85 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer

V1.4.3: Fix manual order generation in backend

- Delay number creation until status is no longer auto-draft. This was broken in 1.4.0 when compat with WC 3.0 was added.
parent ad7609a8
BASE=ordernumbers
PLATTFORM=woocommerce
VENDOR=opentools
VERSION=1.4.2
VERSION=1.4.3
DIR = $(shell pwd)
SVNDIR=wordpress-plugin-svn
......
......@@ -518,7 +518,7 @@ class OpenToolsOrdernumbersBasic {
* The hook to assign a customized order number (unless the order already has one assigned)
*/
function assign_new_ordernumber($orderid, $order, $update=true) {
if ((!$update) /*&& ($order->post_status == 'auto-draft')*/) {
if ((!$update) /*&& ($order->get_status() == 'auto-draft')*/) {
// New order => assign placeholder, which will later be overwritten the real order number
$this->update_order_meta($orderid, $this->ordernumber_meta.'ordernumber', $this->ordernumber_new_placeholder);
}
......@@ -528,7 +528,7 @@ class OpenToolsOrdernumbersBasic {
return;
}
$number = $this->get_order_meta( $order, $this->ordernumber_meta.'ordernumber');
if ($number == $this->ordernumber_new_placeholder/* && $order->post_status != 'auto-draft'*/) {
if ($number == $this->ordernumber_new_placeholder && $order->get_status() != 'auto-draft') {
$number = $this->generateNumber($orderid, $order, 'ordernumber');
// Assign a new number
}
......
......@@ -4,7 +4,7 @@ Contributors: opentools
Tags: WooCommerce, Order numbers, orders
Requires at least: 4.0
Tested up to: 4.8
Stable tag: 1.4.2
Stable tag: 1.4.3
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl.html
......@@ -78,6 +78,9 @@ The Advanced Ordernumbers for WooCommerce plugin supports some invoicing plugins
== Changelog ==
= 1.4.3 =
* Delay order number creation when creating orders manually in the backend (broken with 1.4.0)
= 1.4.2 =
* Allow comparing arrays with empty value in the variable definitions
......
......@@ -3,7 +3,7 @@
* Plugin Name: Woocommerce Advanced Ordernumbers
* Plugin URI: http://open-tools.net/woocommerce/advanced-ordernumbers-for-woocommerce.html
* Description: Lets the user freely configure the order numbers in WooCommerce.
* Version: 1.4.2
* Version: 1.4.3
* Author: Open Tools
* Author URI: http://open-tools.net
* Text Domain: woocommerce-advanced-ordernumbers
......
......@@ -3,7 +3,7 @@
* Plugin Name: WooCommerce Basic Ordernumbers
* Plugin URI: http://open-tools.net/woocommerce/advanced-ordernumbers-for-woocommerce.html
* Description: Configure WooCommerce ordernumbers to have a running counter and arbitrary, fixed text (prefix / postfix).
* Version: 1.4.2
* Version: 1.4.3
* Author: Open Tools
* Author URI: http://open-tools.net
* Text Domain: woocommerce-advanced-ordernumbers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment