To change the order number generation do as follows:

  1. Go to administrator/components/com_virtuemart/classes/ps_checkout.php Find the following function - get_order_number() and change

    <?php
    ...
    function get_order_number() {
    	global $auth;
    	/* Generated a unique order number */
    
    	$str = session_id();
    	$str .= (string)time();
    	$date = date('d.m.Y');  
    	$db =& JFactory::getDBO();
    	$query = "   SELECT order_id
    	        FROM #__vm_orders ";
    	$db->setQuery($query);
    	$column= $db->loadResultArray();
    	$anzahl = count($column) + 1;
    	$order_number = "Nike ".$anzahl." - ".$date ;        
    	return substr($order_number, 0, 32);
    }
    

  2. Go to administrator/components/com_virtuemart/classes/ps_order.php at line 308 change

    <?php
    ...
    $q = "SELECT first_name,last_name,user_email,order_status_name FROM #__{vm}_order_user_info,#__{vm}_orders,#__{vm}_order_status ";
    
    to
    <?php
    ...
    $q = "SELECT first_name,last_name,order_number,user_email,order_status_name FROM #__{vm}_order_user_info,#__{vm}_orders,#__{vm}_order_status ";
    

at line 340 and 343, change

<?php
...
$d["order_id"]
to
<?php
...
$d["order_number"]
This ensures that the user gets e-mailed about his order number, instead of order_id.

Now, in the account maintenance panel, displaying the order_number instead of the id is something I’ve not been able get to correctly work out, so if someone could get that working, this would be complete.

  1. In the same file, (administrator/components/com_virtuemart/classes/ps_order.php) at line 615 or find the code.
    <?php
    ...
    $tmp_cell .= "<br /><strong>".$VM_LANG->_('PHPSHOP_ORDER_PRINT_PO_NUMBER').":</strong> " . sprintf("%08d", $db->f("order_id"));
    
    to
    <?php
    ...
    $tmp_cell .= "<br /><strong>".$VM_LANG->_('PHPSHOP_ORDER_PRINT_PO_NUMBER').":</strong> " . sprintf($db->f("order_number"));
    

and at line 559 change

<?php
...
$listfields = 'cdate,order_total,order_status,order_id,order_number,order_currency';
to
<?php
...
$listfields = 'cdate,order_total,order_status,order_id,order_currency';

  1. Now, go to administrator/components/com_virtuemart/html/account.order_details.php and change the code.

    <?php
    ...
    $mainframe->setPageTitle( $VM_LANG->_('PHPSHOP_ACC_ORDER_INFO').' : '.$VM_LANG->_('PHPSHOP_ORDER_LIST_ID').' '.$db->f('order_id'));
    
    to
    $mainframe->setPageTitle( $VM_LANG->_('PHPSHOP_ACC_ORDER_INFO').' : '.$VM_LANG->_('PHPSHOP_ORDER_LIST_ID').' '.$db->f('order_number'));
    

  2. finally, go to components/com_virtuemart/themes/default/templates/pages/account.order_details.tpl.php

    <td><?php printf("%08d", $db->f("order_id")); ?></td>
    
    to
    <td><?php printf($db->f("order_number")); ?></td>
    

Here will be the link