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

Подскажите пожалуйста, до вчерашнего дня модуль Universal AJAX Live Search работал отлично, но сегодня обратил внимание что он работает только тогда когда произошла авторизация на сайте. Вчера колупался с Аккордеоном, єтот модуль не трогал, когда отключаю аккардеон - но результат тот же. Стояла версия 3.1, поменял на 4 всё тоже ( Блин не могу понять где сабака зарылась.

Косяк обнаружил из-за Mootools. Добавил в файл mod_universal_ajaxlivesearch.php строчку $document->addScript('media/system/js/mootools.js'). Где-то раньше намудрил, вот он и не подгружался.
 
Прошу уточнить - для какой версии VM этот плагин?
на 4 версии полёт нормальный. Кстати кто скажет, модуль Improved Ajax Login для Virtuemarta подходит? краем на него взглянул, напичканый эффектами, небыло возможности тестить для магазина.
 
Кто-то может поделиться рабочим файлом плагина, который выводит лишь 1 ,главное изображение

Замени код в файле \plugins\search\virtuemart\virtuemart.php
на этот
PHP:
<?php
 
/**
* @version        $Id: virtuemart.php $
* @package        Joomla
* @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license        GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
 
jimport( 'joomla.plugin' ) ;
if (!class_exists( 'VmConfig' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'config.php');
$config= VmConfig::loadConfig();
if(!class_exists('TableCategories')) require(JPATH_VM_ADMINISTRATOR.DS.'tables'.DS.'categories.php');
if (!class_exists( 'VirtueMartModelCategory' )) require(JPATH_VM_ADMINISTRATOR.DS.'models'.DS.'category.php');
if (!class_exists( 'VirtueMartModelProduct' )) require(JPATH_VM_ADMINISTRATOR.DS.'models'.DS.'product.php');
 
 
if(!version_compare(JVERSION,'1.6.0','ge')) {
    $mainframe->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 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 . '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) {
            $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_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) {
                $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;
    }
}
 
Замени код в файле \plugins\search\virtuemart\virtuemart.php
на этот
PHP:
<?php
 
/**
* @version        $Id: virtuemart.php $
* @package        Joomla
* @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license        GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
 
jimport( 'joomla.plugin' ) ;
if (!class_exists( 'VmConfig' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'config.php');
$config= VmConfig::loadConfig();
if(!class_exists('TableCategories')) require(JPATH_VM_ADMINISTRATOR.DS.'tables'.DS.'categories.php');
if (!class_exists( 'VirtueMartModelCategory' )) require(JPATH_VM_ADMINISTRATOR.DS.'models'.DS.'category.php');
if (!class_exists( 'VirtueMartModelProduct' )) require(JPATH_VM_ADMINISTRATOR.DS.'models'.DS.'product.php');
 
 
if(!version_compare(JVERSION,'1.6.0','ge')) {
    $mainframe->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 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 . '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) {
            $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_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) {
                $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;
    }
}

Спасибо за ответ! Ваш код работает, но я уже и сам это сделал) добавил группировку по товару.

Быть может, у Вас получилось вывести цену со скидкой в этом модуле?
 
Спасибо за ответ! Ваш код работает, но я уже и сам это сделал) добавил группировку по товару.

Быть может, у Вас получилось вывести цену со скидкой в этом модуле?


Вот я себе делал:
Скрытое содержимое доступно для зарегистрированных пользователей!


скидка учитывается в цене,можно еще сделать чтоб писало когда цена со скидкой и без но както руки не доходят
 

Вложения

  • virtuemart.zip
    2,9 KB · Просмотры: 51
Вот я себе делал:
скидка учитывается в цене,можно еще сделать чтоб писало когда цена со скидкой и без но както руки не доходят
Можете помочь?
Цена без скидки - выводится без учета курса валют.
Т.е. если в магазине все цены в одной валюте, то нет проблем.
А если две - как прописать, чтобы в поиске выводилось цена с учетом курса валют?
 
Вот я себе делал:


скидка учитывается в цене,можно еще сделать чтоб писало когда цена со скидкой и без но както руки не доходят
Спасибо большое, не мог ответить! Если Вы когда-нибудь такое и сделаете — буду очень признателен) Но рад и этому варианту, все отлично работает!
 
Спасибо большое, не мог ответить! Если Вы когда-нибудь такое и сделаете — буду очень признателен) Но рад и этому варианту, все отлично работает!
вот:
Код:
$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;
                $skidsum = round($row->override_price,2);
                $sum = round($row->price,2);
                if($skidsum > 0){$rows[$key]->text = 'Цена: '.$sum.' грн.</br>';$rows[$key]->text .= 'Цена со скидкой: '.$skidsum.' грн.';}
                else{$rows[$key]->text = 'Цена: '.$sum.' грн.';}
            }
        }
        return $rows;
      }
lQKWZPuh02TjqkixvMLPN5u_FAfaAnt5nmOR9RbTISRt3lrQafDkLS9Wb7NpwbvOxWg9Sq-WEMsHqPNt2p_8YA%3D%3D


выведет как нада,единственное нада больше сделать символов для описания,иначе не влезает цена со скидкой...

Вопрос как убрать ... в конце остается актуальным:att: как убрать так и не понял:(
 
выведет как нада,единственное нада больше сделать символов для описания,иначе не влезает цена со скидкой...
Вопрос как убрать ... в конце остается актуальным:att: как убрать так и не понял:(
Попробуй в настройках модуля - Основные параметры - изменить показатель Intro-text length скажем на 300 (по умолчанию стоит 50)

P.S. И все-таки вопрос (задавал чуть раньше) остается актуальным.
Повторюсь - у меня 2 валюты и по этому коду выводиться цена без скидки в USD - а как сделать, чтобы выводилась цена (без скидки) с учетом курса в валюте магазина - руб, грн или любой другой, которая назначена ..
Очень прошу помочь :thenks: !
 
Назад
Сверху