test
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • jornaldasviagens Friend
    #193106

    I have JA K2 Filter installed in a Joomla 2.5.16 site, which is still being developed.

    The problem is with extra-fields groups in modules.

    I have one extra-field group that should be ordering the extra-fields by price, like:

    prices from: 0 to 500; 501 to 1000; 1001 to 2000 and so now.

    BUT instead of this logical price order the system mixes up the fields like this 0 to 500; 1001 to 1000; 500 – 1001….

    I guess this is because data is being listed by alphabetical order and in the case by number increase order.

    How can i manage to have prices in a increase order too?

    I appreciate your attention.

    Here with goes a printscreen of the mentioned problem

    Regards!


    1. screen-capture-1
    Luna Garden Moderator
    #516033

    Hello jornaldasviagens,

    In JA K2 Filter, extra field will be ordered by character, and by number if extra field has number only.

    With your case, extra field includes character, so It can’t be ordered by number anymore.

    I think, you can change to use value range for this.
    1. Set extra field type to Text Field, on K2 item, fill the value of price for this extra field.
    2. In Module JA k2 filter, Set Type for this extra field is value range, set value Range like this: 0|500|1000|1500|2000

    jornaldasviagens Friend
    #516304

    Hello Luna,

    tnaks a lot for your reply. well that is an options yes, but my client is not satisfied. There is a gap from 500 to 1000 that won´t be used

    The order i need is:

    0 – 500 €
    501 – 1000 €
    1000 – 2500 €
    2501 – 3000 €
    Or
    2501 € and more

    Do you think this not possible?

    Somehow change the code so that is doesn´t order by number and assume the order of the extrafields?

    I appreciate your attention,

    Regards
    JL

    Luna Garden Moderator
    #516382

    Hello JL,

    <blockquote>Somehow change the code so that is doesn´t order by number and assume the order of the extrafields?</blockquote>
    In order to remove the order of extra field, please go to:

    modulesmod_jak2filterhelper.php
    Find this line, and comment out:

    @sort( $values, SORT_REGULAR );

    jornaldasviagens Friend
    #516421

    Hello Luna,

    Thanks a lot for your reply. I not much of a coder…

    i found line 202 sort($ranges,SORT_NUMERIC);

    and as you sugested i changed it to:
    sort($ranges,SORT_REGULAR);

    But it didn´t help.

    Could you help?

    thakz and merry Christmas


    1. screen-capture
    Luna Garden Moderator
    #516454

    Hi JL,

    First of all, Merry Christmas.

    And the second, I’ll try explain what I said in previous post,
    but please roll back what you did
    <blockquote>you sugested i changed it to:
    sort($ranges,SORT_REGULAR);</blockquote>

    Please go to file:

    modulesmod_jak2filterhelper.php
    Find this line:

    @sort( $values, SORT_REGULAR );
    in about line 422.
    Comment out it, means, change above line to:

    /*@sort( $values, SORT_REGULAR );*/

    Hope you understand. If it doesn’t work, PM me your site URL, admin account and FTP account.

    jornaldasviagens Friend
    #516611

    Hello Luna,

    well I thank you for your clear explanation about the “comment out”.

    But the true is: my helper.php does not include the line you mention.

    Maybe the attached copy of helper.php helps us to detect the problem.

    Can we solve the problem with this file?

    If not, i have to ask permittion to my client to share the logs.

    Thankz a lot!

    JL


    1. helper.php_.zip
    Luna Garden Moderator
    #516646

    Hi,

    Sorry, I said the wrong file.

    Please go to:
    modulesmod_jak2filterhelper.php
    and comment out this line (about line 377):

    usort($values, array($this, 'strcmp'));

    jornaldasviagens Friend
    #516758

    It Worked!

    Thanks a lot Luna

    JL

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

This topic contains 9 replies, has 2 voices, and was last updated by  jornaldasviagens 10 years, 11 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum