WordPress at a glance
function is not described

WC_Abstract_Legacy_Product::get_matching_variation() public WC 1.0

Deprecated from version 3.0.0 in favour of Product data store's find_matching_product_variation.. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Match a variation to a given set of attributes using a WP_Query.

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

No Hooks.

Return

Null. Nothing.

Usage

$WC_Abstract_Legacy_Product = new WC_Abstract_Legacy_Product();
$WC_Abstract_Legacy_Product->get_matching_variation( $match_attributes );
$match_attributes(array)
-

Changelog

Deprecated Since 3.0.0 in favour of Product data store's find_matching_product_variation.

Code of WC_Abstract_Legacy_Product::get_matching_variation() WC 5.0.0

<?php
public function get_matching_variation( $match_attributes = array() ) {
	wc_deprecated_function( 'WC_Product::get_matching_variation', '3.0', 'Product data store find_matching_product_variation' );
	$data_store = WC_Data_Store::load( 'product' );
	return $data_store->find_matching_product_variation( $this, $match_attributes );
}