This topic contains 22 reply and 2 voices, and was last updated by towhid 4 years, 8 months ago
Viewing 15 Posts - 1 through 15 (of 22 total)
Author Posts
November 28, 2014 at 10:08 pm 31352
towhid Hello devs I posted here but got no answers so I'll try again. I wanna create a page with the seller dashboard menu on the left, and i found this
function dokan_add_dashboard_menu( $menus ) {
    $page_id = 19;
     
    $menus['newsletter'] = array(
        'title' => __( 'Newsletter', 'dokan'),
        'icon' => '<i class="icon-envelope"></i>',
        'url' => get_permalink( $page_id )
    );
      
    return $menus;
}
  
add_filter( 'dokan_get_dashboard_nav', 'dokan_add_dashboard_menu' );
where the page 19 has the shortcode in it (could be a blank page) But obviously there is a problem, cause the page doesn't have the left dashboard. So i was thinking of just creating a new php file in the templates theme called “new-newsletter.php”. But I can’t figure how to do it…’cause there is something with “query_vars” and so on in order to properly show and link the page. Would you be able to point out how to do it? Cheers.
November 29, 2014 at 11:57 am 31377
towhid towhid

Hello Roberto,

I have forward this topic to our developer team. Hope I will be right back to you with a correct solution. Please allow some times.

Thank You 🙂

December 3, 2014 at 2:00 am 31655
Roberto Roberto

any news about this topic?
Appreciate your help.

Cheers

December 3, 2014 at 2:59 pm 31708
towhid towhid

Hello Roberto,

Sorry for the late replay. Please try to find below 4 filters in the dokan plugin folder. Each filter has unique purpose. I have share these filter to you for get idea about that it meets your requirements or not. Hopefully with this filter you can customize,extend for show the menu in template area and link the menu.

add_filter( 'dokan_query_var_filter', array( $this, 'register_news_qeryvar' ) );
add_filter( 'dokan_get_dashboard_nav', array( $this, 'nav_menu' ) );
add_filter( 'dokan_get_template_part', array( $this, 'include_news_page' ), 10, 3 );
add_action( 'dokan_load_custom_template', array( $this, 'custom_templating' ) );

Please let me know the result. We are here to help you.

Thank You 🙂

December 3, 2014 at 8:27 pm 31726
Roberto Roberto
<?php
//urls
function newsletter_add_dashboard_menu( $menus ) {
    $menus['newsletter'] = array(
            'title' => __( 'Newsletter', 'dokan'),
            'icon'  => '<i class="fa fa-envelope"></i>',
            'url' => dokan_get_navigation_url('new-newsletter')
    );
      
    return $menus;
}
add_filter( 'dokan_get_dashboard_nav', 'newsletter_add_dashboard_menu' );

function register_newsletter_queryvar( $array ){
  	$array[] = 'newsletter';
	return $array;
}
add_filter( 'dokan_query_var_filter', 'register_newsletter_queryvar' );

//get template
function newsletter_template(){
		global $wp;
		if ( isset( $wp->query_vars['new-newsletter'] ) ) {
		dokan_get_template_part( 'new-newsletter' );
		return;
	}

}
add_action( 'dokan_load_custom_template', 'newsletter_template' );

Having a file in /themes/mytheme/dokan/new-newsletter.php

The dashboard on the left works fine… but the rest doesn’t (i get a 404 not found)
What am i doing wrong?

I guess it has to do with add_filter( 'dokan_get_template_part', array( $this, 'include_news_page' ), 10, 3 ); but i don’t understand where i need to use it.

Cheers and many thanks

December 4, 2014 at 2:30 pm 31805
towhid towhid

Hello Roberto,

In this link you did mistake.

if ( isset( $wp->;query_vars[‘new-newsletter‘] ) )

Please replace this line

if ( isset( $wp->;query_vars[‘newsletter’ ) )

and let me know the result.

Thank You 🙂

December 4, 2014 at 3:19 pm 31813
Roberto Roberto

Nope. This is not the problem. I replaced all the occurrencies with “newsletter” changing also the file name to newsletter.php in order not to make a mess.
Stil 404 not found

December 4, 2014 at 4:46 pm 31827
towhid towhid

Hello Roberto,

Make sure that you have set you permalinks as “Post name” and “Product”. For getting permalinks setting you have to navigate to Settings->Permalinks.

If it is not solve the problem then please provide your login details by using this form – http://wedevs.com/provide-login-details/. I will have a look what is going wrong.

Thank you 🙂

December 4, 2014 at 5:51 pm 31840
Roberto Roberto

Permalinks are ok. Not working :/

I’m pretty sure it’s something to do with the fact that wp can’t find the file “newsletter.php” because of the filters/template whatever.

I’ll g

December 5, 2014 at 2:42 pm 31890
Roberto Roberto

i just noticed my message wasnt complete.
Anyway, did you notice something wrong?

December 6, 2014 at 11:34 am 31923
towhid towhid

Hello Roberto,

If your message was not complete you can send again. I will work according to your problem. I also need ftp login details.

Thank you 🙂

December 6, 2014 at 2:39 pm 31929
Roberto Roberto

I just wanted to say “I’ll give you access through your form”

I’ll send you ftp details now.

Cheers.

December 7, 2014 at 3:29 pm 31957
towhid towhid

Hello Roberto,

Please send the ftp login details in this post and make it private.

Thank You 🙂

December 7, 2014 at 5:09 pm 31960
Roberto Roberto This reply has been marked as private.
December 8, 2014 at 1:16 pm 31981
towhid towhid

Hello Roberto,

I have successfully login to your site with ftp also the admin login. But can not able to locate your custom code file. Would you please send directory path of your custom code file. Then it will be easy to check and work.

Thank You 🙂

December 8, 2014 at 3:42 pm 31988
Roberto Roberto

Custom code is in the “My-dokan” plugin, file “custom-dashboard.php”

Viewing 15 Posts - 1 through 15 (of 22 total)