uCommerce includes full API reference documentation and lots of helpful articles to help you build your e-commerce site as effortlessly as possible.
One of the things you will need when building complex sites with uCommerce is the pipeline system.
A pipeline is a series of tasks, which execute in a sequental order. You can use these tasks to execute whatever business logic you want, when working with baskets, orders, or any object.
A pipeline consists of three things:
The configuration file contains the type of the pipeline, each registered pipeline task and the order of which the tasks will be executed.
The default pipelines files are located in the uCommerce/Pipelines folder. As you can see uCommerce comes with a few pipelines out-of-the-box. Take a look at Baskets.Basket.config or Baskets.Checkout.config to see how they are configured.
To make uCommerce pick up on the pipeline it is included in Components.config, the global registration file for all major config files.
Custom pipelines and overrides to existing ones should be added to
uCommerce/Apps/MyApp/Pipelines and will automatically be picked up. See how to create a pipeline task for more details on creating and overriding pipelines.
The first component section contains the type of the pipeline, which is a generic type. As mentioned earlier, only baskets and orders are currently supported, which means that the generic type should be UCommerce.EntitiesV2.PurchaseOrder (which also applies to baskets).
The pipeline type used in the basket pipeline is UCommerce.Pipelines.Basket.BasketPipeline. If you want to implement your own pipeline, you can use the generic type UCommerce.Pipelines.Generic.PurchaseOrderPipeline defined in the UCommerce.Pipelines assembly.
After the pipeline type, each pipeline step is defined, each in its own component section with an id. The id is then used in the
Note: The order of which each task is registered in the
The basket pipeline is a built-in pipeline used by the uCommerce runtime. The pipeline will make sure that all e.g. all totals are recalculated. Please do not delete it, but feel free to add your own tasks, if there’s anything you need on recalculating the basket.
Customization of order statuses is the topic for an upcoming post, but you should know that you can execute pipelines after order status changes. Order statuses are configured in the uCommerce_OrderStatus table. To run a pipeline when an order has been set to a given status, simply but your pipeline name in the “Pipeline” column. If you e.g. want to capture an online payment, this would be a great place to do it.
For how to write a custom pipeline task from scratch, how to create a pipeline task.