• Hi,

    I use custom sql to find product category on my site based on sellerID :

    $seller_id = (int) get_query_var('author');
    $sql = "SELECT t.term_id,t.name, tt.parent FROM $wpdb->terms as t
                            LEFT JOIN $wpdb->term_taxonomy as tt on t.term_id = tt.term_id
                            LEFT JOIN $wpdb->term_relationships AS tr on tt.term_taxonomy_id = tr.term_taxonomy_id
                            LEFT JOIN $wpdb->posts AS p on tr.object_id = p.ID
                            WHERE tt.taxonomy = 'product_cat'
                            AND p.post_type = 'product'
                            AND p.post_status = 'publish'
                            AND p.post_author = $seller_id GROUP BY t.term_id";
    
                $categories = $wpdb->get_results( $sql );
    $walker = new Dokan_Store_Category_Walker( $seller_id );

    How can I include my result ($categories) in your plugin ?
    Thanks

  • The topic ‘Custom SQL categories’ is closed to new replies.