Author Topic: Unique random ID and show this in invoice and history instead of ORDER_ID  (Read 146 times)

Offline AVS

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
I would like to use Unique random ID for orders and keep default Order ID as internal only. Let the unique ID alone be shown to customers and payment gateway as well. How to modify order.php and invoice.tpl file to achieve this.
I tried to insert a column 'unix'  in ab_orders and used NOW() to generate random id that gets inserted in 'unix' column. But it is not showing invoice tpl as I am stuck up with fetching this data and get the result or echo it . How get this variable data and put it in the invoice page?
 Any ideas would be a great help!
Thanks

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4109
  • Karma: +246/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Unique random ID and show this in invoice and history instead of ORDER_ID
« Reply #1 on: December 16, 2018, 11:26:24 AM »
If you add new field into database, you also need to add it to order model, order class, possibly to controller and you need to add it to template as well.

Keep in mind, that if you what to show it in the admin order listing grid, you will need to update response controller that respond with JASON data for the grid.
We need your help to build better free open source eCommerce platform for everyone.
See how you can help

Offline AVS

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
Re: Unique random ID and show this in invoice and history instead of ORDER_ID
« Reply #2 on: December 18, 2018, 01:53:20 AM »
If you add new field into database, you also need to add it to order model, order class, possibly to controller and you need to add it to template as well.

Keep in mind, that if you what to show it in the admin order listing grid, you will need to update response controller that respond with JASON data for the grid.

Thanks for the reply with your ideas. But I am not that much knowledgeable about adding order model, class  to controller and JASON. If you can give any suggestion on sample code in these files would be helpful. Thanks

Offline maxter

  • Jr. Member
  • **
  • Posts: 92
  • Karma: +32/-0
    • View Profile
Re: Unique random ID and show this in invoice and history instead of ORDER_ID
« Reply #3 on: December 18, 2018, 10:07:13 PM »
I checked what this change entails and it would take some time to provide steps.
If you have no programming skills it would be even more difficult, as it would require to provide a complete solution for you.

You probably need to hire someone to do this.

Offline AVS

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
Re: Unique random ID and show this in invoice and history instead of ORDER_ID
« Reply #4 on: December 18, 2018, 11:06:50 PM »
I checked what this change entails and it would take some time to provide steps.
If you have no programming skills it would be even more difficult, as it would require to provide a complete solution for you.

You probably need to hire someone to do this.

Oh. If any ideas you come to know, please let me know. Thanks