Modify

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

Attachments (0)

Change History (1)

comment:1 by Gerhard Waldemair, 2 years ago

Resolution: fixed
Status: newclosed

In 15437:

fix #2566 - fix warning

Modify Ticket

Action
as closed The owner will remain somebody.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.