Displaying custom fields in the "Orders" tab

   —   
This article describes how to display other than the standard columns in the Orders tab in CMS Desk -> Tools -> E-Commerce -> Orders
You can use the "OrderCustomData" field for some custom order data. Every order is created in the file ~\CMSModules\Ecommerce\Controls\ShoppingCart\ShoppingCartPreview.ascx.cs in the method ProcessStep(). Here you can populate the mentioned column.
For displaying the values in the location "CMS Desk -> Tools -> E-Commerce -> Orders" you have to alter the file ~\CMSModules\Ecommerce\Tools\Orders\OrderList.ascx.cs around line 186:
gridElem.DataSource = OrderInfoProvider.GetOrderList(where, "OrderDate DESC", "OrderID,OrderDate,CustomerFirstName,CustomerLastName,CustomerCompany,
CustomerEmail,CurrencyFormatString,OrderTotalPrice,StatusDisplayName,StatusColor,OrderCustomData"
);


"OrderCustomData" is the name of the column from the table CMS_Order located in the Kentico database. You need also to alter the file ~\CMSModules\Ecommerce\Tools\Orders\Order_List.xml and add a column to display the CustomData:

...

    <columnsource="OrderCustomData"caption="unigrid.order.columns.customdata"wrap="false">
    </column>
...

You may also create a custom name for this data for the unigrid table in the file ~\CMSResources\CMS_Install.resx. E.g.:
 
 <data name="unigrid.order.columns.customdata" xml:space="preserve">
    <value>Order Custom data</value>
  </data>


See also:

Applies to: Kentico CMS 4.1
Share this article on   LinkedIn

Juraj Ondrus

Hi, I am the Technical support leader at Kentico. I'm here to help you use Kentico and get as much as possible out of it.