Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Order ID Random Incrementation...

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #31  
Old 02-15-2011, 10:36 AM
 
JDAM1 JDAM1 is offline
 

Member
  
Join Date: Aug 2010
Posts: 11
 

Default 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.
__________________
X-Cart 4.4.4
Smart Template
CDSEO
Reply With Quote
  #32  
Old 05-18-2011, 08:42 PM
  Sylvain's Avatar 
Sylvain Sylvain is offline
 

Newbie
  
Join Date: Jul 2010
Posts: 9
 

Default Re: Order ID Random Incrementation...

I would love to have something that work for 4.4.3
__________________
4.4.3
X-Cart Gold

Sylvain Brouillette
Best Quality Printing
http://www.bestqualityprinting.com
Reply With Quote
  #33  
Old 05-18-2011, 09:01 PM
  Sylvain's Avatar 
Sylvain Sylvain is offline
 

Newbie
  
Join Date: Jul 2010
Posts: 9
 

Default 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); ?>
__________________
4.4.3
X-Cart Gold

Sylvain Brouillette
Best Quality Printing
http://www.bestqualityprinting.com
Reply With Quote
  #34  
Old 07-11-2011, 12:58 PM
  neaisha's Avatar 
neaisha neaisha is offline
 

eXpert
  
Join Date: May 2006
Posts: 276
 

Default 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"), '');
__________________
X-Cart Gold 4.4.3
--------------------------------------
Reply With Quote
  #35  
Old 11-27-2012, 06:04 PM
 
steakbbq steakbbq is offline
 

Member
  
Join Date: Oct 2011
Posts: 12
 

Default Re: Order ID Random Incrementation...

Anyone know if this works in 4.5?

Thanks
__________________
Xcart 4.4.4 GOLD
No addons.
Reply With Quote
  #36  
Old 01-03-2013, 08:17 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default 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'), ''); 
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #37  
Old 05-12-2013, 06:36 PM
  seaCOAST's Avatar 
seaCOAST seaCOAST is offline
 

X-Adept
  
Join Date: Oct 2002
Location: New Hampshire
Posts: 569
 

Default 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.
__________________
Xcart V4.5.5 Gold
seaCOAST
"Live FREE or DIE!"
Reply With Quote
  #38  
Old 05-15-2013, 06:46 AM
  seaCOAST's Avatar 
seaCOAST seaCOAST is offline
 

X-Adept
  
Join Date: Oct 2002
Location: New Hampshire
Posts: 569
 

Default 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.
__________________
Xcart V4.5.5 Gold
seaCOAST
"Live FREE or DIE!"
Reply With Quote
  #39  
Old 08-29-2013, 08:34 AM
  acidon's Avatar 
acidon acidon is offline
 

Senior Member
  
Join Date: Feb 2008
Posts: 139
 

Default 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?
__________________
Version 4.7.6 X-cart Gold
Reply With Quote
  #40  
Old 11-27-2016, 02:01 PM
  acidon's Avatar 
acidon acidon is offline
 

Senior Member
  
Join Date: Feb 2008
Posts: 139
 

Default Re: Order ID Random Incrementation...

Works in 4.7.6
__________________
Version 4.7.6 X-cart Gold
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:42 AM.

   

 
X-Cart forums © 2001-2020