Remove the Membership Level from Course and show only Prices from Woocommerce

Home Forums Legacy Support Support queries How-to & Troubleshooting Remove the Membership Level from Course and show only Prices from Woocommerce

Tagged: ,

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #182012
    lightform
    Spectator
    Hello I have found this code  from another post ( Original post here: https://wplms.io/support/forums/topic/show-only-fixed-price/ ) and used it in order to hide from the single course menu the [+] sign and show only the course current price: /////// add_filter('wplms_course_credits_array','show_only_fixed_price');   function show_only_fixed_price(){   if(is_singular('course')){   global $post;   $level = get_post_meta($post->ID,'vibe_pmpro_membership',true);   $course_price = get_post_meta($post->ID,'_sale_price',true);   if(!empty($level)) echo "The Price is:".wc_price($course_price)."";   }   } ////////   The problem is that I am getting a price of 0,00 in all courses ( see screenshot > http://prntscr.com/lbblp6/ ) Is there a change we can make to the code in order to only have the price appear, as well ass the price with the discounts, just like you can see in this screenshot: http://prntscr.com/lbbm4t   ?   So in other words we want to have ONLY the price ( normal price, and discounted price when we have a discount on the product ) in the course page.   Thanks in advance Kind Regards Stratos A.
    #182154
    Diana
    Participant
    @lightform You are getting 0.00 in all the courses because your course is private which means that your course is not free but still not even a single woocommerce product is connected with the course. The code will show exactly what you want but fo that your course should be connected with any woocommerce product and it should also be connected with any membership level
    #199074
    lightform
    Spectator
    Hello again. Take a look at the following product.
    • There is a price: http://prntscr.com/msa08f
    • It is connected to a course http://prntscr.com/msa146
    • The course is also connected to a membership level and the product I mentioned above http://prntscr.com/msa29e
    The price though is showing as 0,00 http://prntscr.com/msa2ve Any other suggestions ?   Also the code does not work with the Visual Composer Vibe grid component. ( http://prntscr.com/msa3nd ) Is there a way to update the code to work on grids as well instead of just the single course page? thanks in advance. Kind Regards Stratos A.  
    #199200
    logan
    Member
    Hello, Your course is a private course. Please make sure course is connected to the product and product is also connected to the course & also be connected with any membership level. please check these. if it does not work please share your page url and credentials in a private reply. i will look into this matter.
    #199707
    lightform
    Spectator
    This reply has been marked as private.
    #199935
    logan
    Member
    Hey, Please add this code in your wplms-customizer.php file in wplms customizer plugin : add_filter('wplms_course_credits_array','customwplms_course_credits_array',10,2); function customwplms_course_credits_array($credits,$id){   if ( in_array( 'paid-memberships-pro/paid-memberships-pro.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {      $membership_ids = vibe_sanitize(get_post_meta($id,'vibe_pmpro_membership',false));      $match = array();      if(isset($membership_ids) && is_Array($membership_ids) && count($membership_ids) && function_exists('pmpro_getAllLevels')){         $link=get_option('pmpro_levels_page_id');         $link=get_permalink($link);         foreach($membership_ids as $membership_id){            unset($credits[$link.'#'.$membership_id]);         }        }    }    return $credits; }
    #200554
    lightform
    Spectator
    Hello The code works fine so thanks for that. The problem now is  The following A user with a membership is logged in. The membership gives unlimited access to all courses When the student goes to see the Vibe Grid with the available courses he should see in all courses the "Start Course" text instead of price. Instead of that there is a confusing event that shows some classes with the "Start Course" text, some with just the price, although he has full access to those beacuse of his membership, and some with the text "Retake Course" because he has completed these courses. all courses should show either "Start Course", "Retake Course", or "Continue Course".   Check out this screenshow from one of our students account >> http://prntscr.com/mxgcsh Because if these we get a lot of emails from students who think they lost the access to these courses and they think they need to rebuy them. Any idea why is this happening? Thanks :) Stratos a.  
    #200611
    logan
    Member
    Hello, Yes this is happening because a membership could have thousands of course. suppose there is 1000 users and you allow all users to have access all 1000 course. it might crash your site. the logic we are following is that we check the membership of a user when he/she logged in. when user goto the course page by clicking the take this course only then membership will be allotted.
    #200647
    lightform
    Spectator
    Got it. It makes sense. Thanks for the update.   Kind Regards Stratos A.
    #200701
    logan
    Member
    Hey There, Cheers ! If I can be of assistance, please do not hesitate to contact me again. Closing this topic. Best regards:
Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Remove the Membership Level from Course and show only Prices from Woocommerce’ is closed to new replies.