Целый день ушел на лопату для этого компонента. Там замудачено конечно=) Значит так файл components/com_universal_ajax_live_search/universal_ajax_live_search.php
Находишь строки
$searchresult[$pluginname][$i]->title = $value->title;
$searchresult[$pluginname][$i]->text = trim(mb_substr(strip_tags(preg_replace('/\{.*?\}(.*?\{\/.*?\})?/','',$value->text)),0,$introlength, 'UTF-8'))." ...";
$searchresult[$pluginname][$i]->href = html_entity_decode(JRoute::_($value->href));
Добавь
$searchresult[$pluginname][$i]->section = $value->section;
$searchresult[$pluginname][$i]->section_href = $value->cat;
$searchresult[$pluginname][$i]->ean = "(".$value->ean.")";
$searchresult[$pluginname][$i]->price = formatprice($value->price);
Правим plugins/search/joomshopping/joomshopping.php
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
error_reporting(E_ALL & ~E_NOTICE);
jimport('joomla.plugin.plugin');
class plgSearchJoomshopping extends JPlugin {
function onContentSearchAreas(){
static $areas = array(
'joomshopping' => 'JoomShopping'
);
return $areas;
}
function onContentSearch( $text, $phrase='', $ordering='', $areas=null )
{
require_once (JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS."lib".DS."factory.php");
require_once (JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS."lib".DS."functions.php");
$db =& JFactory::getDBO();
$user =& JFactory::getUser();
$lang = &JSFactory::getLang();
if (is_array($areas)) {
if (!array_intersect($areas, array_keys($this->onContentSearchAreas()))) {
return array();
}
}
$limit = $this->params->def( 'search_limit', 50 );
$text = trim( $text );
if ($text == '') {
return array();
}
switch ( $ordering ) {
case 'alpha':
$order = "prod.`".$lang->get('name')."` ASC";
break;
case 'newest':
$order = "prod.`product_date_added` DESC";
break;
case 'oldest':
$order = "prod.`product_date_added` ASC";
break;
case 'popular':
$order = "prod.`hits` DESC";
break;
case 'category':
$order = 'cat.`'.$lang->get('name').'` ASC, prod.`'.$lang->get('name').'` ASC';
break;
default:
$order = 'prod.product_id DESC';
}
switch ($phrase) {
case 'exact':
$text = $db->Quote($db->getEscaped( $text, true ).'%', false );
$wheres2 = array();
$wheres2[] = "prod.`".$lang->get('name')."` LIKE ".$text;
$wheres2[] = "prod.`".$lang->get('short_description')."` LIKE ".$text;
$wheres2[] = "prod.`".$lang->get('description')."` LIKE ".$text;
$wheres2[] = "prod.product_ean LIKE ".$text;
$where = '(' . implode( ') OR (', $wheres2 ). ')';
break;
case 'all':
case 'any':
default:
$words = explode( ' ', $text );
$wheres = array();
foreach ($words as $word) {
$word = $db->Quote( '%'.$db->getEscaped( $word, true ).'%', false );
$wheres2 = array();
$wheres2[] = "prod.`".$lang->get('name')."` LIKE ".$word;
$wheres2[] = "prod.`".$lang->get('short_description')."` LIKE ".$word;
$wheres2[] = "prod.`".$lang->get('description')."` LIKE ".$word;
$wheres2[] = "prod.product_ean LIKE ".$word;
$wheres[] = implode( ' OR ', $wheres2 );
}
$where = '(' . implode( ($phrase == 'all' ? ') AND (' : ') OR ('), $wheres ). ')';
break;
}
$query = "SELECT prod.product_id AS slug, pr_cat.category_id AS catslug, prod.`".$lang->get('name')."` as title,
CONCAT(prod.`".$lang->get('short_description')."`,' ',prod.`".$lang->get('description')."`) as text,
'2' AS browsernav,
prod.product_date_added AS created,
prod.product_thumb_image AS myimg,
cat.`".$lang->get('name')."` AS section,
prod.product_price AS price, prod.product_ean AS ean, prod.product_quantity, unit.`".$lang->get('name')."` AS `unit`
FROM `#__jshopping_products` AS prod
LEFT JOIN `#__jshopping_unit` AS `unit` ON prod.basic_price_unit_id = unit.id
LEFT JOIN `#__jshopping_products_to_categories` AS pr_cat ON pr_cat.product_id = prod.product_id
LEFT JOIN `#__jshopping_categories` AS cat ON pr_cat.category_id = cat.category_id
WHERE ($where) AND prod.product_publish = '1' AND prod.product_quantity > 0 AND cat.category_publish='1'
GROUP BY prod.product_id
ORDER BY $order
";
$db->setQuery( $query, 0, $limit );
$rows = $db->loadObjectList();
if ($rows){
foreach($rows as $key => $row) {
$rows[$key]->href = SEFLink('index.php?option=com_jshopping&controller=product&task=view&category_id='.$row->catslug.'&product_id='.$row->slug, 1);
$rows[$key]->image = JUri::Root().'components/com_jshopping/files/img_products/'.$row->myimg;
$rows[$key]->cat = SEFLink('index.php?option=com_jshopping&controller=category&task=view&category_id='.$row->catslug,1);
}
}
return $rows;
}
}
?>
И так мы к стандартному набору полей еще передали
$searchresult[$pluginname][$i]->section = $value->section; - назву категории
$searchresult[$pluginname][$i]->section_href = $value->cat; - ссылку на категорию
$searchresult[$pluginname][$i]->ean = "(".$value->ean.")"; - код
$searchresult[$pluginname][$i]->price = formatprice($value->price); - цену
Осталось только вывести в шаблону. Находим файлик modules/mod_universal_ajaxlivesearch/themes/AJAXSearchBase.js
ищем строку 372 код
if(pluginResults[j].product_img){ //Virtuemart products
atag = dojo.create("a", {'class': "result-element result-products", innerHTML: pluginResults[j].product_img+'<span>'+pluginResults[j].title+'</span>'+introText, href:pluginResults[j].href, target: (this.linktarget=="1" ? '_blank' : '') }, page);
}else{ // Other search results
atag = dojo.create("a", {'class': "result-element", innerHTML: '<span>'+pluginResults[j].title+'</span>'+introText, href:pluginResults[j].href}, page);
}
Вот тут надо или тупо взять мой код или учить dojo.
Вот мой кусочек
if(pluginResults[j].product_img){ //Virtuemart products
atag = dojo.create("a", {'class': "result-element result-products", innerHTML: pluginResults[j].product_img+'<span>'+pluginResults[j].title+'</span>'+'<span>'+introText+'</span><span>'+pluginResults[j].price+'</span>', href:pluginResults[j].href, target: (this.linktarget=="1" ? '_blank' : '') }, page);
}else{ // Other search results
atag = dojo.create("a", {'class': "result-element", innerHTML: '<span>'+pluginResults[j].title+'</span>'+introText, href:pluginResults[j].href}, page);
}
Конечно там надо править на Русский язык а то там Украинский или вообще в ленг добавить......ну это уже полет фантазий. Вот так вот! Спасибо!