1
0
Fork 0
mirror of synced 2025-04-03 22:03:34 +03:00

fix history, orders create

This commit is contained in:
Akolzin Dmitry 2017-09-13 10:42:11 +03:00
parent 7949fa4b3e
commit e9d7e706f8
2 changed files with 10 additions and 3 deletions

View file

@ -61,6 +61,9 @@ if ( ! class_exists( 'WC_Retailcrm_History' ) ) :
$generatedAt = $response->generatedAt;
foreach ($response['history'] as $record) {
if ($record['source'] == 'api' && $record['apiKey']['current'] == true) {
continue;
}
$this->removeFuncsHook();
@ -136,6 +139,9 @@ if ( ! class_exists( 'WC_Retailcrm_History' ) ) :
$generatedAt = $response->generatedAt;
foreach ($response['history'] as $record) {
if ($record['source'] == 'api' && $record['apiKey']['current'] == true) {
continue;
}
$this->removeFuncsHook();

View file

@ -297,7 +297,7 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) :
if (!empty($user_data_billing['postcode'])) $order_data['delivery']['address']['index'] = $user_data_billing['postcode'];
if (!empty($user_data_billing['city'])) $order_data['delivery']['address']['city'] = $user_data_billing['city'];
if (!empty($user_data_billing['country'])) $order_data['delivery']['address']['countryIso'] = $user_data_billing['country'];
if (!empty($user_data_billing['state'])) $order_data['delivery']['address']['region'] = $user_data_billing['state'];
}
$user_data = $order->get_address('shipping');
@ -311,12 +311,13 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) :
if (!empty($user_data['postcode'])) $order_data['delivery']['address']['index'] = $user_data['postcode'];
if (!empty($user_data['city'])) $order_data['delivery']['address']['city'] = $user_data['city'];
if (!empty($user_data['country'])) $order_data['delivery']['address']['countryIso'] = $user_data['country'];
if (!empty($user_data['state'])) $order_data['delivery']['address']['region'] = $user_data['state'];
}
$order_data['delivery']['address']['text'] = sprintf(
"%s %s %s %s",
"%s %s %s %s %s",
!empty($user_data_billing['postcode']) ? $user_data_billing['postcode'] : $user_data['postcode'],
!empty($user_data_billing['state']) ? $user_data_billing['state'] : $user_data['state'],
!empty($user_data_billing['city']) ? $user_data_billing['city'] : $user_data['city'],
!empty($user_data_billing['address_1']) ? $user_data_billing['address_1'] : $user_data['address_1'],
!empty($user_data_billing['address_2']) ? $user_data_billing['address_2'] : $user_data['address_2']