diff --git a/api/index.php b/api/index.php index ea253c9..bc8d9dc 100644 --- a/api/index.php +++ b/api/index.php @@ -2339,7 +2339,10 @@ switch($PARAM_1) if(checkRecaptchaRequest($_REQUEST['recaptcha_token'], $ipAddress)) { - $_REQUEST['FORM_FIELD_REGION'] = $result->getGeoData()->regionName.", ".$result->getGeoData()->cityName; + if($result !== null) + { + $_REQUEST['FORM_FIELD_REGION'] = $result->getGeoData()->regionName.", ".$result->getGeoData()->cityName; + } $error = ""; $form_errors = Array(); @@ -2502,7 +2505,7 @@ switch($PARAM_1) "page_name" => $REQ['FORM_FIELD_PAGE_NAME'], "sale_type" => $REQ['FORM_FIELD_SALE_TYPE'], "inn" => $REQ['FORM_FIELD_INN'], - "clientID" => $REQ['FORM_FIELD_INN'], + "clientID" => $REQ['FORM_FIELD_YM_CLIENT_ID'], ]; if(!empty($REQ['FORM_FIELD_IS_IZT'])) { diff --git a/local/components/evolution/form.leasing.nomail/templates/.default/script.js b/local/components/evolution/form.leasing.nomail/templates/.default/script.js index 67ae1aa..df256f8 100644 --- a/local/components/evolution/form.leasing.nomail/templates/.default/script.js +++ b/local/components/evolution/form.leasing.nomail/templates/.default/script.js @@ -58,7 +58,9 @@ function form_leasing_request_submit() try { - formData.append("FORM_FIELD_YM_CLIENT_ID", Ya._metrika.getCounters()[0].id); + ym(Ya._metrika.getCounters()[0].id, 'getClientID', function(client_id) { + formData.append("FORM_FIELD_YM_CLIENT_ID", client_id); + }); } catch(e) {} diff --git a/local/components/evolution/form.leasing.used/templates/.default/script.js b/local/components/evolution/form.leasing.used/templates/.default/script.js index 3b45c62..0c8241f 100644 --- a/local/components/evolution/form.leasing.used/templates/.default/script.js +++ b/local/components/evolution/form.leasing.used/templates/.default/script.js @@ -60,7 +60,9 @@ function form_leasing_request_submit() try { - formData.append("FORM_FIELD_YM_CLIENT_ID", Ya._metrika.getCounters()[0].id); + ym(Ya._metrika.getCounters()[0].id, 'getClientID', function(client_id) { + formData.append("FORM_FIELD_YM_CLIENT_ID", client_id); + }); } catch(e) {} diff --git a/local/components/evolution/form.leasing/templates/.default/script.js b/local/components/evolution/form.leasing/templates/.default/script.js index 67ae1aa..df256f8 100644 --- a/local/components/evolution/form.leasing/templates/.default/script.js +++ b/local/components/evolution/form.leasing/templates/.default/script.js @@ -58,7 +58,9 @@ function form_leasing_request_submit() try { - formData.append("FORM_FIELD_YM_CLIENT_ID", Ya._metrika.getCounters()[0].id); + ym(Ya._metrika.getCounters()[0].id, 'getClientID', function(client_id) { + formData.append("FORM_FIELD_YM_CLIENT_ID", client_id); + }); } catch(e) {}