Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • tjckelly Friend
    #182483

    Hi,

    Could someone tell me please how to exclude a K2 category from search results?

    I have 2 categories (‘Vacancies’ and ‘Candidates’ ).

    When using the dropboxes to perform the search all works correctly – only ‘Vacancy’ results appear – but when using a keyword all results appear – I only need to see ‘Vacancies’.

    thanks in advance

    rsystems Friend
    #474008

    Same issue here.

    tjckelly Friend
    #474527

    Can anyone assist? I had hoped there would be some level of support since this was a paid plugin.

    rsystems Friend
    #474530

    Totally agree, I’m getting angry.

    MoonSailor Friend
    #474690

    Hi tjckelly, rsystems

    For now, module can’t exclude a K2 category from all categories. It will show all categories of k2 component.

    Regards

    Arvind Chauhan Moderator
    #474694

    I have discussed with the devs and we will explore the possibility to add the option to select / multi-select categories to show in the frontend drop down.

    I will get back to you with confirmation on this pretty soon.

    Arvind

    tjckelly Friend
    #474827

    Appreciate the response, thank you.

    I have been looking around some of the forums for other K2 searches and there are some examples of altering the php code as a workaround, for example:


    if ($this->site) {
    $where[] = ‘a.published = 1’;
    $where[] = ‘a.trash = 0’;

    Now add this code immediately below:

    $where[] = ‘NOT a.catid = 12’;

    I was wondering if I could do something similar in the meantime with the JAK2 search – but don’t know where to look to place the code – I’m not a programmer!

    regards

    Arvind Chauhan Moderator
    #474831

    Hi tjckelly,

    Give me a week, devs have principally agreed to add the feature and if all goes well.. it should be out by next week. We are closed for the weekend.

    Regards

    Arvind

    Arvind Chauhan Moderator
    #475142

    The select / multiselect k2 categories feature will be part of the next version.

    http://easycaptures.com/fs/uploaded/739/0073913373.png

    hope to release soon. There are 2-3 more features in this version.

    Regards

    Arvind

    rsystems Friend
    #475352

    Super, looking forward to update! 🙂

    MoonSailor Friend
    #475553

    Hi @tjckelly , @rsystems,

    JA K2Filter version 1.0.2 has been released. There are changes in name of this component in this new version so, currently, it cannot be updated via JAEM, we shall try to fix this soon.

    Please try to download and re-install this component again. More details of userguide for this component can be seen here: http://www.joomlart.com/forums/topic/userguide-ja-k2-filter-package-for-joomla-2-5-3-0/

    Let me know if I can be of futher assistance.

    Regards,

    Luffy T.

    iway2011 Friend
    #475559

    Hi darvinDC,
    I was serching something similar… and it comes perfectly in time. Good work.
    I just reinstalled this brand new release: it works fine, but I’m confused about the expected working.
    When I select the category search option in the frontend I correctly get the dropdown menu with my choosen categories, so I can search in my specific categories.
    The unexpected is that for a blank search (all items) the module displays results for all categories and not only for the selected ones.
    I think the categories you select in the backend should also restrict the default search…
    Is there anything wrong in my installation?
    How can I restrict my default search to specific categories?
    Thank you very much.

    MoonSailor Friend
    #475636

    Hi iway2011,

    Please download and re-install new version of k2 filter here :

    http://www.joomlart.com/forums/downloads.php?do=cat&id=20372

    and follow the userguide: http://www.joomlart.com/forums/topic/userguide-ja-k2-filter-package-for-joomla-2-5-3-0/

    Try it again and if problem still persists, PM me login credentials of site you’re working on (URL – Admin – FTP account), I shall check for you.

    Arvind Chauhan Moderator
    #475646

    Hi iway,

    Can you share your site url? where we can check this issue?

    Arvind

    MoonSailor Friend
    #475656

    Hi @iway2011,

    – Pls open file: /components/com_jak2filter/models/itemlist.php, find this function:

    [PHP]
    function prepareSearch($search) {
    [/PHP]

    go to line 816 change
    [PHP]
    if(JRequest::getInt(‘category_id’)){

    $ja_cid = JRequest::getInt(‘category_id’);
    $category = JTable::getInstance(‘K2Category’, ‘Table’);
    $category->load($ja_cid);
    $cparams = class_exists(‘JParameter’) ? new JParameter($category->params) : new JRegistry($category->params);

    if ($cparams->get(‘inheritFrom’))
    {

    $parent = JTable::getInstance(‘K2Category’, ‘Table’);
    $parent->load($cparams->get(‘inheritFrom’));
    $cparams = class_exists(‘JParameter’) ? new JParameter($parent->params) : new JRegistry($parent->params);
    }

    if ($cparams->get(‘catCatalogMode’))
    {
    $where[] = “i.catid = “.$db->quote($ja_cid).” “;
    }
    else
    {
    $categories = $this->getCategoryTree($ja_cid);
    $where[] = “i.catid IN (“.@implode(‘,’, $categories).”) “;
    }
    //$sql.= ” AND i.catid = “.$db->quote(JRequest::getVar(‘category_id’)).” “;
    }
    [/PHP]

    to

    [PHP]
    //Search by Category
    if(JRequest::getVar(‘category_id’)){
    $ja_cid = JRequest::getVar(‘category_id’);
    $ja_cids = explode(“,”,$ja_cid);
    $category = JTable::getInstance(‘K2Category’, ‘Table’);
    foreach($ja_cids AS $cid){
    $category->load($cid);
    $cparams = class_exists(‘JParameter’) ? new JParameter($category->params) : new JRegistry($category->params);

    if ($cparams->get(‘inheritFrom’))
    {

    $parent = JTable::getInstance(‘K2Category’, ‘Table’);
    $parent->load($cparams->get(‘inheritFrom’));
    $cparams = class_exists(‘JParameter’) ? new JParameter($parent->params) : new JRegistry($parent->params);
    }

    if ($cparams->get(‘catCatalogMode’))
    {
    $where[] = “i.catid = “.$db->quote($cid).” “;
    }
    else
    {
    $categories = $this->getCategoryTree($cid);
    $where[] = “i.catid IN (“.@implode(‘,’, $categories).”) “;
    }
    }
    //$sql.= ” AND i.catid = “.$db->quote(JRequest::getVar(‘category_id’)).” “;
    }
    [/PHP]

    – Open file: modules/mod_jak2filter/helper.php, find and replace this snippet of code:

    [PHP]
    public function getCategories($groupcategories){

    $cat_id = JRequest::getInt(‘category_id’,0);

    $categories_option[]=JHTML::_(‘select.option’, 0, JText::_(‘SELECT_CATEGORY_FRONT’));

    $categories = $this->categoriesTree($groupcategories,NULL, true, true);

    $categories_options=@array_merge($categories_option, $categories);

    $attribs = array(‘option.attr’ => ‘rel’, ‘option.key’ => ‘value’, ‘option.text’ => ‘text’,
    ‘list.attr’ => array(‘class’ => ‘inputbox’, ‘onchange’=>’jak2DisplayExtraFields(this);’),
    ‘list.select’ => $cat_id);

    //Important Note: do not add more parametter after $attribs, add them into $attribs
    $categories_html = JHTML::_(‘select.genericlist’, $categories_options, ‘category_id’, $attribs);

    return $categories_html;
    }
    [/PHP]

    With

    [PHP]
    public function getCategories($groupcategories){

    $cat_id = JRequest::getVar(‘category_id’,0);

    if(is_array($groupcategories)){
    if(($key = array_search(0, $groupcategories)) !== false) {
    unset($groupcategories[$key]);
    }
    $categories_option[]=JHTML::_(‘select.option’, implode(“,”,$groupcategories), JText::_(‘SELECT_CATEGORY_FRONT’));
    }else{
    $categories_option[]=JHTML::_(‘select.option’, 0, JText::_(‘SELECT_CATEGORY_FRONT’));
    }
    $categories = $this->categoriesTree($groupcategories,NULL, true, true);

    $categories_options=@array_merge($categories_option, $categories);

    $attribs = array(‘option.attr’ => ‘rel’, ‘option.key’ => ‘value’, ‘option.text’ => ‘text’,
    ‘list.attr’ => array(‘class’ => ‘inputbox’, ‘onchange’=>’jak2DisplayExtraFields(this);’),
    ‘list.select’ => $cat_id);

    //Important Note: do not add more parametter after $attribs, add them into $attribs
    $categories_html = JHTML::_(‘select.genericlist’, $categories_options, ‘category_id’, $attribs);

    return $categories_html;
    }
    [/PHP]

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

This topic contains 21 replies, has 5 voices, and was last updated by  MoonSailor 11 years, 10 months ago.

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