skip to Main Content

I am using dokan wordpress marketplace and i want to change default slug of dokan on store and store listing page i have tried following code but it is not woking. Is there any other way to change it.

For Store URL

function marcuss_store_url( $rewrite ) {
    $rewrite['store'] = 'seller';
    return $rewrite;
}
add_filter( 'dokan_get_option_store_url', 'marcuss_store_url' );

For Store Listing Page

function marcus_store_listing_url( $url ) {
    return str_replace( 'store-listing', 'sellers', $url );
}
add_filter( 'dokan_store_listing_url', 'marcus_store_listing_url' );

I have created above 2 functions in the functions.php file but not working is there any issue on these above both functions or is there any other way to change it.

2

Answers


  1. You need to modify the hooks you are using in the code.

    First Code : Please use dokan_store_slug instead of dokan_get_option_store_url hook.

    Second Code : Please use dokan_get_option_store_listing_slug instead of dokan_store_listing_url hook.

    Login or Signup to reply.
  2. You don’t need to create code for that you can change directly from the dokan settings.

    Here is a screenshot for your reference.
    enter image description here

    For store listing dokan create page with shortcode [dokan-stores] so by changing page slug you can change the store listing page slug.

    Hope these both are helpful.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search