';
// 1) WooCommerce mini cart (if active)
if ( $is_wc_active ) {
// This will echo standard woo mini cart html
woocommerce_mini_cart();
}
// 2) Tutor LMS native cart items (if any)
if ( $is_tutor_active && ! empty( $tutor_items ) ) {
echo '
'; // .widget_shopping_cart_content
echo '';
foreach ( $tutor_items as $course ) {
// $course is object with ->ID and ->post_title (as earlier in your code)
$course_id = isset( $course->ID ) ? $course->ID : 0;
$course_title = isset( $course->post_title ) ? $course->post_title : '';
$thumb = get_tutor_course_thumbnail_src( '', $course_id );
$price_obj = tutor_utils()->get_raw_course_price( $course_id );
$reg = isset( $price_obj->regular_price ) ? $price_obj->regular_price : 0;
$sale = isset( $price_obj->sale_price ) ? $price_obj->sale_price : 0;
$display_price = $sale ? $sale : $reg;
$formatted = function_exists( 'tutor_get_formatted_price' ) ? tutor_get_formatted_price( $display_price ) : $display_price;
echo '
';
}
// if nothing to show
if ( empty( $tutor_items ) && ! $is_wc_active ) {
echo '';
echo '
';
}
echo '';
echo '';
echo '
';
echo '';
echo '
';
echo '';
echo '' . esc_html( $course_title ) . '';
echo '1 × ' . $formatted . '';
echo '
';
echo '×';
echo '';
echo '
';
}
echo '' . esc_html__( 'No items in the cart', 'upstudy' ) . '
'; echo '
';
echo '
';
echo '
';
echo '