# Pipelines

# What are the available pipelines?

<table border="1" id="bkmrk-pipeline-description" style="border-collapse: collapse; width: 100%; height: 1320.85px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Pipeline**  
</td><td style="height: 29.7969px;">**Description**  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Store\Pipelines\ContentForBody`</td><td style="height: 29.7969px;">Builds content string to be injected into the body of all pages.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Store\Pipelines\ContentForHead`</td><td style="height: 29.7969px;">Builds content string to be injected into the head of all pages.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Store\Pipelines\RobotsTxt`</td><td style="height: 29.7969px;">Used to defined/generate a robots.txt file.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`\Aero\Store\Pipelines\CartItemBuilder`</td><td style="height: 46.5938px;">Run whenever a cart item is added to the cart in order to build the item from the request data.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Cart\Pipelines\OrderItemBuilder`</td><td style="height: 29.7969px;">Run whenever a cart item is transformed into an order item.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`\Aero\Subscription\Pipelines\SubscriptionOrderBuilder`</td><td style="height: 46.5938px;">Run when a subscription is processed and requires a new order to be created.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Admin\Pipelines\ListingRulesContextBuilder`  
</td><td style="height: 29.7969px;">Builds listing rule context for each rule type.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Admin\Pipelines\ListingRulesDataFormatter`</td><td style="height: 29.7969px;">Formats listing rules for admin UI.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Admin\Pipelines\PreviewMailAction`  
</td><td style="height: 29.7969px;">Builds a temporary mail action to be previewed.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`\Aero\Admin\Reports\Pipelines\BuyXDiscountTierReportQuery`</td><td style="height: 46.5938px;">Builds the query for the buy x discount tier report.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Admin\Reports\Pipelines\DiscountCodesReportQuery`</td><td style="height: 29.7969px;">Builds the query for the discount codes report.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Admin\Reports\Pipelines\OrderBreakdownReportQuery`</td><td style="height: 29.7969px;">Builds the query for the order breakdown report.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Admin\Reports\Pipelines\OrderSurchargeReportQuery`</td><td style="height: 29.7969px;">Builds the query for the order surcharge report.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`\Aero\Admin\Reports\Pipelines\ProductStockLevelReportQuery`</td><td style="height: 46.5938px;">Builds the query for the product stock level report.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Admin\Reports\Pipelines\RefundReportQuery`</td><td style="height: 29.7969px;">Builds the query for the refund report.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Admin\Reports\Pipelines\SalesReportQuery`</td><td style="height: 29.7969px;">Builds the query for the sales report.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Admin\Reports\Pipelines\VoucherReportQuery`</td><td style="height: 29.7969px;">Builds the query for the voucher report.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`Aero\Admin\Configuration\Groups\PaymentAndShippingConfigurationGroup`</td><td style="height: 46.5938px;">Builds the payment and shipping configuration group.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`Aero\Admin\Configuration\Groups\OrderManagementConfigurationGroup`</td><td style="height: 46.5938px;">Builds the order management configuration group.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`Aero\Admin\Configuration\Groups\LocalizationConfigurationGroup`</td><td style="height: 46.5938px;">Builds the localization configuration group.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`Aero\Admin\Configuration\Groups\ProductManagementConfigurationGroup`</td><td style="height: 46.5938px;">Builds the product management configuration group.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`Aero\Admin\Configuration\Groups\NotificationsConfigurationGroup`</td><td style="height: 46.5938px;">Builds the notifications configuration group.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`Aero\Admin\Configuration\Groups\TaxConfigurationGroup`</td><td style="height: 29.7969px;">Builds the tax configuration group.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`Aero\Admin\Configuration\Groups\SystemConfigurationGroup`</td><td style="height: 46.5938px;">Builds the system configuration group.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`Aero\Admin\Configuration\Groups\UserManagementConfigurationGroup`</td><td style="height: 46.5938px;">Builds the user management configuration group.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`Aero\Admin\Configuration\Groups\MaintenanceConfigurationGroup`</td><td style="height: 46.5938px;">Builds the maintenance configuration group.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`Aero\DataPort\Commands\Pipelines\ImportBlockCSVPipeline`</td><td style="height: 29.7969px;">Creates a block from CSV data.</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`Aero\DataPort\Commands\Pipelines\ImportProductCSVPipeline`</td><td style="height: 46.5938px;">Creates a product from CSV data.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`\Aero\Store\Pipelines\ListingsPageQuery`</td><td style="height: 29.7969px;">Builds the query for the listings page.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`Aero\Search\Elastic\Pipelines\ProductAttributes`</td><td style="height: 29.7969px;">Builds the attributes for the ES Product model</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`Aero\Search\Elastic\Pipelines\ListingAttributes`</td><td style="height: 29.7969px;">Builds the attributes for the ES Listing model</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`Aero\Search\Elastic\Pipelines\ListingCategory`</td><td style="height: 29.7969px;">Builds listing documents `categories` data.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`Aero\Search\Elastic\Pipelines\ListingCategoryFacet`</td><td style="height: 29.7969px;">Builds listing documents category string facet data.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`Aero\Search\Elastic\Pipelines\ListingManufacturerFacet`</td><td style="height: 29.7969px;">Builds listing documents manufacturer string facet data.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`Aero\Search\Elastic\Pipelines\ListingTagFacet`</td><td style="height: 29.7969px;">Builds listing documents tag string facet data.</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`Aero\Search\Elastic\Pipelines\Mapping`</td><td style="height: 29.7969px;">Used to build the ES Mapping for search documents.</td></tr></tbody></table>

# How do I extend pipelines?

The payload data can be altered using the `extend()` method. This is typically done from within a Service Provider:

- If the code is unique to a particular store it could be placed in the `boot()` method of the `AppServiceProvider`.
- If it is to be included as part of a module, then it can be added to the setup method of the module's Service Provider.

For example, if a module needs to add an option to items to flag them as requiring gift wrap, the `CartItemBuilder` pipeline class should be extended in the module's ServiceProvider as shown below:

```php
<?php

namespace Aerocargo\Acme;

use Aero\Cart\CartItemOption;
use Aero\Common\Providers\ModuleServiceProvider;
use Aero\Store\Pipelines\CartItemBuilder;

class ServiceProvider extends ModuleServiceProvider
{
    public function setup() 
    {
        CartItemBuilder::extend(function ($item) {
            if (request()->has('gift_wrap')) {
                $option = CartItemOption::create('Gift wrap');

                $item->addOption($option);
            }
        });
    }
}
```