Jump to content

ERROR - Identification Number in PS 1.7


Web Curator
 Share

Recommended Posts

Hi Guys

 

I have a problem with the IDENTIFICATION NUMBER during the checkout.

 

Even if you complete the field correctly, I have this bad feedback:

 

INVALID FORMAT

 

Do you know how to fix this validation or disable it? somebody else with the same problem?

 

 

Best

Edited by Web Curator (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

At the moment the validation of the Identification Number seems is made by the function isSiret in the file Validate.php

but is made for only the french public... maybe is this one the error?

 

For a w.w. e-commerce we need a check that include only String and Numbers?

    public static function isSiret($siret)
    {
        if (Tools::strlen($siret) != 14) {
            return false;
        }
        $sum = 0;
        for ($i = 0; $i != 14; $i++) {
            $tmp = ((($i + 1) % 2) + 1) * intval($siret[$i]);
            if ($tmp >= 10) {
                $tmp -= 9;
            }
            $sum += $tmp;
        }
        return ($sum % 10 === 0);
    }

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More