WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Utilities

CartController::get_variation_id() protected WC 1.0

For a given product, get the variation ID.

{} It's a method of the class: CartController{}

No Hooks.

Return

Int.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_variation_id( $product );
$product(WC_Product) (required)
Product object associated with the cart item.

Code of CartController::get_variation_id() WC 5.8.0

protected function get_variation_id( \WC_Product $product ) {
	return $product->is_type( 'variation' ) ? $product->get_id() : 0;
}