close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Order Status not changing on Order Results Page

Thread began 2/18/2010 6:28 pm by nenad391153 | Last modified 3/12/2010 7:38 pm by Eric Mittman | 1980 views | 7 replies |

nenad391153

Order Status not changing on Order Results Page

Hello,

2 questions.....

1) How could I set a value for OrderStatus upon completion of order? When someone successfully purchases an item I would like the OrderStatus to populate with pending. Currently it remains null.

2) On our order details page we are able to see each individual order's status. If we change a status of an order through the order update page, it display the appropriate status on the order details page. Exactly what we want. However, the order results page does not show the correct order status within the results table. What do i have to do to show the corresponding order status in the order results page?

Attached is a screen shot of the order results table showing an order status of pending on all orders. This "pending" is being pulled from the top most recent order. If I change Bobby Rohr's order status, it reflects on all of the order within the results table. Again the order details page is correct, this table isn't.

Please let me know what I could try.

Thanks

Sign in to reply to this post

Eric Mittman

You would normally grab the status of the transaction when the transaction occurs, you can then store this status in your db with the order insert.

As for the problem with the order results page showing pending for all even when that is not the case have you confirmed these results in your db table? If you can post back with a copy of this results page it would help to determine what you are seeing here.

Sign in to reply to this post

nenad391153

Hi Eric, thanks for the reply.

Attached is the orders_Results page. Some of the OrderStatus in the Database are confirmed, some are not.

Thank you for your help on this.
Nenad

Attached Files
orders_Results.php.zip
Sign in to reply to this post

Eric Mittman

Ok, I can see why all of the statuses show the same, it is because this value is coming from a different recordset than the other info in the repeat region. The status is coming from rsStatus, the other information is coming from WADAorders. To fix this you will need to use the status binding from this WADAorders recordset instead. Currently the WADAorders recordset does not have this info, so you would need to update it with a join. It might look like this:

php:
$query_WADAorders = "SELECT orders.OrderDate, orders.OrderID, orders.OrderShipName, orders.OrderAmount, orders.OrderStatus orderstatustypes.StatusLabel FROM orders 

JOIN orderstatustypes ON orders.OrderStatus = orderstatustypes.StatusID
ORDER BY OrderDate DESC";



I'm not sure about the id name in your orderstatus table, you may need to update this. Make sure that you make a backup of your page before you attempt making any changes. There is another way you could do this, you could put the code for the rsStatus inside of the repeat region like this:

php:
// repeat region start

<?php
$MMColParam_rsStatus 
"-1";
if (isset(
$row_WADAorders['OrderStatus'])) {
  
$MMColParam_rsStatus = (get_magic_quotes_gpc()) ? $row_WADAorders['OrderStatus'] : addslashes($row_WADAorders['OrderStatus']);
}
mysql_select_db($database_connPMTecommerce$connPMTecommerce);
$query_rsStatus sprintf("SELECT * FROM orderstatustypes WHERE StatusID = %s"GetSQLValueString($MMColParam_rsStatus"text"));
$rsStatus mysql_query($query_rsStatus$connPMTecommerce) or die(mysql_error());
$row_rsStatus mysql_fetch_assoc($rsStatus);
$totalRows_rsStatus mysql_num_rows($rsStatus);
?>
//begin displaying info
Sign in to reply to this post

Nenad

Hi Eric, thanks for the reply.

I have tried your instructions but I cannot get it to work. Could you possibly describe in a little more detail?

Thank you!

Sign in to reply to this post

Eric Mittman

Sure, what have you tried specifically that has not worked? If you post back with the exact steps you have taken, and the result you are currently getting I will try to help you get it straightened out. Also include a copy of the page in it's current form.

Sign in to reply to this post

Nenad

Hi Eric,

I first tried pasting your the join statement in but that didn't do anything. Then I tried placing the second batch in the repeat region and that didn't work.

Any ideas?

Much Appreciated!
Nenad

Sign in to reply to this post

Eric Mittman

What does your currently joined recordset look like? Would it be possible for you to post back with some sample records exported from your db that I can use to craft an example page? This would help me to understand the relationship of your data and how the query would need to be constructed.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...