Home Forums Theme Support Dokan Dokan sellers page ordination

This topic is: not resolved

This topic contains 8 replies, has 2 voices, and was last updated by  towhid 3 years, 10 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #53843

    Gregório Sordi
    Member
    Post count: 152

    Hi. In the sellers page, i'm having trouble to find what attribute makes the ordenation. Like, Alphabeticaly, A to Z, Z to A, etc.

    And, is it possible to change it? Could you point it in the code?

    thanks.

    #54065

    towhid
    Participant
    Post count: 4505

    Hello Sordi,

    I need to find this function. Please allow me some time.

    Thanks

    #54321

    towhid
    Participant
    Post count: 4505

    Hello Sordi,

    Please open dokan/classes/rewrites.php

    Find below function:

    function store_query_filter( $query ) {
            global $wp_query;
    
            $author = get_query_var( $this->custom_store_url );
    
            if ( !is_admin() && $query->is_main_query() && !empty( $author ) ) {
                $query->set( 'post_type', 'product' );
                $query->set( 'author_name', $author );
                $query->query['term_section'] = isset( $query->query['term_section'] ) ? $query->query['term_section'] : array();
    
                if ( $query->query['term_section'] ) {
                    $query->set( 'tax_query',
                        array(
                            array(
                                'taxonomy' => 'product_cat',
                                'field'    => 'term_id',
                                'terms'    => $query->query['term']
                            )
                        )
                    );
                }
            }
        }

    and replace function on the above function.

    function store_query_filter( $query ) {
            global $wp_query;
    
            $author = get_query_var( $this->custom_store_url );
    
            if ( !is_admin() && $query->is_main_query() && !empty( $author ) ) {
                $query->set( 'post_type', 'product' );
                $query->set( 'author_name', $author );
                $query->set( 'orderby', array( 'title' => 'ASC' ) );
                $query->query['term_section'] = isset( $query->query['term_section'] ) ? $query->query['term_section'] : array();
    
                if ( $query->query['term_section'] ) {
                    $query->set( 'tax_query',
                        array(
                            array(
                                'taxonomy' => 'product_cat',
                                'field'    => 'term_id',
                                'terms'    => $query->query['term']
                            )
                        )
                    );
                }
            }
        }

    Thanks

    #54358

    Gregório Sordi
    Member
    Post count: 152

    And is this change going to be implemented on next updates?

    #54421

    towhid
    Participant
    Post count: 4505

    Hello Sordi,

    We do not have any plan regarding this change. However, I will keep this feature in the log. If needed we will add this change.

    Thanks

    #54846

    Gregório Sordi
    Member
    Post count: 152

    Hum. But can you tell me what is the default dokan settings ordination? Because for me it seems random.

    #54906

    towhid
    Participant
    Post count: 4505

    The ordination is based on the newest one is showing at first but not random.

    Thanks

    #55037

    Gregório Sordi
    Member
    Post count: 152

    Humm… understood.

    About the code you said before. I tested it and it didn't work. The same ordination appears.

    Actually, what i really wanted to do is to show the sellers that have only products. If not that, make an ordination based on the number of products…

    #55126

    towhid
    Participant
    Post count: 4505

    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 🙂

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

The topic ‘Dokan sellers page ordination’ is closed to new replies.