diff --git a/classes/Tools.php b/classes/Tools.php
index c993cbb7c..592dc8c9e 100644
--- a/classes/Tools.php
+++ b/classes/Tools.php
@@ -35,11 +35,24 @@ class ToolsCore
* Random password generator
*
* @param integer $length Desired length (optional)
+ * @param string $flag Output type (NUMERIC, ALPHANUMERIC, NO_NUMERIC)
* @return string Password
*/
- public static function passwdGen($length = 8)
+ public static function passwdGen($length = 8, $flag = 'ALPHANUMERIC')
{
- $str = 'abcdefghijkmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ 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 .= self::substr($str, mt_rand(0, self::strlen($str) - 1), 1);
return $passwd;
diff --git a/classes/order/Order.php b/classes/order/Order.php
index 0287b9532..1373f5363 100644
--- a/classes/order/Order.php
+++ b/classes/order/Order.php
@@ -1292,9 +1292,7 @@ class OrderCore extends ObjectModel
*/
public static function generateReference()
{
- // To generate a random reference, we first generate a random number
- // This number is a rand concated with the current timestamp
- return strtoupper(Tools::passwdGen(9)); // lol Max !
+ return strtoupper(Tools::passwdGen(9, 'NO_NUMERIC'));
}
public function orderContainProduct($id_product)
diff --git a/modules/bankwire/payment_return.tpl b/modules/bankwire/payment_return.tpl
index 1fc35abb6..51a12b6b6 100644
--- a/modules/bankwire/payment_return.tpl
+++ b/modules/bankwire/payment_return.tpl
@@ -32,8 +32,11 @@
- {l s='to the account owner of' mod='bankwire'} {if $bankwireOwner}{$bankwireOwner}{else}___________{/if}
- {l s='with these details' mod='bankwire'} {if $bankwireDetails}{$bankwireDetails}{else}___________{/if}
- {l s='to this bank' mod='bankwire'} {if $bankwireAddress}{$bankwireAddress}{else}___________{/if}
-
- {l s='Do not forget to insert your order #' mod='bankwire'} {$id_order} {l s='in the subject of your bank wire' mod='bankwire'}
-
{l s='An e-mail has been sent to you with this information.' mod='bankwire'}
+ {if !isset($reference)}
+
- {l s='Do not forget to insert your order number #' mod='bankwire'} {$id_order} {l s='in the subject of your bank wire' mod='bankwire'}
+ {else}
+
- {l s='Do not forget to insert your order reference' mod='bankwire'} {$reference} {l s='in the subject of your bank wire' mod='bankwire'}
+ {/if}
{l s='An e-mail has been sent to you with this information.' mod='bankwire'}
{l s='Your order will be sent as soon as we receive your settlement.' mod='bankwire'}
{l s='For any questions or for further information, please contact our' mod='bankwire'} {l s='customer support' mod='bankwire'}.