Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Membership Levels Show as Private
Tagged: Help, levels, membership
- This topic has 5 replies, 2 voices, and was last updated 7 years, 7 months ago by H.K. Latiyan.
Viewing 6 posts - 1 through 6 (of 6 total)
-
AuthorPosts
-
April 27, 2017 at 5:48 pm #109299pablomoracanteroSpectatorI created 2 Membership Levels on my web. 1- Membresia 2- Diplomado When I selected that a Course should use a Specific Membership Level I get two different results. If I select Membresia It will Look like this. (This is what I want to see) http://prnt.sc/f1juh2 If I select Diplomado it shows "privado" private, Like this, but I want to show the word "diplomado", http://prnt.sc/f1jv0n I added this code to get to show like how is showing. <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;">add_filter('wplms_course_credits_array','show_only_menu',9999,2);</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;">function show_only_menu($credits,$id){</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $credits=array();</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $free_course = get_post_meta($id,'vibe_course_free',true);</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> if(vibe_validate($free_course)){</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $credits[]= ''.apply_filters('wplms_free_course_price',__('FREE','vibe')).'';</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> }else{</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $product_id = get_post_meta($id,'vibe_product',true);</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> if(isset($product_id) && $product_id !='' && function_exists('get_product')){ //WooCommerce installed</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $product = get_product( $product_id );</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> if(is_object($product)){</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $link =get_permalink($product_id);</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $check=vibe_get_option('direct_checkout');</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> if(isset($check) && $check)</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $link.='?redirect';</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $price_html = str_replace('class="amount"','class="amount"',$product->get_price_html());</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $credits[$link] = ''.$price_html.'';</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> }</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> }</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> }</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> if ( in_array( 'paid-memberships-pro/paid-memberships-pro.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"></p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $membership_ids = vibe_sanitize(get_post_meta($id,'vibe_pmpro_membership',false));</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> if(isset($membership_ids) && is_Array($membership_ids) && count($membership_ids) && function_exists('pmpro_getAllLevels')){</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> //$membership_id = min($membership_ids);</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $levels=pmpro_getAllLevels();</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> foreach($levels as $level){</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> if(in_array($level->id,$membership_ids)){</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $link=get_option('pmpro_levels_page_id');</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $link=get_permalink($link).'#'.$level->id;</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> $credits[$link] = ''.$level->name.'';</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> </p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> }</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> break;</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> }</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> }</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> }</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;"> return $credits;</p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"></p> <p style="box-sizing: border-box; margin: 0px 0px 22px; color: #4b4d4d; font-family: Lato; font-size: 14px;"><strong style="box-sizing: border-box;">}</p>April 28, 2017 at 1:06 pm #109454H.K. LatiyanParticipantThe private is shown because the course is set to be paid but there is no membership or product connected to it for the users to purchase it. If you want your course to be free then please set the course as free in the course pricing settings. If you only want to change the private text, then you can translate the private text using the loco translate plugin. Let me know if this helps.May 2, 2017 at 4:33 pm #110076pablomoracanteroSpectatorI need to show the Membership Level instead of Private. I already have a product link to the course. What Can I do to have that private taken away and seen the membership level.May 3, 2017 at 11:11 am #110206H.K. LatiyanParticipantThe membership level will automatically be shown on the course page if you connect the membership level with the course and no private label will be shown. If you are facing issues in connecting the membership level, then please share the course url and the admin credentials with us to check the issue on your website. PS: Please mark your reply as private while sharing the credentials.May 3, 2017 at 3:00 pm #110300pablomoracanteroSpectatorThis reply has been marked as private.May 4, 2017 at 12:16 pm #110439H.K. LatiyanParticipantThis reply has been marked as private.
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
- The topic ‘Membership Levels Show as Private’ is closed to new replies.