Try our conversational search powered by Generative AI!

Loading...
ARCHIVED This content is retired and no longer maintained. See the latest version here.

Recommended reading 

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 extend are:

  • Cart
  • PurchaseOrder
  • PaymentPlan
  • OrderForm
  • Payment
  • Shipment
  • LineItem
  • OrderGroupAddress

Classes referred to here are available in the following namespaces:

How to configure a meta class

  1. Navigate to the Order System/Meta Class node in the Administration section of Commerce Manager.
  2. Select the correct group type from the Element drop-down list.
  3. 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.
  4. To add meta fields, click on the Order System/Meta Fields node and select New/Meta Field.

Accessing order meta data

To access order meta objects, each of the order meta classes have a dictionary of meta fields accessible by the root object.

Example:accessing meta fields from different order meta fields

C#
Cart newCart = OrderContext.Current.GetCart("myname", newCustomer);
          //This is 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();
Do you find this information helpful? Please log in to provide feedback.

Last updated: Oct 21, 2014

Recommended reading