test
Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • ilet Friend
    #720875

    Couple questions

    1. I loved the old K2 search module how I could order by increase or decreased as default. How can I do this with the new update? I don’t want the user to choose. ex. I’m ranking items. 10 being the highest. I want to order an extrafield called “ranking” to start with the highest to lowest (which is decrease, but increase is default). but then I have another field where I want the opposite.

    2. numeric ordering doesn’t seem to be working. can you check my site. I’m not sure if I set it up correctly.

    I saw another post about fixing ordering method, but that doesn’t solve my problem.

    3. is it possible to rename “increase” “decrease” per extrafield. I want one to say “Best” “least” and another “Highest” “lowest”

    Luna Garden Moderator
    #721184

    Hi,

    Thanks for your feedback, here is my answer, hope that it could help you.
    <blockquote>1. I loved the old K2 search module how I could order by increase or decreased as default. How can I do this with the new update? I don’t want the user to choose. ex. I’m ranking items. 10 being the highest. I want to order an extrafield called “ranking” to start with the highest to lowest (which is decrease, but increase is default). but then I have another field where I want the opposite.</blockquote>
    Because of Increase and Decrease of one field make the order list seem too long, so we improve the order list, make it easy to use. I’ll discuss with the developer if we could make the default order to ASC or DESC base on one each field

    <blockquote>2. numeric ordering doesn’t seem to be working. can you check my site. I’m not sure if I set it up correctly.</blockquote>
    It seems only order by Ranking isn’t correct, cause you insert ‘.’ (dot) to this extra field, so you must set the Type is String, not Numberic. Order numberic only works with number type Interger

    <blockquote>3. is it possible to rename “increase” “decrease” per extrafield. I want one to say “Best” “least” and another “Highest” “lowest” </blockquote>
    It’s impossible, you can only change all field to the same Name, you can not specified them. In order to change name, go to file: languageen-GBen-GB.mod_jak2filter.ini find for:


    JAK2DESC = "Decrease";
    JAK2ASC = "Increase";

    Change as you want

    Luna Garden Moderator
    #721204

    Hi,

    Thanks for your feedback, here is my answer, hope that it could help you.
    <blockquote>1. I loved the old K2 search module how I could order by increase or decreased as default. How can I do this with the new update? I don’t want the user to choose. ex. I’m ranking items. 10 being the highest. I want to order an extrafield called “ranking” to start with the highest to lowest (which is decrease, but increase is default). but then I have another field where I want the opposite.</blockquote>
    Because of Increase and Decrease of one field make the order list seem too long, so we improve the order list, make it easy to use. I’ll discuss with the developer if we could make the default order to ASC or DESC based on each field

    <blockquote>2. numeric ordering doesn’t seem to be working. can you check my site. I’m not sure if I set it up correctly.</blockquote>
    It seems only order by Ranking isn’t correct, cause you insert ‘.’ (dot) to this extra field, so you must set the Type is String, not Numberic. Order numberic only works with number type Interger

    <blockquote>3. is it possible to rename “increase” “decrease” per extrafield. I want one to say “Best” “least” and another “Highest” “lowest” </blockquote>
    It’s impossible, you can only change all field to the same Name, you can not specified them. In order to change name, go to file: languageen-GBen-GB.mod_jak2filter.ini find for:


    JAK2DESC = "Decrease";
    JAK2ASC = "Increase";

    Change as you want

    Luna Garden Moderator
    #753586

    Hi,

    Thanks for your feedback, here is my answer, hope that it could help you.
    <blockquote>1. I loved the old K2 search module how I could order by increase or decreased as default. How can I do this with the new update? I don’t want the user to choose. ex. I’m ranking items. 10 being the highest. I want to order an extrafield called “ranking” to start with the highest to lowest (which is decrease, but increase is default). but then I have another field where I want the opposite.</blockquote>
    Because of Increase and Decrease of one field make the order list seem too long, so we improve the order list, make it easy to use. I’ll discuss with the developer if we could make the default order to ASC or DESC based on each field

    <blockquote>2. numeric ordering doesn’t seem to be working. can you check my site. I’m not sure if I set it up correctly.</blockquote>
    It seems only order by Ranking isn’t correct, cause you insert ‘.’ (dot) to this extra field, so you must set the Type is String, not Numberic. Order numberic only works with number type Interger

    <blockquote>3. is it possible to rename “increase” “decrease” per extrafield. I want one to say “Best” “least” and another “Highest” “lowest” </blockquote>
    It’s impossible, you can only change all field to the same Name, you can not specified them. In order to change name, go to file: languageen-GBen-GB.mod_jak2filter.ini find for:


    JAK2DESC = "Decrease";
    JAK2ASC = "Increase";

    Change as you want

    ilet Friend
    #721362

    another question. K2 does not have a numeric field. In order to get commas correctly in the front-end I have to input commas in the back-end value. this breaks k2 filter. Is there a work around where I can have both K2 and K2 filter show commas and decimals in the front-end? Currently I have it likes this: K2 extrafield : 2000 => front displays 2000 (no comma)– in order to get k2 filter to work.

    ilet Friend
    #753697

    another question. K2 does not have a numeric field. In order to get commas correctly in the front-end I have to input commas in the back-end value. this breaks k2 filter. Is there a work around where I can have both K2 and K2 filter show commas and decimals in the front-end? Currently I have it likes this: K2 extrafield : 2000 => front displays 2000 (no comma)– in order to get k2 filter to work.

    Luna Garden Moderator
    #721563

    Hi,

    My mistake, I have discussed with the developer again and he has confirmed that JA K2 Filter can order with Numberic that has commas like decimals. Please set Extra Field Data Type of Extra Field back to Numberic (if you set it to Alphabet to make Order works with decimals)

    At this time, JA k2 Filter get this error, please apply the fix to JA K2 Filter on your site: http://www.joomlart.com/forums/topic/jak2filter-ordering-not-working/#post-706156 Maybe this is the reason the filter doesn’t show the right order on your site.

    We’ll add this fix in next version.

    Luna Garden Moderator
    #753810

    Hi,

    My mistake, I have discussed with the developer again and he has confirmed that JA K2 Filter can order with Numberic that has commas like decimals. Please set Extra Field Data Type of Extra Field back to Numberic (if you set it to Alphabet to make Order works with decimals)

    At this time, JA k2 Filter get this error, please apply the fix to JA K2 Filter on your site: http://id.joomlart.com/forums/topic/jak2filter-ordering-not-working/#post-706156 Maybe this is the reason the filter doesn’t show the right order on your site.

    We’ll add this fix in next version.

    ilet Friend
    #723867

    Hi, Is there a way to make the decrease radio input default? I have a field called popular based on a number, and I want to an option to sort by popularity. The bigger the number the higher the rank, so I want it decrease by default. Thanks.

    ilet Friend
    #754312

    Hi, Is there a way to make the decrease radio input default? I have a field called popular based on a number, and I want to an option to sort by popularity. The bigger the number the higher the rank, so I want it decrease by default. Thanks.

    Mo0nlight Moderator
    #723926

    Hi ilet.

    You can try this:

    edit the file : /modules/mod_jak2filter/tmpl/default.php

    line : 359-381
    change

    if (!jQuery('#jak2filter<?php echo $module->id;?>').find('li').length) {
    jQuery(this).parent('li').after(
    '
    <li class="fssorts" data-of="' + jQuery(this).val() + '"> ' +
    '<div class="title"><h6>' + jQuery(this).find('option:selected').html() + '</h6></div>' +
    ' '
    + (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp']) === -1 ? '
    <div class="group-controls">
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="" name="orders[' + jQuery(this).val() + ']" value="' + jQuery(this).val() + '" /><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p>
    </div>
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p>
    </div>
    </div>
    ' : '' +
    '<div class="group-controls"><div class="controls"><input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="checked" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div></div>')
    + '
    <div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
    </li>
    ');
    }

    To

    if (!jQuery('#jak2filter<?php echo $module->id;?>').find('li').length) {
    checkeddesc='';
    checkedasc=' checked="" ';
    if (jQuery(this).val().search('xf') !== -1) {
    checkeddesc=' checked="" ';
    checkedasc='';
    }
    jQuery(this).parent('li').after(
    '
    <li class="fssorts" data-of="' + jQuery(this).val() + '"> ' +
    '<div class="title"><h6>' + jQuery(this).find('option:selected').html() + '</h6></div>' +
    ' '
    + (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp']) === -1 ? '
    <div class="group-controls">
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" '+checkedasc+' name="orders[' + jQuery(this).val() + ']" value="' + jQuery(this).val() + '" /><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p>
    </div>
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" '+checkeddesc+' name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p>
    </div>
    </div>
    ' : '' +
    '<div class="group-controls"><div class="controls"><input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="checked" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div></div>')
    + '
    <div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
    </li>
    ');
    }

    Focus on this code :

    checkeddesc='';
    checkedasc=' checked="" ';
    if (jQuery(this).val().search('xf') !== -1) {
    checkeddesc=' checked="" ';
    checkedasc='';
    }

    ——————————————————————————————————

    if you want all the field had descending order change to this :

    checkeddesc=' checked="" ';
    checkedasc='';

    ——————————————————————————————————
    if you want some field has descending order only:
    You just need to edit the line

    if (jQuery(this).val().search('xf') !== -1) {

    for example

    if (jQuery(this).val().search('xf') !== -1) {
    This mean all the extra field will had descending order.
    if you want some extra field not all.
    change to

    if (jQuery(this).val().search('xf1|xf2|xf3|xf4') !== -1) {
    1,2,3,4… mean id of extra field. you can find in administrator

    just add more field like that.
    It’s a littble bit tricky.
    If you find it’s difficult. you can pm me ftp account so i can edit for you.

    Regards.

    BigHug Friend
    #754367

    Hi ilet.

    You can try this:

    edit the file : /modules/mod_jak2filter/tmpl/default.php

    line : 359-381
    change

    if (!jQuery('#jak2filter<?php echo $module->id;?>').find('li').length) {
    jQuery(this).parent('li').after(
    '
    <li class="fssorts" data-of="' + jQuery(this).val() + '"> ' +
    '<div class="title"><h6>' + jQuery(this).find('option:selected').html() + '</h6></div>' +
    ' '
    + (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp']) === -1 ? '
    <div class="group-controls">
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="" name="orders[' + jQuery(this).val() + ']" value="' + jQuery(this).val() + '" /><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p>
    </div>
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p>
    </div>
    </div>
    ' : '' +
    '<div class="group-controls"><div class="controls"><input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="checked" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div></div>')
    + '
    <div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
    </li>
    ');
    }

    To

    if (!jQuery('#jak2filter<?php echo $module->id;?>').find('li').length) {
    checkeddesc='';
    checkedasc=' checked="" ';
    if (jQuery(this).val().search('xf') !== -1) {
    checkeddesc=' checked="" ';
    checkedasc='';
    }
    jQuery(this).parent('li').after(
    '
    <li class="fssorts" data-of="' + jQuery(this).val() + '"> ' +
    '<div class="title"><h6>' + jQuery(this).find('option:selected').html() + '</h6></div>' +
    ' '
    + (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp']) === -1 ? '
    <div class="group-controls">
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" '+checkedasc+' name="orders[' + jQuery(this).val() + ']" value="' + jQuery(this).val() + '" /><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p>
    </div>
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" '+checkeddesc+' name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p>
    </div>
    </div>
    ' : '' +
    '<div class="group-controls"><div class="controls"><input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="checked" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div></div>')
    + '
    <div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
    </li>
    ');
    }

    Focus on this code :

    checkeddesc='';
    checkedasc=' checked="" ';
    if (jQuery(this).val().search('xf') !== -1) {
    checkeddesc=' checked="" ';
    checkedasc='';
    }

    ——————————————————————————————————

    If you want all fields have descending order change to this :

    checkeddesc=' checked="" ';
    checkedasc='';

    ——————————————————————————————————
    if you want some field has descending order only:
    You just need to edit the line

    if (jQuery(this).val().search('xf') !== -1) {

    for example

    if (jQuery(this).val().search('xf') !== -1) {
    This mean all the extra field will had descending order.
    if you want some extra field not all.
    change to

    if (jQuery(this).val().search('xf1|xf2|xf3|xf4') !== -1) {
    1,2,3,4… mean id of extra field. you can find in administrator

    just add more field like that.
    It’s a littble bit tricky.
    If you find it’s difficult. you can pm me ftp account so i can edit for you.

    Regards

    ilet Friend
    #724187

    Thank you. This worked. Now is there a way to add a descending numeric order option for a JA K2 menu item? All I see is ascending. I want my category item view to be ordered by descending by default.

    ilet Friend
    #754536

    Thank you. This worked. Now is there a way to add a descending numeric order option for a JA K2 menu item? All I see is ascending. I want my category item view to be ordered by descending by default.

    Mo0nlight Moderator
    #724865

    Hi ilet.

    You can active the old options.
    edit the file : /modules/mod_jak2filter/helper.php
    line :
    1404 : // $options[] = JHtml::_(‘select.option’, ‘ralpha’, JText::_(‘JAK2_TITLE_REVERSEALPHABETICAL’));
    1406 : // $options[] = JHtml::_(‘select.option’, ‘rorder’, JText::_(‘JAK2_ORDERING_REVERSE’));
    1450 : // $options[] = JHtml::_(‘select.option’, ‘rxf’.$item->id, JText::sprintf(‘XFIELD_ORDER_DESCENDING’, $item->name));
    1453 : // $options[] = JHtml::_(‘select.option’, ‘rxf’.$item->id, JText::sprintf(‘XFIELD_ORDER_REVERSE_ALPHABETICAL’, $item->name));

    remove the comment “//”

    And edit the file : components/com_jak2filter/models/itemlist.php
    line : 361-364
    Move the code

    if (empty($order_fields)) { // set default ordering if no ordering choosen.
    if ($jaK2FilterParams->get('catOrdering'))
    $order_fields[$jaK2FilterParams->get('catOrdering')] = $jaK2FilterParams->get('catOrdering');
    }

    To line : 63.

    $xf = '';
    $xfJoin = " LEFT JOIN #__jak2filter_taxonomy_map jatm ON jatm.item_id = i.id";
    $orderby=array();
    if (empty($order_fields)) { // set default ordering if no ordering choosen.
    if ($jaK2FilterParams->get('catOrdering'))
    $order_fields[$jaK2FilterParams->get('catOrdering')] = $jaK2FilterParams->get('catOrdering');
    }
    foreach ($order_fields AS $of => $vof) {

    That’s all.

    This feature with order is in under development stage, we’re trying to improve it better. And it’ll be updated in upcoming release version.

    Regards.

Viewing 15 posts - 1 through 15 (of 16 total)

This topic contains 16 replies, has 4 voices, and was last updated by  BigHug 9 years ago.

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