Skip to content

Instantly share code, notes, and snippets.

@ibrahim-kardi
Created November 16, 2021 08:07
Show Gist options
  • Save ibrahim-kardi/6cedf9b8cd9ef353824258bed320e7f6 to your computer and use it in GitHub Desktop.
Save ibrahim-kardi/6cedf9b8cd9ef353824258bed320e7f6 to your computer and use it in GitHub Desktop.
defult archive price not showing
<?php
//file path -> plugins/tutor/templates/loop/course-price-woocommerce.php
/**
* Course loop price
*
* @since v.1.0.0
* @author themeum
* @url https://themeum.com
*
* @package TutorLMS/Templates
* @version 1.4.3
*/
?>
<div class="tutor-course-loop-price">
<?php
$course_id = get_the_ID();
$is_public = get_post_meta( $course_id, '_tutor_is_public_course', true )=='yes';
$enroll_btn = '<div class="list-item-button">' . apply_filters( 'tutor_course_restrict_new_entry', '<a href="'. get_the_permalink(). '" class="tutor-btn tutor-btn-icon- tutor-btn-disable-outline tutor-btn-md tutor-btn-full">' . __('Enroll Course', 'tutor') . '</a>' ) . '</div>';
$free_html = $enroll_btn;
if (tutor_utils()->is_course_purchasable()) {
$enroll_btn = tutor_course_loop_add_to_cart(false);
$product_id = tutor_utils()->get_course_product_id($course_id);
$product = wc_get_product( $product_id );
if ( $product ) {
$price_html = '<div class="price"> '.$product->get_price_html() . apply_filters( 'tutor_course_restrict_new_entry', $enroll_btn ) . ' </div>';
}
echo $price_html;
}else{
echo wp_kses_post($free_html);
}
?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment