Field in Course Directory

Home Forums Chit Chat WPLMS customizations Field in Course Directory

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #26986
    fabioamv
    Spectator
    hi, I need a field in Course Directory, is that possible? Look, when I'm in home on site, I can see the courses parcels, but in course directory I can't... Well, is in course directory where my sales begin....Could you help , please? Fábio
    #27108
    Anshuman Sahu
    Keymaster
    You can show it by adding the given code in your wplms-customizer.php file in wplms customizer plugin : add_filter('wplms_instructor_meta','custom_detail1');   function custom_detail1(){ $course_id=get_the_ID(); $custom_info=get_post_meta($course_id,'custom_field',true); if(isset( $custom_info ) && !empty( $custom_info))   return  $custom_info;   } Where " custom_field "  is the id of the custom field that you have added in the course settings in the backend by referring the tip : https://wplms.io/support/knowledge-base/adding-a-custom-field-to-add-custom-information-in-course-details/
    #27222
    fabioamv
    Spectator
    Hi, I've inserted <span style="line-height: 1.5;">vibe_course_details as custom_field , but just appears the word "ARRAY". Look the code:</span> ----------------------------------------------- add_filter('wplms_instructor_meta','custom_detail1');   function custom_detail1(){   $course_id=get_the_ID();   $custom_info=get_post_meta($course_id,'vibe_course_details',true);   if(isset( $custom_info ) && !empty( $custom_info))   return  $custom_info;   } --------------------------------------------------------  
    #27503
    fabioamv
    Spectator
    And there's a ARRAY inserted with instructor too in others pages. Look  
    #27672
    Fabio, Tanto o pagamento em parcelas como o pagamento por boleto são praticas tipicamente brasileiras, então é bem difícil encontrar temas que as suportem nativamente. Eu acabei de fazer isso pra um cliente que está utilizando o pagseguro, e a maneira mais pratica é utilizar a sua própria função utilizando o filtro 'wplms_course_credits', assim suas mudanças serão aplicadas toda vez que essa função for chamada pelo tema. Sem contar que vai automatizar e centralizar a manutenção do código. Abraço
    #27716
    fabioamv
    Spectator
    Olá meu querido, sim, tens razão, mas como eu já tenho a função pronta, basta apenas chamar a mesma no campo que preciso, e que não verdade não existe, entende? A solicitação foi que fosse criado o campo onde eu precisava, por isso. De qualquer forma te agradeço muito e me mande seu contato depois pelo site, pois posso precisar dos teus "préstimos" num futuro breve viu...rrsrs... Um abraço! Fábio
    #27942
    Na verdade eu entendi sim o que você falou, mas acho que me expliquei mal. Eu vi pelo print que você estã conseguindo exibir a informação na home, mas não no diretório (e provavelmente também não na página do curso). Pelo que eu entendi você está usando um custom field, e embora essa não seria a minha abordagem, o que importa é que está funcionando para você. O que você tem que fazer agora é exibir isso no lugar do preço, e pra isso você pode usar o filtro 'wplms_course_credits'. Assim toda vez que a função for utilizada as suas mudanças serão implementadas automaticamente. Ex: add_filter( 'wplms_course_credits', 'cdctps_exibir_parcelas', 20 ); function cdctps_exibir_parcelas($credits) { $credits = get_post_meta(get_the_ID(),'NOME DO SEU CUSTOM FIELD',true); return $credits; } Ps: Eu não testei esse código, é mais para te dar uma ideia mesmo, então cuidado ao usar.
    #28247
    Anshuman Sahu
    Keymaster
    It would be great if you provide more information on your with some screenshots so that i can provide a pin point solution for that .
    #28256
    MrVibe
    Keymaster
    Please confirm if the issue is not resolved yet. Marked as resolved. (Temporarily)
    #28313
    fabioamv
    Spectator
    Hi Alex, thaks for your help. Here's my functions.php wich I use in wplms_social_info_child_theme But instead of using the correct field , is showing the word ARRAY ------------------------------------------------------------------- <?php add_filter('vibe_option_custom_sections','add_phone_email'); function add_phone_email($sections){ if (isset($sections) && count($sections)){ $sections[9]['fields'][]=array( 'id' => 'site_phone', 'type' => 'text', 'title' => __('Phone', 'vibe'), 'sub_desc' => __('', 'vibe'), 'desc' => __('Provide Phone no. to dispaly in top menu', 'vibe'), 'std' => '011-180-410' ); $sections[9]['fields'][]=array( 'id' => 'site_email', 'type' => 'text', 'title' => __('Email', 'vibe'), 'sub_desc' => __('', 'vibe'), 'desc' => __('Provide Email to dispaly in top menu', 'vibe'), 'std' => '[email protected]' );   return $sections; }   } add_action('wplms_course_nav_menu','wplms_course_remove_nav_section',100); function wplms_course_remove_nav_section($sections){   unset($sections['members']); unset($sections['events']);   return $sections; } add_action( 'wp_enqueue_scripts', 'custom_frontend_scripts' );function custom_frontend_scripts() {global $post, $woocommerce; $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? : '.min'; wp_deregister_script( 'jquery-cookie' ); wp_register_script( 'jquery-cookie', $woocommerce->plugin_url() . '/assets/js/jquery-cookie/jquery_cookie' . $suffix . '.js', array( 'jquery' ), '1.3.1', true );   } add_action( 'bp_setup_nav', 'create_course_setup_nav');   function create_course_setup_nav(){ global $bp; $check =0; if(bp_is_my_profile() && current_user_can('edit_posts')) $check =1; bp_core_new_nav_item( array( 'name' => __('Gerencie os cursos', 'Vibe' ), 'slug' => 'create-course', 'position' => 100, 'screen_function' => 'wplms_create_course_redirect', 'show_for_displayed_user' => $check ) ); }   function enable_tmce_paste_stylesAndImages($mceInit, $editor_id){ $mceInit['paste_data_images'] = true; $mceInit['paste_word_valid_elements'] =  "b,strong,i,em,h1,h2,p,ol,ul,li,a,span,div,font-size,br,img,table,tbody,td,tfoot,th,thead,tr,del,ins,dl,dt,dd"; $mceInit['paste_webkit_styles'] = "all"; $mceInit['paste_retain_style_properties'] = "all";   return $mceInit; } add_filter('tiny_mce_before_init', 'enable_tmce_paste_stylesAndImages', 1, 2);   function wplms_create_course_redirect(){ $course_create = vibe_get_option('create_course'); if(is_numeric($course_create)){ wp_redirect(get_permalink($course_create),'301'); exit; } }   add_filter('wplms_course_metabox','wplms_custom_course_details_repeatable');   function wplms_custom_course_details_repeatable($metabox){ $metabox['vibe_course_details'] = array( 'label'=>__('Custom Course details','vibe-customtypes'), // &lt;label&gt; 'desc'=>__('custom course details.','vibe-customtypes'), // description 'id'=>'vibe_course_details', // field id and name 'type'=>'repeatable', // type of field 'std'=>'' ); return $metabox; }   add_filter('wplms_course_details_widget','wplms_custom_course_details_information'); function wplms_custom_course_details_information($details){ $custom_info = vibe_sanitize(get_post_meta(get_the_ID(),'vibe_course_details',false)); if(isset($custom_info) && is_array($custom_info)){ foreach($custom_info as $k=>$val){ $details[]='
    • <i class="icon-plus-1"></i><font color="red"><b>'.$val.'</font></b>
      ';   }}; return $details; }   add_filter('wplms_instructor_meta','custom_detail1'); function custom_detail1(){   $course_id=get_the_ID();   $custom_info=get_post_meta($course_id,'vibe_course_details',true);   if(isset( $custom_info ) && !empty( $custom_info))       return  $custom_info;   }   function remove_woo_header_footer($object){   remove_action('woocommerce_email_header', array( $object, 'email_header' ));   remove_action('woocommerce_email_footer', array( $object, 'email_footer' ));}add_action( 'woocommerce_email', 'remove_woo_header_footer' );   ---------------------------------------------------------------------------------------  
    #28401
    fabioamv
    Spectator
    Hi Alex, Finally I found the error but I need your help. The word array is appearing beside instructors name because in filter I' m using: add_filter('wplms_instructor_meta','custom_detail1'); --- and instructors_meta it's not the right filter, because I need to set beside product price. Well, if I use the function bellow it works fine in Course Page (only by course. Look this link as it works fine - https://www.educaretransformar.com.br/course/aprendendo-a-ser-um-gestor/), but I need in directory course too. So, I just need the rigth filter to appears like image --------------------------------------- add_filter('wplms_course_thumb_extras','show_parcels'); function show_parcels(){ $custom_info = vibe_sanitize(get_post_meta(get_the_ID(),'vibe_course_details',false)); if(isset($custom_info) && is_array($custom_info)){ $thumbnail_html =''; foreach($custom_info as $k=>$val){ $thumbnail_html .='<br><font color="red"><b>'.$val.'</b></font><br>'; } } return $thumbnail_html; } --------------------------------------------------------- It makes sense for you?  
    #28772
    Anshuman Sahu
    Keymaster
    Try replacing the code  to show instructor meta with this : add_filter('wplms_course_thumb_extras','show_parcels');   function show_parcels(){   $custom_info = vibe_sanitize(get_post_meta(get_the_ID(),'vibe_course_details',false));   if(isset($custom_info) && is_array($custom_info)&& !empty($custom_info)){   $thumbnail_html ='';   foreach($custom_info as $k=>$val){   $thumbnail_html .='<br><font color="red"><b>'.$val.'</b></font><br>';   }   }   return $thumbnail_html;   }  
    #28887
    fabioamv
    Spectator
    So, I have this code used in home page (color red  - as image 1.png), but I need to insert the same parcels in Course Directory, as image 2.png, because Course Directory is the place where I sell more courses, and this detail help to sell much more, is very, very important.
    #29407
    Anshuman Sahu
    Keymaster
    Please just add the information first then adjust positioning of the information using the css . This is the only position available as of now to show the custom information .
    #29604
    fabioamv
    Spectator
    Ok, I got, but the code was just there and nothing appears in directory courses, just appears in homepage.
Viewing 15 posts - 1 through 15 (of 18 total)
  • The topic ‘Field in Course Directory’ is closed to new replies.