Sunday, July 23, 2023

Prestashop 1.6, 1.7, 8 - zmena cisla objednavky na alfanumericky (Change Order Number to alphanumeric)

 V classes/order/order.php najdete nasledujici kod
In classes/order/Order.php find the following

 

public static function generateReference()
{
    return strtoupper(Tools::passwdGen(9, 'NO_NUMERIC'));
}
 

a zmente na 

and change it to

 

public static function generateReference()
{
    $last_id = Db::getInstance()->getValue('
        SELECT MAX(id_order)
        FROM '._DB_PREFIX_.'orders');
    return str_pad((int)$last_id + 1, 9, 'OBJ-00000', STR_PAD_LEFT);
 
}

 

Tento krok zmeni kod objednavky z #ZPZKBVBIG na #OBJ-00025 napriklad. Muzete tak nastavit stejny kod pro objednavku, variabilni symbol a fakturu. 

This will change the order code from #ZPZKBVBIG to #OBJ-00025 for example. So you can set the same number of order, variable symbol, invoice  

No comments:

Post a Comment

Thank you for your comment. Will try to react as soon as possible.

Regards,

Networ King