Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter gspsites

    (@xguiboy)

    uma alternativa interessante seria colocar a aba de downloads do woocommerce dentro do painel do tutor

    • This reply was modified 1 year, 9 months ago by gspsites.

    Dear @xguiboy

    You can show WooCommerce pages on the Tutor LMS dashboard page, for that you need to use some codes, please check our documents to know more.

    https://docs.themeum.com/tutor-lms/developers/editing-tutor-dashboard/

    Have a good day.

    Thread Starter gspsites

    (@xguiboy)

    hi, thanks, i read that, but i can add a link to the menu, but can i add a new tab with content with shortcode? i want to add the content of the woocomemrce my account download tab

    i’ve created a shortcode that shows the downloads content [my_account_downloads], and tried adding a download folder inside the tutor/templates/dashboard/ and a download.php file with the code

    <?php
    /*
    Template Name: My Account Downloads
    */
    get_header();
    ?>
    <div id="tutor-dashboard-content">
        <?php echo do_shortcode('[my_account_downloads]'); ?>
    </div>
    <?php
    get_footer();

    to call the shortcode inside, but it appear that the page dont exist, any clue?

    • This reply was modified 1 year, 9 months ago by gspsites.
    Thread Starter gspsites

    (@xguiboy)

    this is the code i’ve puted in the function.php

    /*remove the tabs i dont want*/
    add_filter('tutor_dashboard/nav_items', 'remove_some_links_dashboard');
    function remove_some_links_dashboard($links){
    	unset($links['reviews']);  
    	unset($links['wishlist']);
    	unset($links['my-quiz-attempts']);  
    	unset($links['question-answer']);
    	return $links;
    }
    
    /*add a tab i want*/
    add_filter('tutor_dashboard/nav_items', 'add_some_links_dashboard');
    function add_some_links_dashboard($links){
    
    	$links['custom_link'] = [
    		"title" =>	__('Meus Downloads', 'tutor'),
    		"url" => "/painel/downloads/",
    		"icon" => "tutor-icon-download-bold",
    
    	];
    	return $links;
    }
    
    /*create a shorcode do show the /my-accounts/downloads/ content*/
    function my_account_downloads_shortcode() {
        if ( is_user_logged_in() ) {
            ob_start();
            wc_get_template( 'myaccount/downloads/' );
            return ob_get_clean();
        } 
    }
    add_shortcode( 'my_account_downloads', 'my_account_downloads_shortcode' );

    this is the code i’ve puted in the tutor/templates/dashboard/downloads/downloads.php

    <?php
    /*
    Template Name: My Account Downloads
    */
    get_header();
    ?>
    <div id="tutor-dashboard-content">
        <?php echo do_shortcode('[my_account_downloads]'); ?>
    </div>
    <?php
    get_footer();

    can anyone now whats wrong?

    ps.: i’ve tried add the file downloads.php in the in the tutor/templates/dashboard/ folder, but same error

    • This reply was modified 1 year, 9 months ago by gspsites.
    • This reply was modified 1 year, 9 months ago by gspsites.

    Dear @xguiboy

    The file path will be tutor/templates/dashboard/downloads.php

    Also, the code will be

    add_filter('tutor_dashboard/nav_items', 'add_some_links_dashboard');
    function add_some_links_dashboard($links){
    
    	$links['custom_link'] = [
    		"title" =>	__('Custom Link', 'tutor'),
    		"url" => "/downloads",
    		"icon" => "your-icon-class",
    
    	];
    	return $links;
    }

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘enrolled courses’ is closed to new replies.