Skip to content

Commit

Permalink
= 4.2.6.9.3 =
Browse files Browse the repository at this point in the history
~ Hide price course when enable no enroll requirement.
  • Loading branch information
tungnxt89 committed Jul 31, 2024
1 parent d6e4e62 commit 52bd598
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions inc/Models/CoursePostModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ public function get_price_html(): string {

$price_html .= sprintf( '<span class="free">%s</span>', esc_html__( 'Free', 'learnpress' ) );
$price_html = apply_filters( 'learn_press_course_price_html_free', $price_html, $this );
} elseif ( $this->get_meta_value_by_key( self::META_KEY_NO_REQUIRED_ENROLL, 'no' ) === 'yes' ) {
$price_html .= '';
} else {
if ( $this->has_sale_price() ) {
$price_html .= sprintf( '<span class="origin-price">%s</span>', $this->get_regular_price_html() );
Expand Down
2 changes: 2 additions & 0 deletions inc/course/abstract-course.php
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,8 @@ public function get_course_price_html(): string {

$price_html .= sprintf( '<span class="free">%s</span>', esc_html__( 'Free', 'learnpress' ) );
$price_html = apply_filters( 'learn_press_course_price_html_free', $price_html, $this );
} elseif ( $this->get_data( 'no_required_enroll', 'no' ) === 'yes' ) {
$price_html .= '';
} else {
if ( $this->has_sale_price() ) {
$price_html .= sprintf( '<span class="origin-price">%s</span>', $this->get_regular_price_html() );
Expand Down

0 comments on commit 52bd598

Please sign in to comment.