Hosting Ecommerce Tips: How to Change order_id for Invoice Number Opencart

Leave a Comment
First, write the following code to Change order_id for Invoice Number Opencart:

OpenCart Tips: How to Adding the Google Analytics code to OpenCart?

<?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 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>";

?>

 
And now, upload it to your Store FTP and then goto yourstore.com/order

OpenCart Hosting Recommendation

HostForLIFEASP.NET receives Spotlight standing advantage award for providing recommended, cheap and fast ecommerce Hosting including the latest OpenCart. From the leading technology company, Microsoft. All the servers are equipped with the newest Windows Server 2012 R2, SQL Server 2014, ASP.NET 4.5.2, ASP.NET MVC 6.0, Silverlight 5, WebMatrix and Visual Studio Lightswitch. Security and performance are at the core of their OpenCart hosting operations to confirm every website and/or application hosted on their servers is highly secured and performs at optimum level. mutually of the European ASP.NET hosting suppliers, HostForLIFE guarantees 99.9% uptime and fast loading speed. From €3.00/month , HostForLIFE provides you with unlimited disk space, unlimited domains, unlimited bandwidth,etc, for your website hosting needs.
Next PostNewer Post Previous PostOlder Post Home

0 comments:

Post a Comment