How to Change the Order Number & Invoice Number Format

With Hikashop, you don't have to settle for the default invoice number generated by the system. Infact you add suffixes, prefixes and dates to generate some pretty advanced invoice numbering system. This tutorial will give you some options on how to configure your invoice number and order number.


Click on Systems > Configuration


This option enables you to set the format of order numbers. By default, the order number uses letters and numbers interleaved together. this is represented here with the tag {automatic_code}.

Both the Order number and Invoice number are the same number. When an order is made, an order number is generated. The invoice number which is printed from the order uses the invoice number.

Set the Number of Digits


If you want to set the number of digits to correspond to the number of digits in your accounting system, you will need to use the tag {id}. The above example shows an 8 digit invoice number generated by the accounting software, MYOB.


In the example we can use {id size="8"} which will result an eight digit invoice number.

Setting the Date Field

You can also set the date tag in order to insert date information. For example, {date format="d/m/y"} will output the date as 24/03/12. For the various options on specifying date formats please refer to this guide:


So if you wanted to include an 8 digit number + date you would enter this: {id size="8"}-{date format="m-Y"}

Entering Suffixes or Prefixes

You can also easily add suffixes, prefixes, or anything else to it. You can generate a pretty advanced formats such as RE-{id size="8"}/{date format="m/Y"} used for German accounting which will result in RE-00000062/02/13 for the order 62 made on February 2013.

If you want to add a prefix in the invoice there, it's easy.


Click on the menu Display > Views


Select the name of your 1) template from the dropdown menu and select 2) "Back end". In the 3) Filters field enter "invoice" and click on "Go".


Click on your template name under the Template link.

In your template code, find the following code:


          if(!empty($this->element->order_invoice_number)) {
             echo JText::_('INVOICE').': '.$this->element->order_invoice_number;
          } else {
             echo JText::_('INVOICE').': '.@$this->element->order_number;


Now change this line:

<?php echo JText::_('INVOICE').': '.@$this->element->order_number;?>



<?php echo JText::_('INVOICE').': prefix'.@$this->element->order_number;?>


Change "prefix" to whatever prefix you want to add. So the prefix "SE" will look like:

<?php echo JText::_('INVOICE').': SE'.@$this->element->order_number;?>