Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Remove the Membership Level from Course and show only Prices from Woocommerce
- This topic has 9 replies, 3 voices, and was last updated 5 years, 8 months ago by logan.
Viewing 10 posts - 1 through 10 (of 10 total)
-
AuthorPosts
-
October 28, 2018 at 5:33 am #182012lightformSpectatorHello 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.October 29, 2018 at 12:42 pm #182154DianaParticipant@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 levelMarch 2, 2019 at 3:41 pm #199074lightformSpectatorHello 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
March 4, 2019 at 10:17 am #199200loganMemberHello, 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.March 7, 2019 at 9:56 am #199707lightformSpectatorThis reply has been marked as private.March 8, 2019 at 12:57 pm #199935loganMemberHey, 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; }March 13, 2019 at 6:54 pm #200554lightformSpectatorHello 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.March 14, 2019 at 11:07 am #200611loganMemberHello, 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.March 14, 2019 at 3:14 pm #200647lightformSpectatorGot it. It makes sense. Thanks for the update. Kind Regards Stratos A.March 15, 2019 at 5:03 am #200701loganMemberHey There, Cheers ! If I can be of assistance, please do not hesitate to contact me again. Closing this topic. Best regards: -
AuthorPosts
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.