test melih
 melih
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • Mr.Cat Moderator
    #1067640

    @kroenerdesign

    In latest version, we already support sort by custom field, you can check at demo

    http://ja-megafilter.demo.joomlart.com/index.php/joomla-custom-fields-filter#sort=attr.ct2.frontend_value&sortdir=asc&page=1

    Regards

    Wisdom is not a product of schooling but of the lifelong attempt to acquire it.

    kroenerdesign Friend
    #1067811
    This reply has been marked as private.
    Mr.Cat Moderator
    #1068032

    @kroenerdesign,

    Yes, it’s possible with latest version. But you’re using old version so let me try on your site.

    Please provide me the admin info in private reply

    Regards

    Wisdom is not a product of schooling but of the lifelong attempt to acquire it.

    kroenerdesign Friend
    #1068071
    This reply has been marked as private.
    Mr.Cat Moderator
    #1068103

    @kroenerdesign

    I can’t access to your admin site. Please check the login info

    Regards

    P.S: Correct me if i’m wrong. You want default sort is "by alphabet", but after doing any filter, the sorting will change to "by a custom field". And after reset filter, the sorting will back to "by alphabet" ?

    If it’s true, i think megafilter doesn’t support workflow like that.

    • This reply was modified 7 years, 3 months ago by  Mr.Cat.

    Wisdom is not a product of schooling but of the lifelong attempt to acquire it.

    kroenerdesign Friend
    #1068307
    This reply has been marked as private.
    Mr.Cat Moderator
    #1068337

    @kroenerdesign

    Yes, it’s clear now. You can made it by open file

    /components/com_jamegafilter/assets/js/megafilter.js

    Replace this block code

    var t1 = self.getItem(a).getField('id'),
    t2 = self.getItem(b).getField('id');
    return t1 > t2 ? d : -d;

    with this

    var t1 = self.getItem(a).getField('name'),
    t2 = self.getItem(b).getField('name');
    return t1 > t2 ? -d : d;

    I already change on your site. Please check https://dev.netplans.de/businesscloud#sort=attr.ct2.frontend_value&themen=6&page=1

    Wisdom is not a product of schooling but of the lifelong attempt to acquire it.

    kroenerdesign Friend
    #1068343

    Yeehaaa! Looks good. Thank you very much for your efforts.

    One question: You must have done this by uploading a file through the jooma installer, correct?

    –> Will your modification be overwritten when we update the megafilter component or plugin?

    Mr.Cat Moderator
    #1068345

    @kroenerdesign

    Yes, the changes will be lost when you update component. So please back up.

    Regards

    Wisdom is not a product of schooling but of the lifelong attempt to acquire it.

    kroenerdesign Friend
    #1068555

    Our client want still a little change.

    Now we have a field named "Filter". And this I set to sort. But it sorts by name. It would be better if we could sort by rawvalue. For example: the field has the options:

    • Netplans Cloud – value 1
    • Microsoft Cloud – value 2
    • Netplans Service – value 3

    Now we sort DESc, so first it shows value 3, then 1, then 2 (because of the names). It is possible to sort like 1,2,3?

    So it would be fine, if the first order is by value and then alphabetically. Is it possible? Can you send me a fix? In the sidebar we had just done this.

    Thank you very much.

    Mr.Cat Moderator
    #1068579

    @kroenerdesign

    My account on your site is blocked, so these codes haven’t be tested on your site.

    Open file

    /components/com_jamegafilter/views/default/view.html.php

    Replace

    'frontend_field' => str_replace('.value', '.frontend_value', $filter->field));

    With

    'frontend_field' =>$filter->field;

    Replace

    $config->default_sort = str_replace('.value', '.frontend_value', $default_sort);

    With

    $config->default_sort = $default_sort;

    Open file

    /plugins/jamegafilter/content/tmpl/default.php

    Replace

    UBLNConfig.sortByOptions = <?php echo str_replace('.value','.frontend_value',json_encode($this->config->sorts)); ?>;

    With

    UBLNConfig.sortByOptions = <?php echo json_encode($this->config->sorts); ?>;
    • This reply was modified 7 years, 3 months ago by  Mr.Cat.

    Wisdom is not a product of schooling but of the lifelong attempt to acquire it.

    kroenerdesign Friend
    #1068609

    Thank you very much. It was just this line "$config->default_sort = $default_sort;" which I was needed. Thanks a lot.

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

This topic contains 12 replies, has 2 voices, and was last updated by  kroenerdesign 7 years, 3 months ago.

The topic ‘Sort items’ is closed to new replies.