ClassesBigCommerceImportImportersProductsProduct Creator

Product_Creator

Handles the creation and saving of BigCommerce products into WordPress.

Methods

do_import

Executes the import process for a product.

public do_import(): mixed

Return Value:

The result of the parent import process.


get_post_array

Retrieves the array of post data to be saved in the WordPress database.

protected get_post_array(\BigCommerce\Import\Importers\Products\Product_Builder $builder): array

Adds a default comment status if it is not already set.

Parameters:

ParameterTypeDescription
$builder\BigCommerce\Import\Importers\Products\Product_BuilderThe product builder instance containing the product data.

Return Value:

The post data array.


send_notifications

Sends notifications after a product has been created via the import process.

protected send_notifications(): void

Triggers a custom action hook for other processes to react to the product creation event.


Inherited methods

__construct

Product_Saver 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, int $post_id): mixed

Parameters:

ParameterTypeDescription
$product\BigCommerce\Api\v3\Model\ProductProduct data from the BigCommerce API.
$listing\BigCommerce\Api\v3\Model\ListingListing data from the BigCommerce Channel API.
$channel_term\WP_TermThe WordPress term representing the channel.
$catalog\BigCommerce\Api\v3\Api\CatalogApiInstance of the BigCommerce Catalog API.
$post_idintThe WordPress post ID for the imported product.

do_import

Imports the product into WordPress by saving the product data, terms, post meta, and images. Also sends notifications once the import is complete.

public do_import(): int

Return Value:

The post ID of the imported product.


save_wp_post

Saves the WordPress post data for the imported product.

protected save_wp_post(\BigCommerce\Import\Importers\Products\Product_Builder $builder): void

Parameters:

ParameterTypeDescription
$builder\BigCommerce\Import\Importers\Products\Product_BuilderThe product builder instance used to create post data.

get_post_array

Builds and retrieves the post data array for the product.

protected get_post_array(\BigCommerce\Import\Importers\Products\Product_Builder $builder): array

Parameters:

ParameterTypeDescription
$builder\BigCommerce\Import\Importers\Products\Product_BuilderThe product builder instance used to create post data.

Return Value:

The post array to be saved in WordPress.


save_wp_postmeta

Saves the product post meta data.

protected save_wp_postmeta(\BigCommerce\Import\Importers\Products\Product_Builder $builder): void

Parameters:

ParameterTypeDescription
$builder\BigCommerce\Import\Importers\Products\Product_BuilderThe product builder instance used to create post meta.

save_modifiers

Saves product modifier information to the WordPress post.

protected save_modifiers(\BigCommerce\Post_Types\Product\Product $product): void

Parameters:

ParameterTypeDescription
$product\BigCommerce\Post_Types\Product\ProductThe product instance.

save_options

Saves product option information to the WordPress post.

protected save_options(\BigCommerce\Post_Types\Product\Product $product): void

Parameters:

ParameterTypeDescription
$product\BigCommerce\Post_Types\Product\ProductThe product instance.

save_custom_fields

Saves custom fields for the product to the WordPress post.

protected save_custom_fields(\BigCommerce\Post_Types\Product\Product $product): void

Parameters:

ParameterTypeDescription
$product\BigCommerce\Post_Types\Product\ProductThe product instance.

save_terms

Saves taxonomy terms associated with the product to WordPress.

protected save_terms(\BigCommerce\Import\Importers\Products\Product_Builder $builder): void

Parameters:

ParameterTypeDescription
$builder\BigCommerce\Import\Importers\Products\Product_BuilderThe product builder instance used to create terms.

save_images

Saves feature image and gallery images for the product.

protected save_images(\BigCommerce\Import\Importers\Products\Product_Builder $builder): void

Parameters:

ParameterTypeDescription
$builder\BigCommerce\Import\Importers\Products\Product_BuilderThe product builder instance used to create images.

send_notifications

Sends notifications after the product import has been completed.

protected send_notifications(): void


Automatically generated on 2025-01-21