WC_Abstract_Legacy_Product::get_matching_variation()publicWC 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.

Method of the class: WC_Abstract_Legacy_Product{}

No Hooks.

Return

null. Nothing (null).

Usage

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

Changelog

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

WC_Abstract_Legacy_Product::get_matching_variation() code WC 8.6.1

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 );
}