diff --git a/intaro.retailcrm/lang/en/options.php b/intaro.retailcrm/lang/en/options.php index 493d7880..dcffd57e 100644 --- a/intaro.retailcrm/lang/en/options.php +++ b/intaro.retailcrm/lang/en/options.php @@ -137,3 +137,5 @@ $MESS ['DELETE_MATCHED'] = 'Delete'; $MESS ['LOCATION_LABEL'] = 'Location'; $MESS ['TEXT_ADDRESS_LABEL'] = 'Address (line)'; + +$MESS ['SYNC_INTEGRATION_PAYMENT'] = 'Activate synchronization of integrated payments'; diff --git a/intaro.retailcrm/lang/ru/options.php b/intaro.retailcrm/lang/ru/options.php index a0505647..8d0ea723 100644 --- a/intaro.retailcrm/lang/ru/options.php +++ b/intaro.retailcrm/lang/ru/options.php @@ -196,3 +196,5 @@ $MESS ['DELETE_MATCHED'] = 'Удалить'; $MESS ['LOCATION_LABEL'] = 'Местоположение (LOCATION)'; $MESS ['TEXT_ADDRESS_LABEL'] = 'Адрес (строкой)'; + +$MESS ['SYNC_INTEGRATION_PAYMENT'] = 'Активировать синхронизацию интегрированных оплат'; diff --git a/intaro.retailcrm/lib/component/configprovider.php b/intaro.retailcrm/lib/component/configprovider.php index 60897498..38d8c449 100644 --- a/intaro.retailcrm/lib/component/configprovider.php +++ b/intaro.retailcrm/lib/component/configprovider.php @@ -1171,6 +1171,16 @@ class ConfigProvider return static::getOption(Constants::RECEIVE_TRACK_NUMBER_DELIVERY); } + public static function getSyncIntegrationPayment() + { + return static::getOption(Constants::SYNC_INTEGRATION_PAYMENT); + } + + public static function setSyncIntegrationPayment($syncIntegrationPayment) + { + static::setOption(Constants::SYNC_INTEGRATION_PAYMENT, $syncIntegrationPayment); + } + /** * @return string */ diff --git a/intaro.retailcrm/lib/component/constants.php b/intaro.retailcrm/lib/component/constants.php index 7f3eac83..6f59a2a2 100644 --- a/intaro.retailcrm/lib/component/constants.php +++ b/intaro.retailcrm/lib/component/constants.php @@ -108,4 +108,5 @@ class Constants public const MATCHED_CUSTOM_USER_FIELDS = 'matched_custom_field'; public const USE_CRM_ORDER_METHODS = 'use_crm_order_methods'; public const CRM_ORDER_METHODS = 'crm_order_methods'; + public const SYNC_INTEGRATION_PAYMENT = 'sync_integration_payment'; } diff --git a/intaro.retailcrm/options.php b/intaro.retailcrm/options.php index 7edbd098..f7030897 100644 --- a/intaro.retailcrm/options.php +++ b/intaro.retailcrm/options.php @@ -835,6 +835,17 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) { ConfigProvider::setTrackNumberStatus(htmlspecialchars(trim($_POST['track-number'])) ?: 'N'); + $syncIntegrationPayment = htmlspecialchars(trim($_POST['sync-integration-payment'])) ?: 'N'; + + if ($syncIntegrationPayment === 'Y') { + ConfigProvider::setSyncIntegrationPayment($syncIntegrationPayment); + } + + ConfigProvider::setSyncIntegrationPayment + ( + htmlspecialchars(trim($_POST['sync-integration-payment'])) ?: 'N' + ); + COption::SetOptionString( $mid, $CRM_COUPON_FIELD, @@ -1149,6 +1160,7 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) { $optionsOrderNumbers = COption::GetOptionString($mid, $CRM_ORDER_NUMBERS, 0); $optionsOrderVat = COption::GetOptionString($mid, $CRM_ORDER_VAT, 0); $optionsOrderTrackNumber = ConfigProvider::getTrackNumberStatus(); + $optionsSyncIntegrationPayment = ConfigProvider::getSyncIntegrationPayment(); $canselOrderArr = unserialize(COption::GetOptionString($mid, $CRM_CANSEL_ORDER, 0)); $sendPickupPointAddress = COption::GetOptionString($mid, Constants::CRM_SEND_PICKUP_POINT_ADDRESS, 'N'); @@ -2820,6 +2832,15 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) { + + + + + + + @@ -3318,4 +3339,4 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) { End(); ?> - \ No newline at end of file +