v3.2.1 of VAT for EU Countries is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2164
This version corrects the vat_number sorting in the admin's Customers :: Customers tool.
In order to avoid 'Undefined array key' warnings in includes/classes/observers/auto.vat_for_eu_countries.php
- on line 403
- on line 290Code:$vat_number = strtoupper(zen_db_prepare_input(!empty($_POST['vat_number']) ? $_POST['vat_number'] : ''));
Code:$vat_number = zen_db_prepare_input(!empty($_POST['vat_number']) ? $_POST['vat_number'] : '');
v4.0.0 of VAT4EU is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2164
This version of VAT4EU is released as a Zen Cart encapsulated plugin for zc210+, supporting Edit Orders5.
in validateVatNumber method this issue is now solved (line #516 in current version ):In order to avoid 'Undefined array key' warnings in includes/classes/observers/auto.vat_for_eu_countries.php
- on line 403
...
- on line 290
...
but in update the unnecessary warnings are still being generated (line # 325 in current version)Code:$vat_number = strtoupper(zen_db_prepare_input($_POST['vat_number'] ?? ''));
Code:$vat_number = zen_db_prepare_input($_POST['vat_number']);
[19-Mar-2025 10:31:02 Europe/Helsinki] Request URI: /index.php?main_page=create_account, IP address: ..., Language id 1
#0 .../public_html/zc_plugins/VAT4EU/v4.0.0/catalog/includes/classes/observers/auto.vat_for_eu_countries.php(325): zen_debug_error_handler()
#1 ..../public_html/includes/classes/traits/NotifierManager.php(106): zcObserverVatForEuCountries->update()
#2 ....public_html/includes/classes/Customer.php(919): base->notify()
#3 ....public_html/includes/modules/.../create_account.php(294): Customer->create()
#4 ....public_html/includes/modules/pages/create_account/header_php.php(16): include('/home/...')
#5 .../public_html/index.php(35): require('/home/...')
--> PHP Warning: Undefined array key "vat_number" in ...../public_html/zc_plugins/VAT4EU/v4.0.0/catalog/includes/classes/observers/auto.vat_for_eu_countries.php on line 325.
Last edited by yesaul; 19 Mar 2025 at 10:15 AM.
Thanks for the report; I've created a GitHub issue to track the required change: https://github.com/lat9/vat4eu/issues/50
Actually, if that field's missing that implies a possible misconfiguration, since VAT4EU's observer should have inserted some jQuery that will add the vat_number entry field to those forms.
What template is in use and is the configuration setting Customer Details :: Company set to true?
Customer Details :: Company ('ACCOUNT_COMPANY' key) is set to falseWhat template is in use and is the configuration setting Customer Details :: Company set to true?
(I do put corporate customers having EU-VAT-# manually from Admin )
I use my own template (but this does no matter here, I think)