Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • virteer Friend
    #159033

    Hi there,
    I have an extra field named Location which holds the k2 items city.
    Since there are many cities in this project it would be crazy to enter in every single city.
    Therefore only the required ones are entered in the k2 extra fields drop-down selection.
    For Example:
    City A
    City D
    City E

    This is easy to setup initially as having the order correct. However, if later on I need another city that is before City E then the city order is no longer alphabetical.
    For Example:
    City A
    City D
    City E
    City B

    My question is, how can I re-order this options in the JA K2 Search module to be alphabetical again whilst retaining the correct City value?

    thuanlq Friend
    #373145

    Dear @virteer,

    Currently, ja k2 search module show k2 extra fields drop-down as it is, without the alphabetical ordering. However you can make it work by yourself, please do as following:

    – Open “default.php” file in folder “modulesmod_jak2_filtertmpl”.
    – Change line code


    switch ($extrafield->type)

    {
    ...
    case 'select':
    ...

    }

    to


    switch ($extrafield->type)

    {
    ...
    case 'select':
    /*Added there lines code to sort by alphabe*/
    if(!empty($extrafield->options))
    {
    $tmpArray = array();
    $array = array();
    $options = array();
    foreach($extrafield->options as $item)
    {
    $tmpArray[] = $item->text;
    $array[$item->text] = $item;
    }
    sort($tmpArray);
    foreach($tmpArray as $item)
    {
    $options[] = $array[$item];
    }
    $extrafield->options = $options;
    }
    /*End updated*/
    ...

    }

    virteer Friend
    #374076

    Thankyou Thankyou Thankyou!!! 😀

    I tried for days to do this. It’s all about the syntax!

    Excellent work 🙂

    kbrookes Friend
    #508457

    Hi there,

    Will this method work in the current version of the module?

    Luna Garden Moderator
    #508560

    Hi Kbrookes,

    Unfortunately, current version is different from the old one, so above method doesn’t work anymore.

    We will consider to include this feature on next version.

    netguide Friend
    #508611

    Hi,

    there is a solution for the last version (2013)?

    Luna Garden Moderator
    #508687

    <em>@netguide 393093 wrote:</em><blockquote>Hi,

    there is a solution for the last version (2013)?</blockquote>

    The new one is so different from previous and it takes time, please wait for the upcoming version.

    rsystems Friend
    #508722

    <em>@Luna Garden 393194 wrote:</em><blockquote>The new one is so different from previous and it takes time, please wait for the upcoming version.</blockquote>

    Can you add this feature to http://pm.joomlart.com/browse/JAK2FILTER ?

    Would like to see this in next version!

    Luna Garden Moderator
    #508865

    Yes, we’ve already lined up this feature in our system and it will be added in upcoming version.

    You can follow its status here: http://pm.joomlart.com/browse/JAK2FILTER-119

    rsystems Friend
    #509016

    Just a note: for me, 118 is the latest issue visible. pm.joomlart.com/browse/JAK2FILTER-118

    Luna Garden Moderator
    #509773

    Hello,

    Please check again, I have re-created this issue: http://pm.joomlart.com/browse/JAK2FILTER-119

    jornaldasviagens Friend
    #515980

    Well, i seem to have the opposite problem.

    The extrafilelds are listed in alpabethical order and i need to set then in the order i create them.

    What can bee wrong?

    I appreciate your attention

    JV

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

This topic contains 12 replies, has 7 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