WC_Product_Data_Store_Interface::find_matching_product_variation()publicWC 1.0

Find a matching (enabled) variation within a variable product.

Method of the class: WC_Product_Data_Store_Interface{}

No Hooks.

Return

Int. Matching variation ID or 0.

Usage

$WC_Product_Data_Store_Interface = new WC_Product_Data_Store_Interface();
$WC_Product_Data_Store_Interface->find_matching_product_variation( $product, $match_attributes );
$product(WC_Product) (required)
Variable product object.
$match_attributes(array)
Array of attributes we want to try to match.
Default: array()

WC_Product_Data_Store_Interface::find_matching_product_variation() code WC 8.9.0

public function find_matching_product_variation( $product, $match_attributes = array() );