Wednesday, February 26, 2014

change order_id for Invoice number opencart

save the code to magic.php

<?php
include ("config.php");


$link = mysql_connect(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD);
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
else { 
mysql_select_db(DB_DATABASE);
}

$magic_table = DB_PREFIX . "order";

$magic = $_POST['magic'];

if ($magic!==""){
$query="ALTER TABLE `$magic_table` AUTO_INCREMENT = $magic";
mysql_query($query);
}


$query = "SELECT Auto_increment  FROM information_schema.tables  WHERE table_name='$magic_table' AND table_schema = DATABASE()";
$result = mysql_query($query);
$row = mysql_fetch_row($result);
$magic = $row[0];

?>
<html><head><title>HelderIM : OpenCart : (Re)set ordernumber</title></head><body>
<h1>(Re)set Ordernumber (by HelderIM)</h1>
<p>
This tool reads the next ordernumber that will be generated. You can change the ordernumber by entering a new number and press "SET". It does not change ordernumbers already generated.
</p>
<p>
This tool is tested on OpenCart 1.5.2.1 using MySQL.<br>
Delete this tool from your website after usage. It has no protection whatsoever!!!!
</p>

<?php
echo '<form name="EQ" action="magic.php" method="post">';
echo "<input name='magic' type='text' value='". $magic . "'/><br>";
echo "<input type='submit' value='SET'/></form>";
echo "</body></html>";

?>


upload it to your store ftp

then goto

yourstore.com/magic

There you can enter your starting number

No comments:

Post a Comment