• Resolved yukiko-kawa

    (@yukiko-kawa)


    A class on dokan lite dont have problem:
    remove_action(‘dokan_product_edit_after_main’, array( ‘WeDevs\Dokan\Dashboard\Templates\Products’, ‘load_inventory_template’ ), 5 );

    but on dokan pro there are problem (not get the function on class):

    remove_action( ‘dokan_product_edit_after_inventory_variants’, array( ‘WeDevs\DokanPro\Products’, ‘load_shipping_tax_content’ ), 10);

    the concept is the same, why doesn’t it work on PRO?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Shafinoid

    (@shafinahmad01)

    Hi @yukiko-kawa

    Thank you for reaching us!

    We will surely help you however, kindly share your query from here because we are unable to discuss any features that are not available on the free version of the Dokan plugin as per WordPress Community rules.

    We will wait for your query there. ??

    Thread Starter yukiko-kawa

    (@yukiko-kawa)

    @shafinahmad01 thanks.

    Hehe. I’ve already written to pro support, and they told me they don’t provide customization assistance. I just need to understand why the class is not called correctly.

    Maybe you could help me on this other action on dokan lite.
    On file: /Dokan LITE/includes/Dashboard/Templates/Main.php
    there are class: class Main{}
    whith:
    add_action( 'dokan_dashboard_content_before', [ self::class, 'dashboard_side_navigation' ] );

    For example, I would like to cancel this add_action (it hides the menu on the product modification page), but I can’t call the class correctly.

    If in the /products/new-product-single.php write:

    remove_action( 'dokan_dashboard_content_before', array( WeDevs\Dokan\Dashboard\Templates::class, 'dashboard_side_navigation' ) );

    I expect the sidebar menu to disappear from the do_action call :
    do_action( 'dokan_dashboard_content_before' );

    instead it remains!

    I know the problem lies in the *self :: class*, or other do_actions I’ve seen they just use *$this*. But even calling the namespace of the class this doesn’t work.

    While on functions:

    remove_action(‘dokan_product_edit_after_main’, array( ‘WeDevs\Dokan\Dashboard\Templates\Products’, ‘load_inventory_template’ ), 5 );

    it works normally.

    I just miss that little change to make to make it work.

    maybe I’m not an expert programmer,
    but I would like to learn

    Thanks

    Thread Starter yukiko-kawa

    (@yukiko-kawa)

    even a little tip would be fine …

    Hello @yukiko-kawa,

    Thank you for getting back, I am not sure why you want to remove this action since it has more than 25+ calls in several templates area.

    Anyway, you are trying to access in a wrong way, the following portion works for me.

    add_action( 'init', 'dokan_remove_dashboard_side_navigation_action');
    
    function dokan_remove_dashboard_side_navigation_action() {
    	remove_action( 'dokan_dashboard_content_before', array( 'WeDevs\Dokan\Dashboard\Templates\Main', 'dashboard_side_navigation' ) );
    }

    Hope it helps, take care ??

    Warm regards,

    Shafinoid

    (@shafinahmad01)

    Hello,
    I hope you are doing great,

    As you haven’t replied for a long, I’m considering that your query is being satisfied and I’m also resolving this topic.

    But feel free to create another one anytime.

    Thread Starter yukiko-kawa

    (@yukiko-kawa)

    I have not received notification of the reply. excuse me.

    Curious, actually the remove_action () works for me in the page: theme/dokan/products/new-product-single.php

    but not in an invoked sub-template.
    Maybe that’s where I need to understand better. perhaps some value does not pass.

    Thanks a lot, anyway !!!

    Thread Starter yukiko-kawa

    (@yukiko-kawa)

    I still haven’t found the correct class call in dokan ..

    but in the end why go crazy with remove_action ?!

    If you can use the Jquery!

    SOME EXEMPLE

    <script type="text/javascript">
    jQuery('#wp-vendor_biography-wrap').parents('.dokan-form-group').detach().prependTo('#mydiv_for_dokan_field');
    </script>

    add to store-form.php the html:
    <div id="mydiv_for_dokan_field"></div>

    Put it where you want the material to be moved (here the bio box) and the result is done.

    Then just customize it if some are conditions that can be activated or not.
    For example the Live chat, it can be active or not on dokan.
    So you look for for example the condition that input exists and if it exists then you move the commands wherever you want.

    It is surprising how much one is puzzled over a problem, and yet there is the loophole on the other side.

    Thanks anyway for trying to help me.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘why remove_action() in dokan-lite work and not in dokan-pro?’ is closed to new replies.