News:

Looking for documentation? Take a look on our wiki

Main Menu

Front end updating order status

Started by mudd123, November 10, 2012, 18:18:10 PM

Previous topic - Next topic

mudd123

Hi guys,

I jus learn the basics of php coding and basically im trying to do a front end updating the order like in the back end admin when changing the order.
Something like this. img1.JPG.

But when i try to update the pending status to shipped. It didnt really do update though the word 'P' change to 'C'.

This is the code when updating it from 'P' to 'C'.




{source}
<!-- You can place html anywhere within the source tags -->


<script language="javascript" type="text/javascript">
// You can place JavaScript like this

</script>
<?php
$orderid = $_POST['virtuemart_order_id'];

$host = "localhost";
$user = "XXXXXXX";
$pass = "XXXXXXXX";
$db = "XXXXXX";

// open connection
$link = mysqli_connect($host, $user, $pass, $db);



// build SQL statement
$query = "update ruj3d_virtuemart_order_items set order_status= 'C' WHERE virtuemart_order_id = '$orderid'";

// execute SQL statement
$status = mysqli_query($link, $query) or die(mysqli_error($link));





if ($status) {

echo "<big>It has been confirmed !!. </big>";
} else {
echo "<br>Has not been successfully  confirmed</br>";
}




?>
{/source}


Is it the wrong table im updating?

[attachment cleanup by admin]