WooCommerce::filter_course_price( float $price, DozentCourse $course )

Filter course price and return price from the attached WC Product Price


Description

See also


Parameters

$price

(float) (Required) course price

$course

(DozentCourse) (Required) Course Object


Return

(mixed)


Source

File: classes/WooCommerce.php

	public function filter_course_price( $price, $course ) {
		$course = dozent_get_course( $course );

		if ( $course->is_closed() ) {
			$course_id = $course->get_id();

			$product_id = dozent_get_attached_product_id_by_course( $course_id );

			$product = wc_get_product( $product_id );

			if ( $product ) {
				$price = $product->get_price_html();
			}
		}

		return $price;
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.