Skip to content

Sales Channel Helpers

This helper provides utility methods to work with sales channels.

getStorefrontSalesChannel

The getStorefrontSalesChannel method returns the first sales channel of type Storefront, or null if it does not exist.

php
<?php

class MyFixture extends Fixture {
    public function load(): void {
        $salesChannel = $this->helper->SalesChannel()->getStorefrontSalesChannel(); 
    }
}

getHeadlessSalesChannel

The getHeadlessSalesChannel method returns the first sales channel of type Headless, or null if it does not exist.

php
<?php

class MyFixture extends Fixture {
    public function load(): void {
        $salesChannel = $this->helper->SalesChannel()->getHeadlessSalesChannel(); 
    }
}

getProductComparisonSalesChannel

The getProductComparisonSalesChannel method returns the first sales channel of type Product Comparison (in the admin it is called Product Feed), or null if it does not exist.

php
<?php

class MyFixture extends Fixture {
    public function load(): void {
        $salesChannel = $this->helper->SalesChannel()->getProductComparisonSalesChannel(); 
    }
}

getSalesChannelByType

The getSalesChannelByType method takes a type parameter and returns the first sales channel of that specific type, or null if it does not exist.

php
<?php

class MyFixture extends Fixture {
    public function load(): void {
        $salesChannel = $this->helper->SalesChannel()->getSalesChannelByType( 
            Defaults::SALES_CHANNEL_TYPE_PRODUCT_COMPARISON
        ); 
    }
}

Released under the MIT License.