X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Order ID Random Incrementation... (https://forum.x-cart.com/showthread.php?t=25789)

JDAM1 02-15-2011 10:36 AM

Re: Order ID Random Incrementation...
 
SeaCoast, I had a problem as well looking for the code in cart.php. I ended up following post #11 from carpeperdiem. It may not jump in increments, but you can at least start with a 3, 4 or 5 digit order number.

Sylvain 05-18-2011 08:42 PM

Re: Order ID Random Incrementation...
 
I would love to have something that work for 4.4.3

Sylvain 05-18-2011 09:01 PM

Re: Order ID Random Incrementation...
 
I got to work with 4.4.3 In 4.4.x the code that handles the "order_message" mode processing is located in the "<xcart_dir>/include/checkout_init.php".

On line 511 change:
$location[] = array(func_get_langvar_by_name('lbl_order_processe d'), '');

for:

include $xcart_dir."/include/increment.php";
$location[] = array(func_get_langvar_by_name("lbl_order_processe d"), '');

And Create a new file called 'increment.php' in /yourxcartdirhere/include/ containing:

<?php # # This randomly increments the orderid each time an order is made... # Simply call it once an order has been made; include $xcart_dir."/include/increment.php"; # Uses this idea - db_query("ALTER TABLE xcart_orders AUTO_INCREMENT = xxxxxx"); # $advanceBy = rand(8, 30); $NewNumber = $orderids + $advanceBy; $FD_InsertQuery = "ALTER TABLE xcart_orders AUTO_INCREMENT = $NewNumber"; db_query($FD_InsertQuery); ?>

neaisha 07-11-2011 12:58 PM

Re: Order ID Random Incrementation...
 
Quote:

Originally Posted by Sylvain
I got to work with 4.4.3 In 4.4.x the code that handles the "order_message" mode processing is located in the "<xcart_dir>/include/checkout_init.php".

On line 511 change:
$location[] = array(func_get_langvar_by_name('lbl_order_processe d'), '');

for:

include $xcart_dir."/include/increment.php";
$location[] = array(func_get_langvar_by_name("lbl_order_processe d"), '');




$location[] = include $xcart_dir . '/include/increment.php';
array(func_get_langvar_by_name('lbl_order_processe d'), '');

^works instead of...

include $xcart_dir."/include/increment.php";
$location[] = array(func_get_langvar_by_name("lbl_order_processe d"), '');

steakbbq 11-27-2012 06:04 PM

Re: Order ID Random Incrementation...
 
Anyone know if this works in 4.5?

Thanks

carpeperdiem 01-03-2013 08:17 AM

Re: Order ID Random Incrementation...
 
Quote:

Originally Posted by steakbbq
Anyone know if this works in 4.5?

Thanks


Works perfectly in 4.5.4 as contributed by neaisha in post #34

PHP Code:

$location[] = include $xcart_dir '/include/increment.php';
array(
func_get_langvar_by_name('lbl_order_processed'), ''); 


seaCOAST 05-12-2013 06:36 PM

Re: Order ID Random Incrementation...
 
Tried this in v4.5.5 and it's not working. No errors, but it's still not working. I cleared the cache and tried 6 test orders. No change. :(

seaCOAST 05-15-2013 06:46 AM

Re: Order ID Random Incrementation...
 
If anyone is interested...

The above code DOES work! Apparently, I needed to complete an order for it to start taking effect.

Just thought I'd give an update. ;)

acidon 08-29-2013 08:34 AM

Re: Order ID Random Incrementation...
 
I am trying to implement this in 4.6.0.

I noticed there are 2 instances of:

Code:

$location[] = array(func_get_langvar_by_name('lbl_order_processed'), '');

in checkout_init.php, second appears to refer to "invoice page (order confirmation page) for amazon order details widget"... should I change it too?

acidon 11-27-2016 02:01 PM

Re: Order ID Random Incrementation...
 
Works in 4.7.6 :-)


All times are GMT -8. The time now is 09:37 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.