ClassesBigCommerceImportImportersProductsProduct Strategy Factory

Product_Strategy_Factory

Factory class for determining the appropriate import strategy for a product.

This class decides whether to create, ignore, or update a product based on its existence and freshness.

  • Full name: \BigCommerce\Import\Importers\Products\Product_Strategy_Factory

Methods

__construct

Product_Strategy_Factory constructor.

public __construct(\BigCommerce\Api\v3\Model\Product $product, \BigCommerce\Api\v3\Model\Listing $listing, \WP_Term $channel_term, \BigCommerce\Api\v3\Api\CatalogApi $catalog, string $version): mixed

Parameters:

ParameterTypeDescription
$product\BigCommerce\Api\v3\Model\ProductThe product data from BigCommerce API
$listing\BigCommerce\Api\v3\Model\ListingThe channel listing data from BigCommerce API
$channel_term\WP_TermThe channel term for the product import
$catalog\BigCommerce\Api\v3\Api\CatalogApiThe Catalog API instance
$versionstringThe version of the importer

get_strategy

Returns the appropriate import strategy based on the product and channel data.

public get_strategy(): \BigCommerce\Import\Import_Strategy

Return Value:

The import strategy (either Product_Creator, Product_Ignorer, or Product_Updater)



Automatically generated on 2025-01-21