1
0
mirror of synced 2025-01-29 22:31:42 +03:00

Skip inactive statuses

This commit is contained in:
Dima Uryvskiy 2021-08-18 12:17:06 +03:00 committed by GitHub
parent 07aab1078e
commit e9e2d52c31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 7 deletions

View File

@ -200,6 +200,10 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration
if (!empty($retailcrm_shipping_list) && $retailcrm_shipping_list->isSuccessful()) {
foreach ($retailcrm_shipping_list['deliveryTypes'] as $retailcrm_shipping_type) {
if ($retailcrm_shipping_type['active'] == false) {
continue;
}
$shipping_option_list[$retailcrm_shipping_type['code']] = $retailcrm_shipping_type['name'];
}
@ -235,6 +239,10 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration
if (!empty($retailcrm_payment_list) && $retailcrm_payment_list->isSuccessful()) {
foreach ($retailcrm_payment_list['paymentTypes'] as $retailcrm_payment_type) {
if ($retailcrm_payment_type['active'] == false) {
continue;
}
$payment_option_list[$retailcrm_payment_type['code']] = $retailcrm_payment_type['name'];
}
@ -268,6 +276,10 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration
if (!empty($retailcrm_statuses_list) && $retailcrm_statuses_list->isSuccessful()) {
foreach ($retailcrm_statuses_list['statuses'] as $retailcrm_status) {
if ($retailcrm_status['active'] == false) {
continue;
}
$statuses_option_list[$retailcrm_status['code']] = $retailcrm_status['name'];
}

View File

@ -79,7 +79,7 @@ class WC_Retailcrm_Base_Test extends WC_Retailcrm_Test_Case_Helper
array(
'name' => 'orderMethod2',
'code' => 'orderMethod2',
'active' => true
'active' => false
)
)
);
@ -92,11 +92,13 @@ class WC_Retailcrm_Base_Test extends WC_Retailcrm_Test_Case_Helper
'deliveryTypes' => array(
array(
'name' => 'delivery1',
'code' => 'delivery1'
'code' => 'delivery1',
'active' => true
),
array(
'name' => 'delivery2',
'code' => 'delivery2'
'code' => 'delivery2',
'active' => true
)
)
);
@ -109,11 +111,13 @@ class WC_Retailcrm_Base_Test extends WC_Retailcrm_Test_Case_Helper
'paymentTypes' => array(
array(
'name' => 'payment1',
'code' => 'payment1'
'code' => 'payment1',
'active' => true
),
array(
'name' => 'payment2',
'code' => 'payment2'
'code' => 'payment2',
'active' => true
)
)
);
@ -126,11 +130,13 @@ class WC_Retailcrm_Base_Test extends WC_Retailcrm_Test_Case_Helper
'statuses' => array(
array(
'name' => 'status1',
'code' => 'status1'
'code' => 'status1',
'active' => true
),
array(
'name' => 'status2',
'code' => 'status2'
'code' => 'status2',
'active' => true
)
)
);