Remove legacy code for updating orders by history associated with payments
This commit is contained in:
parent
f4c44d486c
commit
05a0f64a13
@ -487,17 +487,6 @@ if (!class_exists('WC_Retailcrm_History')) :
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($order['paymentType'])) {
|
||||
if (!empty($options[$order['paymentType']])) {
|
||||
$payment = WC_Payment_Gateways::instance();
|
||||
$paymentTypes = $payment->payment_gateways();
|
||||
|
||||
if (isset($paymentTypes[$options[$order['paymentType']]])) {
|
||||
$wcOrder->set_payment_method($paymentTypes[$options[$order['paymentType']]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($order['payments']) && !empty($order['payments'])) {
|
||||
$payment = WC_Payment_Gateways::instance();
|
||||
$paymentTypes = $payment->payment_gateways();
|
||||
@ -742,6 +731,7 @@ if (!class_exists('WC_Retailcrm_History')) :
|
||||
$paymentTypes = $payment->payment_gateways();
|
||||
$payments = $order['payments'];
|
||||
$paymentType = end($payments);
|
||||
|
||||
if (isset($options[$paymentType['type']]) && isset($paymentTypes[$options[$paymentType['type']]])) {
|
||||
$wcOrder->set_payment_method($paymentTypes[$options[$paymentType['type']]]);
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ class WC_Retailcrm_History_Assembler
|
||||
|
||||
if ($change['field'] == 'payments.status') {
|
||||
if ($change['newValue'] !== null) {
|
||||
$orders[$change['order']['id']]['payment']['id']['status'] = self::newValue($change['newValue']);
|
||||
$orders[$change['order']['id']]['payments']['id']['status'] = self::newValue($change['newValue']);
|
||||
}
|
||||
} else {
|
||||
if (isset($fields['delivery'][$change['field']]) && $fields['delivery'][$change['field']] == 'service') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user