Viewing 5 posts - 31 through 35 (of 35 total)
  • Author
    Posts
  • thangnn1510 Friend
    #402608

    Thanks for giving me all the info. After checking this is our solution. In the case of select extrafield you should add this code:

    <div class="detallename"><?php echo JText::_('Transacción'); ?>:<span><?php
    $db = &JFactory::getDBO();
    $query = "SELECT * FROM #__k2_items WHERE id=".$result->id;
    $db->setQuery($query);
    $items = $db->loadObjectList();
    if(count($items)>0){
    foreach($items as $item){
    $item = json_decode($item->extra_fields);
    $query = "SELECT value FROM #__k2_extra_fields WHERE id=".$item[9]->id;
    $db->setQuery($query);
    $value = $db->loadResult();
    $values = json_decode($value);
    foreach($item[9]->value as $k){
    if(count($values)>0){
    foreach($values as $value){
    if($value->value == $k){
    echo $value->name."<br>";
    }
    }
    }
    }
    }
    }
    ?></span></div>
    </div>

    I have changed it in your site. Others could use this similar code to apply to your site.

    Thanks and tell me if you need more help.

    jakkraphong Friend
    #403182

    where to put extrafield ids?

    thangnn1510 Friend
    #403233

    <em>@jakkraphong 255789 wrote:</em><blockquote>where to put extrafield ids?</blockquote>

    Could you explain more about your question? I don’t understand it much.

    jakkraphong Friend
    #406767

    <em>@thangnn1510 255070 wrote:</em><blockquote>Thanks for giving me all the info. After checking this is our solution. In the case of select extrafield you should add this code:

    <div class="detallename"><?php echo JText::_('Transacción'); ?>:<span><?php
    $db = &JFactory::getDBO();
    $query = "SELECT * FROM #__k2_items WHERE id=".$result->id;
    $db->setQuery($query);
    $items = $db->loadObjectList();
    if(count($items)>0){
    foreach($items as $item){
    $item = json_decode($item->extra_fields);
    $query = "SELECT value FROM #__k2_extra_fields WHERE id=".$item[9]->id;
    $db->setQuery($query);
    $value = $db->loadResult();
    $values = json_decode($value);
    foreach($item[9]->value as $k){
    if(count($values)>0){
    foreach($values as $value){
    if($value->value == $k){
    echo $value->name."<br>";
    }
    }
    }
    }
    }
    }
    ?></span></div>
    </div>

    I have changed it in your site. Others could use this similar code to apply to your site.

    Thanks and tell me if you need more help.</blockquote>

    i copied that into my default_result.php…. nothing happened… 🙁 i just would like the extra fields to appear side by side to the search result images, how can i do that? please heeeeeeeelp :laugh:

    espertoseo Friend
    #423553

    i need the same results

    is not possible to show k2 default search template? why?

    i’ve try to edit k2 filter php form query but doesn’t work..

    how can i create a query like this?

    index.php?searchword=custom+search&ordering=&searchphrase=all&areas[0]=jak2_filter&option=com_k2&task=search&view=itemlist

    that’s what many user want 🙂

Viewing 5 posts - 31 through 35 (of 35 total)

This topic contains 35 replies, has 8 voices, and was last updated by  espertoseo 13 years ago.

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