Tuesday, September 20, 2011

Customize EPi Commerce Order listing

In a current project using EPi Commerce we ran into an issue in Commerce Admin. It was very hard to get a good overview of placed orders. This due to the ID column in commerce manager displaying OrderGroupId instead of the generated TrackingNumber communicated to the customers.

This is updated with EPi Commerce R2 / EFC 5.2 but we haven't had the possibility to upgrade yet.

View in EPi Commerce / EFC 5.1

5_1

View in EPi Commerce R2 / EFC 5.2

5_2

If a customer contacts the merchant with a query about a specific order, the Order listing in the first release of EPi Commerce / EFC 5.1 don’t display the Order no. given to the customer.

And the search don’t allow search on the property called “TrackingNumber” either. We needed to solve this issue quickly, waiting for all that comes with upgrading to a new version wasn’t an option.

Commerce manager keeps it’s controls and configurations related to the manager UI in a folder located by default in:

C:\Program Files (x86)\Mediachase\eCommerceFramework\5.1\[YourSiteName]

Configuration for the Order lists are kept in the following file.

C:\Program Files (x86)\Mediachase\eCommerceFramework\5.1\[YourSiteName]\Shared\Apps\Order\Order.config

In this file you can add columns you wish to list, as long as they are on the PurchaseOrder Object.

The view tag in the config file contains the columns listed in the view

   89:  <View id="Orders-List" … > 

To add a new column just insert. The line below adds a new column displaying Order Creation date. (Property “Created”)

<Column Width="200" AllowSorting="true" DataField="Created" HeadingText="Order Created"></Column>

The Order Id is displayed using a link template control which is located in

C:\Program Files (x86)\Mediachase\eCommerceFramework\5.1\AvalancheCMS\Shared\Apps\Order\GridTemplates\OrderLinkTemplate.ascx

To stop using the internal object Id of the order and instead display the generated order number for the purchase order we just need to update the following in the OrderLinkTemplate.ascx:

From:

   6:      Text='<%# EcfListView.GetDataCellValue(DataBinder.Eval(DataBinder.GetDataItem(Container),"OrderGroupId")) %>'>

To:

   6:  Text='<%# GetViewName().Equals("PurchaseOrder") ? EcfListView.GetDataCellValue(DataBinder.Eval(DataBinder.GetDataItem(Container),"TrackingNumber")) : EcfListView.GetDataCellValue(DataBinder.Eval(DataBinder.GetDataItem(Container),"OrderGroupId")) %>'>

Adding the Creation date and modifying the LinkTemplate to show TrackingNumber instead of OrderGroupId will make the listing look like this:

5_1_mod



So if you are not running your site on EPi Commerce R2 yet this might ease the process of identifying orders in Commerce Manager until you upgrade.