This topic contains 8 reply and 2 voices, and was last updated by towhid 4 years, 3 months ago
Viewing 8 Posts - 1 through 8 (of 8 total)
Author Posts
July 1, 2015 at 8:25 am 53843
towhid 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.
July 2, 2015 at 3:58 pm 54065
towhid towhid

Hello Sordi,

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

Thanks

July 5, 2015 at 1:07 pm 54321
towhid towhid

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

July 5, 2015 at 10:43 pm 54358
Gregório Sordi Gregório Sordi

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

July 6, 2015 at 1:29 pm 54421
towhid towhid

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

July 9, 2015 at 2:48 am 54846
Gregório Sordi Gregório Sordi

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

July 9, 2015 at 1:52 pm 54906
towhid towhid

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

Thanks

July 10, 2015 at 6:07 am 55037
Gregório Sordi Gregório Sordi

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…

July 11, 2015 at 11:14 am 55126
towhid towhid

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 8 Posts - 1 through 8 (of 8 total)