AbanteCart Community

AbanteCart Development => Customization help => Topic started by: AVS on December 15, 2018, 02:25:26 AM

Title: Unique random ID and show this in invoice and history instead of ORDER_ID
Post by: AVS on December 15, 2018, 02:25:26 AM
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
Title: Re: Unique random ID and show this in invoice and history instead of ORDER_ID
Post by: abantecart 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.
Title: Re: Unique random ID and show this in invoice and history instead of ORDER_ID
Post by: AVS 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
Title: Re: Unique random ID and show this in invoice and history instead of ORDER_ID
Post by: maxter 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.
Title: Re: Unique random ID and show this in invoice and history instead of ORDER_ID
Post by: AVS 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