You are here: Order System > Extending Order Classes

Extending Order Classes

Overview

The order system contains many classes which can be extended with your own implementation. This means that you can create your own Cart and/or LineItem class implementations to replace the one included in EPiServer Commerce. The order classes that you can do this with are:

How to Configure a MetaClass

Navigate to the Order System/Meta Class node in the Administration section of Commerce Manager.

Select the correct group type from the Element dropdown list.

From the Type list, select the meta class you wish to configure. Notice that the OrderGroup and Payment group types are the only ones that have multiple type options. Here you can edit the meta class definitions by checking the checkboxes associated with the fields you wish to associate with each meta class.

To add meta fields, click on the Order System/Meta Fields node and select New/Meta Field.

Accessing Order Meta Data Programmatically

To access order meta objects, each of the order metaclasses have a dictionary of metafields accessible by the root object. Here are some examples of accessing metafields from different order metafields:

Cart newCart = OrderContext.Current.GetCart("myname", newCustomer);
 
  //Here's the meta field data access
  string myCartField = newCart["myField"].ToString();
  string orderformField = newCart.OrderForms[0]["myOrderFormField"].ToString();
  string paymentField = newCart.OrderForms[0].Payments[0]["myPaymentField"].ToString();
  string shipmentField = newCart.OrderForms[0].Shipments[0]["myShipmentField"].ToString();

 


Version: EPiServer Commerce 1 R2 SP2| Last updated: 2012-06-29 | Copyright © EPiServer AB | Send feedback to us