VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: molasar on January 19, 2016, 02:16:50 AM

Title: How to change the format of Number of order?
Post by: molasar on January 19, 2016, 02:16:50 AM
Hello!

Joomla_3.4.5 + Virtuemart.3.0.12

Now I have the Number of order like L8R60118. But I want to make it like 00118.
I have edited file /administrator/components/com_virtuemart/models/orders.php :
   
        static public function generateOrderNumber($uid = 0,$length=4, $virtuemart_vendor_id=1) {

      $db = JFactory::getDBO();

      $q = 'SELECT COUNT(1) FROM #__virtuemart_orders WHERE `virtuemart_vendor_id`="'.$virtuemart_vendor_id.'"';
      $db->setQuery($q);

      //We can use that here, because the order_number is free to set, the invoice_number must often follow special rules
      $count = $db->loadResult();
      $count = $count + (int)VM_ORDER_OFFSET;

      //if(!class_exists('vmCrypt'))
      //   require(VMPATH_ADMIN.DS.'helpers'.DS.'vmcrypt.php');
      //$data = vmCrypt::getHumanToken($length).'0'.$count;
      $data = '00'.$count;

      return $data;
   }


But no effect.

What is wrong?
Title: Re: How to change the format of Number of order?
Post by: GJC Web Design on January 19, 2016, 11:37:08 AM
http://open-tools.net/virtuemart/advanced-ordernumbers.html ?
Title: Re: How to change the format of Number of order?
Post by: EIF on April 15, 2019, 18:00:18 PM
They have stopped the development of that plugin.

Maybe someone have a good alternative?
Also see topic https://forum.virtuemart.net/index.php?topic=142406.0 (https://forum.virtuemart.net/index.php?topic=142406.0)