Automattic\WooCommerce\Blocks\StoreApi\Utilities
CartController::get_variation_id() protected WC 1.0
For a given product, get the variation ID.
{} Это метод класса: CartController{}
Хуков нет.
Возвращает
Число
. Null. Ничего.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_variation_id( \WC_Product $product );
- \WC_Product $product (обязательный)
- -
Код CartController::get_variation_id() CartController::get variation id WC 5.1.0
protected function get_variation_id( \WC_Product $product ) {
return $product->is_type( 'variation' ) ? $product->get_id() : 0;
}