Zen Cart Logo
Forums / All Other Contributions/Addons / VAT4EU Support Thread

VAT4EU Support Thread

Views: 25,605

Results 61 to 80 of 90
28 Apr 2022, 12:50 PM
#61
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

VAT4EU Support Thread

I've just submitted v3.1.1 of VAT4EU for the Zen Cart moderators' review; I'll post back here when it's available for download.

This release contains changes associated with the following GitHub issues:

#16: Correcting integration with Edit Orders, v4.6.0+.
#17: Use zen_cfg_read_only to ensure that the version number is read-only.
#18: Correct strict comparison that resulted in incorrect message to customer.

29 Apr 2022, 6:05 PM
#62
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

lat9:

I've just submitted v3.1.1 of VAT4EU for the Zen Cart moderators' review; I'll post back here when it's available for download.

This release contains changes associated with the following GitHub issues:

#16: Correcting integration with Edit Orders, v4.6.0+.
#17: Use zen_cfg_read_only to ensure that the version number is read-only.
#18: Correct strict comparison that resulted in incorrect message to customer.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2164

9 Dec 2023, 3:54 PM
#63
yesaul avatar

yesaul

New Zenner

Join Date:
Apr 2011
Location:
Espoo, Finland
Posts:
71
Plugin Contributions:
0

Re: VAT4EU Support Thread

Good day,

Sorry (if I do understand sometyhng wrong or issue has been already described), but the following code in auto.vat_for_eu_countries.php module can cause "Undefined variable" warning:

            // -----
            // Issued during the create-account, address-book or checkout-new-address processing, indicates that an address record
            // has been created/updated and gives us a chance to record the customer's VAT Number.
            //
            // Entry:
            //  $p1 ... An associative array that contains the address-book entry's default data.
            //
            case 'NOTIFY_MODULE_CREATE_ACCOUNT_ADDED_ADDRESS_BOOK_RECORD':  //- Fall through ...
            case 'NOTIFY_MODULE_CHECKOUT_ADDED_ADDRESS_BOOK_RECORD':        //- Fall through ...
            case 'NOTIFY_MODULE_ADDRESS_BOOK_UPDATED_ADDRESS_BOOK_RECORD':  //- Fall through ...
            case 'NOTIFY_MODULE_ADDRESS_BOOK_ADDED_ADDRESS_BOOK_RECORD':
                $address_book_id = ($eventID === 'NOTIFY_MODULE_ADDRESS_BOOK_UPDATED_ADDRESS_BOOK_RECORD') ? $p1['address_book_id'] : $p1['address_id'];
                $vat_number = zen_db_prepare_input($_POST['vat_number']);
                $db->Execute(
                    "UPDATE " . TABLE_ADDRESS_BOOK . "
                        SET entry_vat_number = '$vat_number',
                            entry_vat_validated = " . $this->vatNumberStatus . "
                      WHERE address_book_id = $address_book_id
                        AND customers_id = " . (int)$_SESSION['customer_id'] . "
                      LIMIT 1"
                );
                break;

$_SESSION['customer_id'] is not yet defined in case of "NOTIFY_MODULE_CREATE_ACCOUNT_ADDED_ADDRESS_BOOK_RECORD"

My humble suggestion is to use something like this instead:

(int)($eventID === 'NOTIFY_MODULE_CREATE_ACCOUNT_ADDED_ADDRESS_BOOK_RECORD' ? $p1[0]['value'] : $_SESSION['customer_id'])

6 Mar 2024, 1:59 AM
#64
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

Late come-back, but I'm preparing VAT4EU v3.2.0 for release and have this covered! That version will support Zen Cart versions 1.5.8a and 2.0.0, Edit Orders v4.7.0+, One-Page Checkout v2.4.6+ and the Bootstrap template v3.6.3+.

6 Mar 2024, 2:09 PM
#65
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

v3.2.0 of the VAT for EU Countries is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2164

This release represents a massive restructuring, with support for

  • Zen Cart versions 1.5.8a and 2.0.0
  • PHP versions 8.0 through 8.3.
  • Edit Orders, v4.7.0 and later
  • One-Page Checkout, v2.4.6 and later
  • Bootstrap template, v3.6.3 and later

A full list of the issues addressed in this release can be found here: https://github.com/lat9/vat4eu/issues?q=is%3Aissue+milestone%3Av3.2.0

14 Jun 2024, 1:28 PM
#66
siilike1232 avatar

siilike1232

New Zenner

Join Date:
Mar 2011
Posts:
56
Plugin Contributions:
0

Re: VAT4EU Support Thread

I have just installed v3.2.0, but do not see the VAT for EU Countries under Admin Configuration.
No error logs have been created ...

14 Jun 2024, 2:06 PM
#67
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

siilike1232:

I have just installed v3.2.0, but do not see the VAT for EU Countries under Admin Configuration.
No error logs have been created ...
Hmm, what version of Zen Cart and PHP is being used?

15 Jun 2024, 4:39 AM
#68
siilike1232 avatar

siilike1232

New Zenner

Join Date:
Mar 2011
Posts:
56
Plugin Contributions:
0

Re: VAT4EU Support Thread

lat9:

Hmm, what version of Zen Cart and PHP is being used?

ZC v2.0.1 and PHP 8.2

15 Jun 2024, 11:34 AM
#69
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

OK, let's try to figure out where the installation failed. You'll need to use phpMyAdmin to check the following database tables.

  1. configuration_group. Should have a record with a configuration_group_title of VAT4EU Plugin.
  2. configuration. There should be 9 records with a configuration_key LIKE VAT4EU%.
  3. admin_pages. Should have a record with a page_key of configVat4Eu.
  4. address_book. Should have two new fields named entry_vat_number and entry_vat_validated.
  5. orders. Should have two new fields named billing_vat_number and billing_vat_validated.

If you could perform the above database checks to see where the installation stopped, I can suggest what step to take next.

16 Jun 2024, 1:57 PM
#70
siilike1232 avatar

siilike1232

New Zenner

Join Date:
Mar 2011
Posts:
56
Plugin Contributions:
0

Re: VAT4EU Support Thread

lat9:

OK, let's try to figure out where the installation failed. You'll need to use phpMyAdmin to check the following database tables.

  1. configuration_group. Should have a record with a configuration_group_title of VAT4EU Plugin.
  2. configuration. There should be 9 records with a configuration_key LIKE VAT4EU%.
  3. admin_pages. Should have a record with a page_key of configVat4Eu.
  4. address_book. Should have two new fields named entry_vat_number and entry_vat_validated.
  5. orders. Should have two new fields named billing_vat_number and billing_vat_validated.

If you could perform the above database checks to see where the installation stopped, I can suggest what step to take next.

  1. True
  2. I can find 7 records
  3. Not present
  4. True
  5. True
16 Jun 2024, 3:30 PM
#71
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

Weird. You can create that missing page key by navigating to the admin's*** Admins :: Admin Page Registration*** tool. From there, enter

Page Key ............ configVat4Eu
Page Name ........... BOX_CONFIG_VAT4EU
Page File Name ...... FILENAME_CONFIGURATION
Page Parameters .... gID=xx (where xx is the configuration_group_id you see for item 1, above)
Menu ................... Choose "Configuration"
Display on Menu? ... Tick the box

Then click the "Insert" button.

16 Jun 2024, 4:09 PM
#72
siilike1232 avatar

siilike1232

New Zenner

Join Date:
Mar 2011
Posts:
56
Plugin Contributions:
0

Re: VAT4EU Support Thread

lat9:

Weird. You can create that missing page key by navigating to the admin's*** Admins :: Admin Page Registration*** tool. From there, enter

Page Key ............ configVat4Eu
Page Name ........... BOX_CONFIG_VAT4EU
Page File Name ...... FILENAME_CONFIGURATION
Page Parameters .... gID=xx (where xx is the configuration_group_id you see for item 1, above)
Menu ................... Choose "Configuration"
Display on Menu? ... Tick the box

Then click the "Insert" button.

The Admin page is not working, but on the store page no VAT no field is displayd :( Company field is present.

As I enable the Vat debug, I now have the first log file:
2024-06-16 16:02:36: checkVatIsRefundable(, )
Returning ()

2024-06-16 16:05:13: checkVatIsRefundable(, )
Returning ()

2024-06-16 16:05:29: checkVatIsRefundable(, )
Returning ()

16 Jun 2024, 4:42 PM
#73
siilike1232 avatar

siilike1232

New Zenner

Join Date:
Mar 2011
Posts:
56
Plugin Contributions:
0

Re: VAT4EU Support Thread

siilike1232:

The Admin page is not working, but on the store page no VAT no field is displayd :( Company field is present.

As I enable the Vat debug, I now have the first log file:
2024-06-16 16:02:36: checkVatIsRefundable(, )
Returning ()

2024-06-16 16:05:13: checkVatIsRefundable(, )
Returning ()

2024-06-16 16:05:29: checkVatIsRefundable(, )
Returning ()

Sorry, Admin page is now working

3 Jul 2024, 10:52 AM
#74
siilike1232 avatar

siilike1232

New Zenner

Join Date:
Mar 2011
Posts:
56
Plugin Contributions:
0

Re: VAT4EU Support Thread

I gave it a new try with a fresh install and now I have everything working at the Admin side, but the VAT field is not displayed on the Store side, Company field is set to TRUE and is shown.

3 Jul 2024, 12:31 PM
#75
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

siilike1232:

I gave it a new try with a fresh install and now I have everything working at the Admin side, but the VAT field is not displayed on the Store side, Company field is set to TRUE and is shown.
Not displayed ***for entry ***on addresses or not displayed after being entered?

19 Sep 2024, 5:22 PM
#76
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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.

28 Sep 2024, 7:31 AM
#77
yesaul avatar

yesaul

New Zenner

Join Date:
Apr 2011
Location:
Espoo, Finland
Posts:
71
Plugin Contributions:
0

Re: VAT4EU Support Thread

In order to avoid 'Undefined array key' warnings in includes/classes/observers/auto.vat_for_eu_countries.php

  • on line 403
$vat_number = strtoupper(zen_db_prepare_input(!empty($_POST['vat_number']) ? $_POST['vat_number'] : ''));
  • on line 290
$vat_number = zen_db_prepare_input(!empty($_POST['vat_number']) ? $_POST['vat_number'] : '');
28 Sep 2024, 12:41 PM
#78
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

yesaul:

In order to avoid 'Undefined array key' warnings in includes/classes/observers/auto.vat_for_eu_countries.php

  • on line 403

$vat_number = strtoupper(zen_db_prepare_input(!empty($_POST['vat_number']) ? $_POST['vat_number'] : ''));

> 
> - on line 290
> 
> ```
$vat_number = zen_db_prepare_input(!empty($_POST['vat_number']) ? $_POST['vat_number'] : '');

Could you post the full PHP Warning logged? That way, I can see the backtrace to understand where this issue is sourced.

12 Mar 2025, 6:08 PM
#79
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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.

19 Mar 2025, 9:08 AM
#80
yesaul avatar

yesaul

New Zenner

Join Date:
Apr 2011
Location:
Espoo, Finland
Posts:
71
Plugin Contributions:
0

Re: VAT4EU Support Thread

In order to avoid 'Undefined array key' warnings in includes/classes/observers/auto.vat_for_eu_countries.php

  • on line 403

...

  • on line 290

...

in validateVatNumber method this issue is now solved (line #516 in current version ):

$vat_number = strtoupper(zen_db_prepare_input($_POST['vat_number'] ?? ''));

but in update the unnecessary warnings are still being generated (line # 325 in current version)

$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.