Opened 2 years ago
Closed 2 years ago
#2566 closed Bug/Fehler (fixed)
Warning "Undefined variable $vat" in /create_*account.php
| Reported by: | noRiddle | Owned by: | somebody |
|---|---|---|---|
| Priority: | normal | Milestone: | modified-shop-2.0.8.0 |
| Component: | Shop | Version: | 2.0.7.2 |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: |
Description
Sowohl in /create-account.php als auch in create_guest_account.php kommt es je nach Konfiguration-Einstellungen zu diesen Warnings:
WARNING found for URL: /create_account.php
Undefined variable $vat in File: PATH/create_account.php on Line: 150
WARNING found for URL: /create_account.php {} {}
Undefined variable $vat in File: PATH/create_account.php on Line: 150
WARNING found for URL: /create_account.php {} {}
Undefined variable $vat in File: PATH/create_account.php on Line: 314
Das liegt daran, daß in den zugehörigen Template-Dateien
{if $vat == '1'}
innerhalb der Kondition
{if $company == '1'}
abgefragt wird.
Wenn man also
Konfiguration => Kunden Details => "Firma"
nicht aktiviert hat, wohl jedoch
Erw. Konfiguration -> USt-IdNr. => "USt-IdNr. abfragen"
wird das VAT-Feld im Template nicht angezeigt und befindet sich somit nicht im $_POST-Array.
In der zugehörigen PHP-Datei wird für die Verarbeitung des $_POST['vat'] jedoch lediglich nach
Erw. Konfiguration -> USt-IdNr. => "USt-IdNr. abfragen"
abgefragt:
if (ACCOUNT_COMPANY_VAT_CHECK == 'true') {
require_once(DIR_WS_CLASSES.'vat_validation.php');
$vatID = new vat_validation($vat, '', '', (int)$country);
$customers_status = $vatID->vat_info['status'];
$customers_vat_id_status = isset($vatID->vat_info['vat_id_status']) ? $vatID->vat_info['vat_id_status'] : '';
if (isset($vatID->vat_info['error']) && $vatID->vat_info['error']==1){
$messageStack->add('create_account', ENTRY_VAT_ERROR);
$error = true;
}
}
und
if (ACCOUNT_COMPANY_VAT_CHECK == 'true') {
$sql_data_array['customers_vat_id'] = $vat;
$sql_data_array['customers_vat_id_status'] = $customers_vat_id_status;
}
Entweder möchte man die Abhängigkeit Feld<=>Firma beibehalten, dann muß das in der PHP-Datei angepasst werden
oder man möchte die Abhängigkeit nicht, dann muß es im Template angepasst werden.
Zugehöriger Thread: Fehler Log bei Account Erstellung
Gruß,
noRiddle

In 15437: