Jump to content

how to change order reference?


Recommended Posts

The creation of a reference is done in Function generateReference(), which is located in classes/Order/Order.php:

 

public static function generateReference()
{
return strtoupper(Tools::passwdGen(9, 'NO_NUMERIC'));  // Change to 15
}
 
Which uses the function passwdGen from file classes/tools.php:
 
public static function passwdGen($length = 8, $flag = 'ALPHANUMERIC')
{
switch ($flag)
{
case 'NUMERIC':
 $str = '0123456789';
 break;
case 'NO_NUMERIC':
 $str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
 break;
default:
 $str = 'abcdefghijkmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
 break;
}
 
for ($i = 0, $passwd = ''; $i < $length; $i++)
 $passwd .= Tools::substr($str, mt_rand(0, Tools::strlen($str) - 1), 1);
 return $passwd;
}
 

You're lucky, the reference field is a varchar(32), so making it longer to 15 is no problem in the database. Only check the screens/PDF's etc if it still fits on the lines..

 

pascal

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...