Automattic\WooCommerce\Internal\CLI\Migrator\Platforms\Shopify
ShopifyMapper::is_variable_product
Checks if a product is a variable product.
Метод класса: ShopifyMapper{}
Хуков нет.
Возвращает
bool. True if the product is a variable product, false otherwise.
Использование
// private - только в коде основоного (родительского) класса $result = $this->is_variable_product( $shopify_product ): bool;
- $shopify_product(объект) (обязательный)
- The Shopify product data.
Код ShopifyMapper::is_variable_product() ShopifyMapper::is variable product WC 11.3.0
private function is_variable_product( object $shopify_product ): bool {
return isset( $shopify_product->variants->edges ) && count( $shopify_product->variants->edges ) > 1;
}