Automattic\WooCommerce\Internal\CLI\Migrator\Platforms\Shopify
ShopifyMapper::is_variable_product
Checks if a product is a variable product.
Method of the class: ShopifyMapper{}
No Hooks.
Returns
true|false. True if the product is a variable product, false otherwise.
Usage
// private - for code of main (parent) class only $result = $this->is_variable_product( $shopify_product ): bool;
- $shopify_product(object) (required)
- The Shopify product data.
ShopifyMapper::is_variable_product() ShopifyMapper::is variable product code WC 10.8.1
private function is_variable_product( object $shopify_product ): bool {
return isset( $shopify_product->variants->edges ) && count( $shopify_product->variants->edges ) > 1;
}