NKoonen / vatchecker

[Prestashop]Checks if customer has a valid VAT number, and then puts the customer a specific group.
https://customs-documents.com
BSD 3-Clause "New" or "Revised" License
34 stars 15 forks source link

Problem with function isEUCountry( $countryCode ) #47

Closed felixd closed 6 months ago

felixd commented 6 months ago

$countryId variable returned by Tools::getValue is string type:

var_dump in Prestashop 8.1.5

# Poland -> "14"
string(2) "14"

https://github.com/NKoonen/vatchecker/blob/1309d1c0509b2c3434c5261771a09e4a95e98f0f/ajax.php#L16-L18

isEUCountry funcation compares variables using === (identical, checks also type)

https://github.com/NKoonen/vatchecker/blob/1309d1c0509b2c3434c5261771a09e4a95e98f0f/vatchecker.php#L944-L954

I have created quickfix pull request for this #46

Prestashop version: 8.1.5

NKoonen commented 6 months ago

Thanks, good catch! :)