Сборка Модули от offlajnstorе.com

А никто не пробовал сделать, чтобы при вставке из клипборда автоматом поиск начинался в ajax live search ?
 
Пожалуйста, перезалейте Universal Ajax Live Search 4.0.1
А то ссылка сдохла :(
 
Подскажите пожалуйста, как к Ajax Login подключить авторизацию через Вконтакте?
 
Вопрос по Universal Ajax Live Search.
Вчера увидел, что перестал выдавать результаты - в случае результата 0 у меня указано что данный товар не найден что и выводит. При нажатии на кнопку найти выдает:
registerEvent('onSearch', 'plgSearchVirtuemart'); $mainframe->registerEvent('onSearchAreas', 'plgSearchVirtuemartAreas'); } function &plgSearchVirtuemartAreas() { static $areas = array( 'vmxsearch' => 'Products' ); return $areas; } function plgSearchVirtuemart($text, $phrase='', $ordering='', $areas=null) { $db = & JFactory::getDBO(); $user = & JFactory::getUser(); if (is_array($areas)) { if (!array_intersect($areas, array_keys(plgSearchVirtuemartAreas()))) { return array(); } } // load plugin params info $plugin = & JPluginHelper::getPlugin('search', 'vmxsearch'); $pluginParams = new JParameter($plugin->params); $limit = $pluginParams->def('search_limit', 50); $text = trim($text); if ($text == '') { return array(); } $section = JText::_('Products'); $wheres = array(); switch ($phrase) { case 'exact': $text = $db->Quote('%' . $db->getEscaped($text, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.product_sku LIKE ' . $text; $wheres2[] = 'p.product_name LIKE ' . $text; $wheres2[] = 'p.product_s_desc LIKE ' . $text; $wheres2[] = 'p.product_desc LIKE ' . $text; $wheres2[] = 'b.category_name 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[] = 'a.product_sku LIKE ' . $word; $wheres2[] = 'p.product_name LIKE ' . $word; $wheres2[] = 'p.product_s_desc LIKE ' . $word; $wheres2[] = 'p.product_desc LIKE ' . $word; $wheres2[] = 'b.category_name LIKE ' . $word; $wheres[] = implode(' OR ', $wheres2); } $where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')'; break; } switch ($ordering) { case 'alpha': $order = 'p.product_name ASC'; break; case 'category': $order = 'b.category_name ASC, a.product_name ASC'; break; case 'popular': $order = 'p.product_name ASC'; break; case 'newest': $order = 'a.created_on DESC'; break; case 'oldest': $order = 'a.created_on ASC'; break; default: $order = 'p.product_name DESC'; } $text = $db->Quote('%' . $db->getEscaped($text, true) . '%', false); $query = "SELECT DISTINCT p.product_name AS title, a.virtuemart_product_id , b.virtuemart_category_id , media.file_url AS product_full_image, p.product_s_desc AS text, b.category_name as section, a.created_on as created, '2' AS browsernav FROM #__virtuemart_products AS a LEFT JOIN #__virtuemart_products_".VMLANG." p ON p.virtuemart_product_id = a.virtuemart_product_id LEFT JOIN #__virtuemart_product_categories AS xref ON xref.virtuemart_product_id = a.virtuemart_product_id LEFT JOIN #__virtuemart_categories_".VMLANG." AS b ON b.virtuemart_category_id = xref.virtuemart_category_id LEFT JOIN #__virtuemart_product_medias AS pm ON pm.virtuemart_product_id = (SELECT IF(a.product_parent_id>0, a.product_parent_id, p.virtuemart_product_id)) LEFT JOIN #__virtuemart_medias AS media ON pm.virtuemart_media_id = media.virtuemart_media_id" . ' WHERE ' . $where .' GROUP BY a.virtuemart_product_id ' . ' ORDER BY ' . $order ; $db->setQuery($query, 0, $limit); $rows = $db->loadObjectList(); if ($rows) { foreach ($rows as $key => $row) { $rows[$key]->href = 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $row->virtuemart_product_id . '&virtuemart_category_id=' . $row->virtuemart_category_id; // $rows[$key]->text = $text; } } return $rows; } class plgSearchVirtuemart extends JPlugin { function onContentSearchAreas() { static $areas = array( 'virtuemart' => 'Products' ); return $areas; } /** * virtuemart Products Search method * * The sql must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav * @param string Target search string * @param string mathcing option, exact|any|all * @param string ordering option, newest|oldest|popular|alpha|category */ function onContentSearch($text, $phrase='', $ordering='', $areas=null) { $db = JFactory::getDbo(); $app = JFactory::getApplication(); $user = & JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $tag = JFactory::getLanguage()->getTag(); $searchText = $text; if (is_array($areas)) { if (!array_intersect($areas, array_keys($this->onContentSearchAreas()))) { return array(); } } // load plugin params info // $plugin = & JPluginHelper::getPlugin('search', 'virtuemart'); // $pluginParams = new JParameter($plugin->params); // $limit = $pluginParams->def('search_limit', 50); $limit = $this->params->def('search_limit', 50); /* TO do it work with date $nullDate = $db->getNullDate(); $date = JFactory::getDate(); $now = $date->toMySQL(); */ $text = trim($text); if ($text == '') { return array(); } $section = JText::_('Products'); $wheres = array(); switch ($phrase) { case 'exact': $text = $db->Quote('%' . $db->getEscaped($text, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.product_sku LIKE ' . $text; $wheres2[] = 'p.product_name LIKE ' . $text; /*$wheres2[] = 'p.product_s_desc LIKE ' . $text; $wheres2[] = 'p.product_desc LIKE ' . $text;*/ /*$wheres2[] = 'b.category_name 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[] = 'a.product_sku LIKE ' . $word; $wheres2[] = 'p.product_name LIKE ' . $word; /* $wheres2[] = 'p.product_s_desc LIKE ' . $word; $wheres2[] = 'p.product_desc LIKE ' . $word;*/ /*$wheres2[] = 'b.category_name LIKE ' . $word;*/ $wheres[] = implode(' OR ', $wheres2); } $where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')'; break; } switch ($ordering) { case 'alpha': $order = 'p.product_name ASC'; break; /*case 'category': $order = 'b.category_name ASC, a.product_name ASC'; break;*/ case 'popular': $order = 'p.product_name ASC'; break; case 'newest': $order = 'a.created_on DESC'; break; case 'oldest': $order = 'a.created_on ASC'; break; default: $order = 'p.product_name DESC'; } // search product /*$text = $db->Quote('%' . $db->getEscaped($text, true) . '%', false); $query = "SELECT DISTINCT CONCAT( p.product_name,' (',a.product_sku,')' ) AS title, a.virtuemart_product_id , b.virtuemart_category_id , media.file_url AS product_full_image, p.product_s_desc AS text, b.category_name as section, a.created_on as created, '2' AS browsernav FROM #__virtuemart_products AS a LEFT JOIN #__virtuemart_products_".VMLANG." p ON p.virtuemart_product_id = a.virtuemart_product_id LEFT JOIN #__virtuemart_product_categories AS xref ON xref.virtuemart_product_id = a.virtuemart_product_id LEFT JOIN #__virtuemart_categories_".VMLANG." AS b ON b.virtuemart_category_id = xref.virtuemart_category_id LEFT JOIN #__virtuemart_product_medias AS pm ON pm.virtuemart_product_id = (SELECT IF(a.product_parent_id>0, a.product_parent_id, p.virtuemart_product_id)) LEFT JOIN #__virtuemart_medias AS media ON pm.virtuemart_media_id = media.virtuemart_media_id" . ' WHERE ' . $where . ' ORDER BY ' . $order ;*/ // ,'
Цена: ',ROUND(pr.product_override_price, 2),'руб.' $text = $db->Quote('%' . $db->getEscaped($text, true) . '%', false); $query = "SELECT DISTINCT p.product_name AS title, a.virtuemart_product_id , b.virtuemart_category_id ,pr.product_override_price AS override_price,pr.product_price AS price, media.file_url AS product_full_image, p.product_s_desc AS text, b.category_name as section, a.created_on as created, '2' AS browsernav FROM #__virtuemart_products AS a LEFT JOIN #__virtuemart_products_".VMLANG." p ON p.virtuemart_product_id = a.virtuemart_product_id LEFT JOIN #__virtuemart_product_categories AS xref ON xref.virtuemart_product_id = a.virtuemart_product_id LEFT JOIN #__virtuemart_categories_".VMLANG." AS b ON b.virtuemart_category_id = xref.virtuemart_category_id LEFT JOIN #__virtuemart_product_prices AS pr ON pr.virtuemart_product_id = a.virtuemart_product_id LEFT JOIN #__virtuemart_product_medias AS pm ON pm.virtuemart_product_id = (SELECT IF(a.product_parent_id>0, a.product_parent_id, p.virtuemart_product_id)) LEFT JOIN #__virtuemart_medias AS media ON pm.virtuemart_media_id = media.virtuemart_media_id LEFT JOIN #__virtuemart_product_customfields AS c ON p.virtuemart_product_id = c.virtuemart_product_id" . ' WHERE ' . $where . 'AND a.published = 1 ' .' GROUP BY a.virtuemart_product_id ' . ' ORDER BY ' . $order ; $db->setQuery($query, 0, $limit); $rows = $db->loadObjectList(); if ($rows) { foreach ($rows as $key => $row) { $skidsum = round($row->override_price,2); $sum = round($row->price,2); if($skidsum > 0){$newsum = $skidsum.' грн.';} else{$newsum = $sum.' грн.';} $rows[$key]->href = 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $row->virtuemart_product_id . '&virtuemart_category_id=' . $row->virtuemart_category_id; $rows[$key]->textdescription = $rows[$key]->text; $rows[$key]->text = 'Цена: '.$newsum.''; } } return $rows; } }
пробовал заменить файлик по адресу
C:\xampp\htdocs\gigamart.com.ua\plugins\search\virtuemart\virtuemart.php на файл который публиковали ранее
Для просмотра ссылки Войди или Зарегистрируйся
но так же без результата. Подскажите пожалуйста в чем косяк? (до этого работало, последнее что редактировал - это был файл с сортировкой product.php)
_____________
Проблема оказалась с файлом C:\xampp\htdocs\gigamart.com.ua\plugins\search\virtuemart\virtuemart.php
установил отдельно чистую джумлу и виртуалмарт, заменил из него содержимое - теперь ищет правда со всеми косяками что и были до этого.
--------------------
Дополнение если у вас после нажатия ентера не появляется результаты то: в настройках плагина Target search page - выберите виртуал март
 
Последнее редактирование:
установил модуль Universal AJAX Live Search 4.0.1 для VM 2.0.2 товары выводит в "живом" поиске, но вот картинок этих товаров не выводит. В чем может быть проблема?
 
Последнее редактирование:
Назад
Сверху