Get reviews of course

Home Forums Legacy Support Support queries How-to & Troubleshooting Get reviews of course

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #202957
    gsjaak
    Spectator
    Hi, Is there a way to query the reviews that are given on courses? It would be so nice if we could make a carousel out of these reviews or in some way to get the reviews of all courses to be shown else where in the site. Maybe even store reviews as testimonials, or something. This would be great! Any idea how to make this possible? Kind regards
    #203076
    logan
    Member
    Hello, This was a custom feature request but you are our valuable customer, and we have written it for you. Please add this code in your wplms-customizer.php file in wplms customizer plugin :

    add_shortcode('course_review',function ($atts,$content=null){

      $comments = get_comments( array( 'post_id' => $atts['course']) );

      if(!empty($comments)){

        

        $return .=  '<ul class="course_reviews_list">';

        foreach ( $comments as $comment ) :

          $comment_title = get_comment_meta($comment->comment_ID,'review_title',true);

          $comment_rating = get_comment_meta($comment->comment_ID,'review_rating',true);

            $comment_content = $comment->comment_content;

            $return .=  '<li>

            <span class="bp_core_get_userlink avatar">'.bp_core_fetch_avatar ( array( 'item_id' => $comment->user_id, 'type' => 'thumb' ) ).'</span>

            <span class="comment_title">'.$comment_title.'</span>

            <span class="comment_rating">'.bp_course_display_rating($comment_rating).'</span>

            <span class="comment_content">'.$comment_content.'</span>

            <span class="bp_core_get_userlink">'.bp_core_get_userlink($comment->user_id).'</span>

            </li>';

          endforeach;

          $return .=  '</ul>';

          $return .=  '<style>

          ul.course_reviews_list li{

              width:300px;

             

              display:grid;

              grid-template-columns:50px 1fr;

              grid-template-rows:1fr 1fr 1fr 1fr;

              grid-gap:5px;

          }

          ul.course_reviews_list li .bp_core_get_userlink.avatar{grid-row: 1/-1;}

          ul.course_reviews_list li .bp_core_get_userlink img{

              width:48px;

              height:48px;

              border-radius:50%;

              grid-template-column:1/-1;

          }

          </style><script type="text/javascript" charset="utf-8">

            $(window).load(function() {

              $(".course_reviews_list").flexslider();

            });

          </script>';

      }

      return $return;

     

    });

    Refer: http://prntscr.com/n6wg56 http://prntscr.com/n6wglv G'day.
    #203731
    gsjaak
    Spectator
    Amazing thank you very much! Have a great day :)!
    #203817
    logan
    Member
    Dear Friend, That’s great! Glad you’re enjoying the theme – thanks for using it! 🙂 If I can be of assistance, please do not hesitate to contact me again. Closing this topic. Best regards:)
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Get reviews of course’ is closed to new replies.