Home Forums Theme Support Dokan Add Links to Sellers Dashboard

This topic is: resolved

This topic contains 9 replies, has 3 voices, and was last updated by  Sekander Badsha 4 years, 7 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #22804

    Jamie
    Member
    Post count: 7

    Hello
    I am have some issues. I am attempting to add 2 a link to the seller dashboard.
    I used the following code, but I am not seeing anything. I placed this code in the on dokan/includes/template-tags.php on line 345., I placed these files in my child theme. I would like these links in the top right sellers dashboard and the left dashboard on sellers page. Thank you for help

    ‘settings' => array(
    ‘title' => __( ‘Help Files', ‘dokan'),
    ‘icon' => ‘‘,
    ‘url' => dokan_get_page_url( ‘help-files' )
    ),
    ‘settings' => array(
    ‘title' => __( ‘Google', ‘dokan'),
    ‘icon' => ‘‘,
    ‘url' => dokan_get_page_url( ‘http://www.google.com' )
    ),

    Please advise if this is correct.

    #22806

    Sk
    Moderator
    Post count: 371

    Hello Jamie,

    Nice try. You can use this filter dokan_get_dashboard_nav in dokan/includes/template-tags.php on line 345 to do so. You don't need to include the file to your child theme. Just use add_filter in your child-theme child-theme/function.php.

    write the following code in child-theme/function.php.

    add_filter( 'dokan_get_dashboard_nav', 'dokan_e_add_seller_nav' );
    function dokan_e_add_seller_nav( $urls ) {
        $urls['help'] => array(
            'title' => __( 'Help Files', 'dokan'),
            'icon' => '<i class="fa fa-users"></i>',
            'url' => 'http://www.help.com'
        ),
        $urls['google'] => array(
            'title' => __( 'Google', 'dokan'),
            'icon' => '<i class="fa fa-google"></i>',
            'url' => 'http://www.google.com'
        ),
    }

    thank you. ๐Ÿ™‚

    #22816

    Jamie
    Member
    Post count: 7

    Thank you for helping. I wanna make sure I understand the solution.

    1. I place dokan_get_dashboard_nav on line 345 in the [dokan/includes/template-tags.php] file.
    **now will this be erased if the file is updated? That is why i included the [dokan/includes/template-tags.php] in my child theme. Do I add parentheses around dokan_get_dashboard_nav?

    2. I placed the code below on line 68 of my child theme/functions.php
    add_filter( ‘dokan_get_dashboard_nav', ‘dokan_e_add_seller_nav' );
    function dokan_e_add_seller_nav( $urls ) {
    $urls[‘help'] => array(
    ‘title' => __( ‘Help Files', ‘dokan'),
    ‘icon' => ‘‘,
    ‘url' => ‘http://www.help.com'
    ),
    $urls[‘google'] => array(
    ‘title' => __( ‘Google', ‘dokan'),
    ‘icon' => ‘‘,
    ‘url' => ‘http://www.google.com'
    ),
    }

    I did everything listed above and I got a error.
    Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home3/jlpride1/public_html/LOWPRICEOUTLET.COM/wp-content/themes/wedevs-dokan-child/functions.php on line 68

    #22827

    Sk
    Moderator
    Post count: 371

    1. Do not change or edit dokan/includes/template-tags.php file. You dont need to include this file in your child-theme either.

    2.please remove those code from child-theme/function.php and try the following

    add_filter( 'dokan_get_dashboard_nav', 'dokan_e_add_seller_nav' );
    function dokan_e_add_seller_nav( $urls ) {
        $urls['help'] = array(
            'title' => __( 'Help Files', 'dokan'),
            'icon' => '<i class="fa fa-users"></i>',
            'url' => 'http://www.help.com'
        );
        $urls['google'] = array(
            'title' => __( 'Google', 'dokan'),
            'icon' => '<i class="fa fa-google-plus"></i>',
            'url' => 'http://www.google.com'
        );
        return $urls;
    }

    Hope this will work. ๐Ÿ™‚

    #22833

    Jamie
    Member
    Post count: 7

    Thank you it worked perfect.

    #22834

    Jamie
    Member
    Post count: 7

    I forget to ask how do you make the links open to a new window is possible.
    Thanks again for all your help

    #22835

    Sk
    Moderator
    Post count: 371

    Sorry that's not possible up to this version.

    #27866

    Jamie
    Member
    Post count: 7

    Hello,
    I would like to know how do you add the additional links to the dashboard since it is now a plugin? Is there a way of adding this where it will not be deleted with the next update?
    Thank you.

    #28198

    Sk
    Moderator
    Post count: 371

    Hi Jamie,

    The same code should work perfectly.

    [php]
    add_filter( ‘dokan_get_dashboard_nav', ‘dokan_e_add_seller_nav' );
    function dokan_e_add_seller_nav( $urls ) {
    $urls[‘help'] = array(
    ‘title' => __( ‘Help Files', ‘dokan'),
    ‘icon' => ‘<i class="fa fa-users"></i>',
    ‘url' => ‘http://www.help.com'
    );
    $urls[‘google'] = array(
    ‘title' => __( ‘Google', ‘dokan'),
    ‘icon' => ‘<i class="fa fa-google-plus"></i>',
    ‘url' => ‘http://www.google.com'
    );
    return $urls;
    }
    [/php]

    Thank you

    #28219

    Sekander Badsha
    Member
    Post count: 2067

    To be safe from loosing your modifications, do no edit a theme or plugin file. Always use a child theme to customize. Here is the official documentation of WordPress about creating and using child themes http://codex.wordpress.org/Child_Themes

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Add Links to Sellers Dashboard’ is closed to new replies.