WC_Product_Data_Store_Interface::find_matching_product_variation()
Find a matching (enabled) variation within a variable product.
Метод класса: WC_Product_Data_Store_Interface{}
Хуков нет.
Возвращает
int
. Matching variation ID or 0.
Использование
$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) (обязательный)
- Variable product object.
- $match_attributes(массив)
- Array of attributes we want to try to match.
По умолчанию: array()
Код WC_Product_Data_Store_Interface::find_matching_product_variation() WC Product Data Store Interface::find matching product variation WC 8.7.0
public function find_matching_product_variation( $product, $match_attributes = array() );