Automattic\WooCommerce\Internal\CLI\Migrator\Platforms\Shopify

ShopifyMapper::get_woo_product_statusprivateWC 1.0

Converts the Shopify product status into WooCommerce product status.

Method of the class: ShopifyMapper{}

No Hooks.

Returns

String. The WooCommerce product status.

Usage

// private - for code of main (parent) class only
$result = $this->get_woo_product_status( $shopify_product ): string;
$shopify_product(object) (required)
The Shopify product data.

ShopifyMapper::get_woo_product_status() code WC 10.8.1

private function get_woo_product_status( object $shopify_product ): string {
	$woo_product_status = 'draft';
	if ( 'ACTIVE' === $shopify_product->status ) {
		$woo_product_status = 'publish';
	}
	return $woo_product_status;
}