Improve the Order Status Display Grid

by Joe Payne 7. Junie 2008 00:20
Introduction
It's always important as a site admin to know what the customer will be seeing when they visit your site. In this short tutorial, we're going to make it easier for the site admin to work with Order Statuses.

Once you have several order status codes created, it becomes increasingly important to keep track of what each status will display on the customer side of the store. But to do that now, you have to edit each status one-by-one to see what the "Display Name" value is. This quick-and-easy modification adds the Customer-side "Display Name" field to the Configure, Order Status grid. Once completed, the site admin can quickly and easily see what the customer will see for each order status.

This modification assumes AC7 RC3

Easy Fix
This change is very simple. Just edit the ~/Admin/Store/OrderStatuses/Default.aspx file and look for this line of code:
Code:
<asp:BoundField HeaderText="Name" DataField="Name" SortExpression="Name" HeaderStyle-HorizontalAlign="Left" />


and change it to look like this:
Code:
<asp:BoundField HeaderText="Name" DataField="Name" SortExpression="Name" HeaderStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Display Name" DataField="DisplayName" SortExpression="DisplayName" HeaderStyle-HorizontalAlign="Center" />


Done!

How it Works
The Order Statuses page is a very simple page. It uses a .Net datasource control to provide records to a .Net GridView control. All we've done is add another field column that tells the GridView control to also show the "Display Name" field provided by the data source control.

We also made a minor change from "Left" to "Center" on the horizontal alignment of the column headings. This is purely optional.

Conclusion
Any easy change that helps the site admin know what the customer is going to see with each order status.

Tags: ,

Month List