Getting an order id by order key if invoice prefix has changed. #1440
This commit is contained in:
parent
1e8ffbf9ec
commit
45be86cf31
|
@ -575,6 +575,11 @@ class WC_Paypal extends WC_Payment_Gateway {
|
|||
|
||||
$order = new WC_Order( $order_id );
|
||||
|
||||
if ( ! isset( $order->id ) ) { // We have an invalid $order_id, probably because invoice_prefix has changed
|
||||
$order_id = woocommerce_get_order_id_by_order_key( $order_key );
|
||||
$order = new WC_Order( $order_id );
|
||||
}
|
||||
|
||||
if ( $order->order_key !== $order_key ) :
|
||||
if ($this->debug=='yes') $this->log->add( 'paypal', 'Error: Order Key does not match invoice.' );
|
||||
exit;
|
||||
|
|
Loading…
Reference in New Issue