News:

Looking for documentation? Take a look on our wiki

Main Menu

How to change the format of Number of order?

Started by molasar, January 19, 2016, 02:16:50 AM

Previous topic - Next topic

molasar

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?

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

EIF

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