WC_Product_Data_Store_Interface::find_matching_product_variation()
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() WC Product Data Store Interface::find matching product variation code WC 9.8.2
public function find_matching_product_variation( $product, $match_attributes = array() );