This example shows how to extend the order data stored by Active Commerce.
- Create your own
Orderclass which inheritsActiveCommerce.Orders.Order. - Add new properties to your class as needed -- be sure to declare them as
virtual. - Create an
OrderMapclass which inheritsFluentNHibernate.Mapping.SubclassMapwith yourOrderclass as the generic argument. - In the constructor for your
OrderMap, use Fluent NHibernate mapping syntax to map your new properties. - Create a configuration patch which registers your assembly in the
acConfigurationBuilderpipeline, so that your NHibernate mappings are loaded on startup. - Ensure your database schema has the needed table and fields. In a development environment, you can use
/sitecore/admin/DatabaseUtility.aspxto update or drop/create the schema. For production, either generate the needed update script or use a SQL comparison tool. - Create an
OrderFactoryclass which inheritsActiveCommerce.Orders.OrderFactory. This class is used by Active Commerce to construct new orders. - Override the
CreateOrdermethod and return your new order type. - In a new or existing
ITypeRegistrationclass, register yourOrderFactorywith the container as the implementation of theIOrderFactoryservice.