Forum Replies Created

Viewing 15 Topics - 1 through 15 (of 37 total)
Author Posts
January 29, 2015 at 8:52 pm in reply to: Seller dashboard in Seller Page 35325
Roberto Roberto

Hello devs.

I see in Dokan 1.4 you changed the load_query_var_variable to register_rule

Still, the only way to add the query vars to that function is to manually write them into the file itself.

can you please provide a hook for us to add new query vars without modifying dokan?

January 24, 2015 at 2:41 pm in reply to: Add product to more than one category 34897
Roberto Roberto

you need to work on these actions

add_action('dokan_product_edit_before_main', 'monty_store_end_fields_edit',1);
add_action('dokan_new_product_form', 'monty_store_end_fields_edit',1);

add_action('woocommerce_product_meta_end','woocommerce_add_taxonomies_on_single_product');

and then put something like

function fn_save(){
$mytax_list = sanitize_text_field($_POST['_mytax'] );
$mytax = explode(",", $mytax_list);
wp_set_post_terms( $post_id, $mytax, 'mytax' , false );
}

hooked to

add_action('dokan_process_product_meta','fn_save');

But you need to have it done by a dev.

Cheers

December 17, 2014 at 6:54 pm in reply to: Wrong include doesn't load templates 32458
Roberto Roberto

I’m saying that instead of using the regular include method from php, you should use a custom include function which checks first in the current theme folder, and then in the dokan folder, when including anything.

Otherwise everytime somebody has to extend a functionality of dokan, he also has to rewrite the include path manually.
Is it more clear? Thank you for your interest

December 10, 2014 at 11:21 pm in reply to: Seller dashboard in Seller Page 32106
Roberto Roberto
function newsletter_add_dashboard_menu( $menus ) {
     
    $menus['newsletter'] = array(
            'title' => __( 'Newsletter', 'dokan'),
            'icon'  => '<i class="fa fa-envelope"></i>',
            'url' => dokan_get_navigation_url('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['newsletter'] ) ) {
			dokan_get_template_part( 'newsletter' );
		return;
		}
		if ( isset( $wp->query_vars['new-newsletter'] ) ) {
			dokan_get_template_part( 'new-newsletter' );
		return;
		}

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

This was added from a plugin.

function load_query_var_variable() {
        $this->query_vars = apply_filters( 'dokan_query_var_filter', array(
            'products',
            'new-product',
            'orders',
            'coupons',
            'reports',
            'reviews',
            'withdraw',
            'settings',
            'account-migration',
	    'newsletter',
	    'new-newsletter'
        ) );
    }

This was added to the DOKAN file because I don’t know how to add it from outside.
ANy suggestion would be appreciated.

December 10, 2014 at 3:35 pm in reply to: Seller dashboard in Seller Page 32089
Roberto Roberto

The only problem is with the register queryvar in my code. Everything else works perfectly, cause the hooks and filters are working.

The $this->queryvar ain’t working, because i cannot understand how to modify it from a filter.

All the rest of the code, put in a different plugin like i did or in the functions.php, works fine.
So, i just added the registration of a new queryvar directly in the dokan code and left all the rest of the code in the other plugin.

Do you have any suggestion?

December 9, 2014 at 7:25 pm in reply to: Seller dashboard in Seller Page 32051
Roberto Roberto

news?

December 8, 2014 at 3:42 pm in reply to: Seller dashboard in Seller Page 31988
Roberto Roberto

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

December 7, 2014 at 5:09 pm in reply to: Seller dashboard in Seller Page 31960
Roberto Roberto This reply has been marked as private.
December 6, 2014 at 2:39 pm in reply to: Seller dashboard in Seller Page 31929
Roberto Roberto

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

I’ll send you ftp details now.

Cheers.

Roberto Roberto

There are hundreds of plugins (baw login-logout, wordpress access control & so on ) that allows you to create multiple menus for logged-in loggedd-out or to protect pages. Check them out!

Cheers

December 5, 2014 at 2:42 pm in reply to: Seller dashboard in Seller Page 31890
Roberto Roberto

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

December 4, 2014 at 5:51 pm in reply to: Seller dashboard in Seller Page 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 4, 2014 at 3:19 pm in reply to: Seller dashboard in Seller Page 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 3, 2014 at 8:27 pm in reply to: Seller dashboard in Seller Page 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 3, 2014 at 2:00 am in reply to: Seller dashboard in Seller Page 31655
Roberto Roberto

any news about this topic?
Appreciate your help.

Cheers

Viewing 15 Topics - 1 through 15 (of 37 total)