Guest marline Posted January 8, 2011 Share Posted January 8, 2011 Does anybody know's how the cart_order_id in the CubeCart_order_sum table is generated? And/or how i can generate it myself? Quote Link to comment Share on other sites More sharing options...
vokf Posted January 8, 2011 Share Posted January 8, 2011 Does anybody know's how the cart_order_id in the CubeCart_order_sum table is generated? And/or how i can generate it myself? The code for this is in; /admin/sources/products/index.inc.php (around line 204) ## Generate product code if (empty($_POST['productCode'])) { $chars = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N", "O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3", "4","5","6","7","8","9","0"); $max_chars = count($chars) - 1; srand((double)microtime()*1000000); for ($i = 0; $i < 5; $i++) { $randChars = ($i == 0) ? $chars[rand(0, $max_chars)] : $randnum . $chars[rand(0, $max_chars)]; } $record["productCode"] = $db->mySQLSafe(strtoupper(substr($_POST['name'],0,3)).$randChars.$_POST['cat_id']); } else { $record["productCode"] = $db->mySQLSafe($_POST['productCode']); } $record["productCode"] = preg_replace("/[^a-z0-9-]/i","",$record["productCode"]); Hope this helps! Jason Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 9, 2011 Share Posted January 9, 2011 Does anybody know's how the cart_order_id in the CubeCart_order_sum table is generated? And/or how i can generate it myself? In the CC version 3 file \includes\content\gateway.inc.php at around line 61, we find the Cart Order Id is the: two-digit year, two-digit month, two-digit day, a dash, two-digit hour, two-digit minute, two-digit second, a dash, a random four-digit number between 1000 and 9999. You can generate anything you want as no other feature or function of CC3 is based on any calculation performed on the Cart Order Id code (except list sorting). On line 92, the cart_order_id is saved with every product sold (order_inv table), and in line 156, the cart_order_id is saved with the order summary (order_sum table). The cart_order_id is also saved with the downloadable digital file database records. Quote Link to comment Share on other sites More sharing options...
Guest marline Posted January 9, 2011 Share Posted January 9, 2011 Does anybody know's how the cart_order_id in the CubeCart_order_sum table is generated? And/or how i can generate it myself? In the CC version 3 file \includes\content\gateway.inc.php at around line 61, we find the Cart Order Id is the: two-digit year, two-digit month, two-digit day, a dash, two-digit hour, two-digit minute, two-digit second, a dash, a random four-digit number between 1000 and 9999. You can generate anything you want as no other feature or function of CC3 is based on any calculation performed on the Cart Order Id code (except list sorting). On line 92, the cart_order_id is saved with every product sold (order_inv table), and in line 156, the cart_order_id is saved with the order summary (order_sum table). The cart_order_id is also saved with the downloadable digital file database records. Thanks, will give it a try! Does anybody know's how the cart_order_id in the CubeCart_order_sum table is generated? And/or how i can generate it myself? The code for this is in; /admin/sources/products/index.inc.php (around line 204) ## Generate product code if (empty($_POST['productCode'])) { $chars = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N", "O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3", "4","5","6","7","8","9","0"); $max_chars = count($chars) - 1; srand((double)microtime()*1000000); for ($i = 0; $i < 5; $i++) { $randChars = ($i == 0) ? $chars[rand(0, $max_chars)] : $randnum . $chars[rand(0, $max_chars)]; } $record["productCode"] = $db->mySQLSafe(strtoupper(substr($_POST['name'],0,3)).$randChars.$_POST['cat_id']); } else { $record["productCode"] = $db->mySQLSafe($_POST['productCode']); } $record["productCode"] = preg_replace("/[^a-z0-9-]/i","",$record["productCode"]); Hope this helps! Jason Thanks Jason, will have a look! Quote Link to comment Share on other sites More sharing options...
vokf Posted January 9, 2011 Share Posted January 9, 2011 Thanks Jason, will have a look! Sorry -again, my mistake... My code snipped is the PRODUCT CODE. My excuse, I'd had a long day, a Party to DJ and was feeling ill (and still are!). Brians post is correct. Jason Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.