ClassesBigCommerceImportProcessorsChannel Initializer

Channel_Initializer

Initializes a channel by linking it to the full product catalog.

This process involves checking for existing products, skipping already linked products, retrieving product listings, and adding new products to the channel. The class also manages pagination for large product catalogs, ensuring that products are processed in batches based on the set limit.

Constants

ConstantVisibilityTypeValue
STATE_OPTIONpublicstring’bigcommerce_import_channel_init_state’

Methods

__construct

Channel_Initializer constructor.

public __construct(\BigCommerce\Api\v3\Api\ChannelsApi $channels, \BigCommerce\Api\v3\Api\CatalogApi $catalog, \WP_Term $channel_term, int $limit = 100): mixed

Initializes the Channel_Initializer class with the given parameters.

Parameters:

ParameterTypeDescription
$channels\BigCommerce\Api\v3\Api\ChannelsApiThe API object for managing channels.
$catalog\BigCommerce\Api\v3\Api\CatalogApiThe API object for managing the product catalog.
$channel_term\WP_TermThe WordPress term representing the channel.
$limitintThe number of products to process per request (default 100).

run

Executes the channel initialization process.

public run(): mixed

This includes retrieving products, checking their status, and adding them to the channel. Handles pagination for large product catalogs.


Inherited methods

get_option

protected get_option(string $option, bool $default = false): mixed

Parameters:

ParameterTypeDescription
$optionstring
$defaultbool

update_option

protected update_option(string $option, mixed $value, bool $autoload = false): bool

Parameters:

ParameterTypeDescription
$optionstring
$valuemixed
$autoloadbool

add_option

protected add_option(string $option, mixed $value, bool $autoload = false): bool

Parameters:

ParameterTypeDescription
$optionstring
$valuemixed
$autoloadbool

delete_option

protected delete_option(string $option): bool

Parameters:

ParameterTypeDescription
$optionstring


Automatically generated on 2025-01-21