Новости Joomla

Компонент View logs v.2.2.0

👩‍💻 Компонент View logs v.2.2.0.По горячим следам, рекомендациям и просьбам Joomla-сообщества компонент просмотра логов Joomla получил следующую версиюv.2.2.0. Что нового?- Обновление интерфейса: список логов сделан в виде таблицы, отображение дополнительной информации в списке файлов (время создания и последнего изменения, кнопки действий и их порядок) изменены и сделаны менее пёстрыми.- Добавлен поиск-фильтр по имени файла лога на странице. Находите нужный файл быстрее.- Большие файлы. Просмотр файла лога в модальном окне сохранён для файлов менее 1МБ. Возможность открыть файл в отдельном окне сохранена. Но используйте эту функцию с осторожностью: файлы объёмом 8-10мб ещё возможно открывать в браузере, но более крупные - не рекомендуется. Системные требования:- Совместимость с Joomla 6 и PHP 8.4.- Минимальная версия PHP по-прежнему 8.0.Страница расширенияGitHub расширения@joomlafeed#joomla #расширения

0 Пользователей и 1 Гость просматривают эту тему.
  • 2 Ответов
  • 1523 Просмотров
*

Flomik

  • Осваиваюсь на форуме
  • 18
  • 0 / 0
Есть хак выводящий цену товара в результатах поиска:

Файл plugins/search/vmxsearch.plugin.php или plugins/search/virtuemart.search.php (смотря у кого какой плагин активирован):

Строку: $query = "SELECT DISTINCT p.product_id, p.product_name as title,

Меняем на: $query = "SELECT DISTINCT p.product_id, p.product_name as title, pr.product_price as price,
 
После: LEFT JOIN #__vm_product_reviews r ON (r.product_id = p.product_id)

Вставляем: LEFT JOIN #__vm_product_price pr ON (pr.product_id = p.product_id)

Файл components/com_search/views/search/tmpl/default_results.php:

После:
if ( $result->href ) : ?>

</a>

<?php endif;

Вставляем:

if (isset($result->price) && $result->price != '' && $result->price != '0.00000') : ?>

 <b> - <?php echo round($this->escape($result->price),0); ?> руб. </b>

<?php endif;

Все работает, но есть нюанс: Вот, например, у меня несколько групп пользователей (3 группы), у каждой группы своя цена на товар. В итоге выводится цены всех трех групп. Как ограничить вывод только цены для текущего пользователя?
*

Flomik

  • Осваиваюсь на форуме
  • 18
  • 0 / 0
Re: Поиск с отображением цены товара
« Ответ #1 : 09.08.2012, 12:57:19 »
Нет вариантов?
*

vtx

  • Захожу иногда
  • 221
  • 19 / 0
Re: Поиск с отображением цены товара
« Ответ #2 : 13.08.2012, 17:26:34 »
в марте за это отвечает следующая функция
Код
	function show_price( $product_id, $hide_tax = false ) {
global $VM_LANG, $CURRENCY_DISPLAY,$vendor_mail;
$auth = $_SESSION['auth'];

$tpl = new $GLOBALS['VM_THEMECLASS']();

$product_name = htmlentities( $this->get_field($product_id, 'product_name'), ENT_QUOTES );
$tpl->set( 'product_id', $product_id );
$tpl->set( 'product_name', $product_name );
$tpl->set( 'vendor_mail', $vendor_mail );
$discount_info = $base_price = array();
$text_including_tax = '';

if( $auth['show_prices'] ) {
// Get the DISCOUNT AMOUNT
$discount_info = $this->get_discount( $product_id );
if( !$discount_info["is_percent"] && $discount_info["amount"] != 0 ) {
$discount_info["amount"] = $GLOBALS['CURRENCY']->convert($discount_info["amount"]);
}
// Get the Price according to the quantity in the Cart
$price_info = $this->get_price( $product_id );
$tpl->set( 'price_info', $price_info );

// Get the Base Price of the Product
$base_price_info = $this->get_price($product_id, true );
$tpl->set( 'base_price_info', $base_price_info );
if( $price_info === false ) {
$price_info = $base_price_info;
}
$html = "";
$undiscounted_price = 0;
if (isset($price_info["product_price_id"])) {
if( $base_price_info["product_price"]== $price_info["product_price"] ) {
$price = $base_price = $GLOBALS['CURRENCY']->convert( $base_price_info["product_price"], $price_info['product_currency'] );
} else {
$base_price = $GLOBALS['CURRENCY']->convert( $base_price_info["product_price"], $price_info['product_currency'] );
$price = $GLOBALS['CURRENCY']->convert( $price_info["product_price"], $price_info['product_currency'] );
}

if ($auth["show_price_including_tax"] == 1) {
$my_taxrate = $this->get_product_taxrate($product_id);
$base_price += ($my_taxrate * $base_price);
}
else {
$my_taxrate = 0;
}
// Calculate discount
if( !empty($discount_info["amount"])) {
$undiscounted_price = $base_price;
switch( $discount_info["is_percent"] ) {
case 0:
// If we subtract discounts BEFORE tax
if( PAYMENT_DISCOUNT_BEFORE == '1' ) {
// and if our prices are shown with tax
if( $auth["show_price_including_tax"] == 1) {
// then we add tax to the (untaxed) discount
$discount_info['amount'] += ($my_taxrate*$discount_info['amount']);
}
// but if our prices are shown without tax
// we just leave the (untaxed) discount amount as it is

}
// But, if we subtract discounts AFTER tax
// and if our prices are shown with tax
// we just leave the (untaxed) discount amount as it is
// but if  prices are shown without tax
// we just leave the (untaxed) discount amount as it is
// even though this is not really a good combination of settings

$base_price -= $discount_info["amount"];
break;
case 1:
$base_price *= (100 - $discount_info["amount"])/100;
break;
}
}
$text_including_tax = "";
if (!empty($my_taxrate)) {
$tax = $my_taxrate * 100;
// only show "including x % tax" when it shall
// not be hidden
if( !$hide_tax && $auth["show_price_including_tax"] == 1 && VM_PRICE_SHOW_INCLUDINGTAX) {
$text_including_tax = $VM_LANG->_('PHPSHOP_INCLUDING_TAX');
eval ("\$text_including_tax = \"$text_including_tax\";");
}
}

// Check if we need to display a Table with all Quantity <=> Price Relationships
if( $base_price_info["product_has_multiple_prices"] && !$hide_tax ) {
$db = new ps_DB;
// Quantity Discount Table
$q = "SELECT product_price, product_currency, price_quantity_start, price_quantity_end
FROM #__{vm}_product_price
  WHERE product_id='$product_id'
  AND shopper_group_id='".$auth["shopper_group_id"]."'
  ORDER BY price_quantity_start";
$db->query( $q );

//         $prices_table = "<table align=\"right\">
$prices_table = "<table width=\"100%\">
  <thead><tr class=\"sectiontableheader\">
  <th>".$VM_LANG->_('PHPSHOP_CART_QUANTITY')."</th>
  <th>".$VM_LANG->_('PHPSHOP_CART_PRICE')."</th>
  </tr></thead>
  <tbody>";
$i = 1;
if ($db->num_rows()==0) {
// get the vendor ID
$q = "SELECT vendor_id FROM #__{vm}_product WHERE product_id='$product_id'";
$db->setQuery($q); $db->query();
$db->next_record();
$vendor_id = $db->f("vendor_id");
// get the default shopper group ID
$q = "SELECT shopper_group_id FROM #__{vm}_shopper_group WHERE `vendor_id`='$vendor_id' AND `default`='1'";
$db->setQuery($q); $db->query();
$db->next_record();
$default_shopper_group_id = $db->f("shopper_group_id");
// get the current shopper group discount
$q = "SELECT * FROM #__{vm}_shopper_group WHERE shopper_group_id=" . $auth["shopper_group_id"];
$db->setQuery($q); $db->query();
$db->next_record();
$shopper_group_discount = $db->f("shopper_group_discount");
// check for prices in default shopper group
$q = "SELECT product_price, price_quantity_start, price_quantity_end, product_currency FROM #__{vm}_product_price
WHERE product_id='$product_id' AND shopper_group_id='".$default_shopper_group_id."' ORDER BY price_quantity_start";
$db->query( $q );
while( $db->next_record() ) {
$prices_table .= "<tr class=\"sectiontableentry$i\"><td>".$db->f("price_quantity_start")." - ".$db->f("price_quantity_end")."</td>";
$prices_table .= "<td>";
if (!empty($my_taxrate))
$prices_table .= $CURRENCY_DISPLAY->getFullValue( ($my_taxrate+1)*$db->f("product_price")*((100-$shopper_group_discount)/100) );
else
$prices_table .= $CURRENCY_DISPLAY->getFullValue( $db->f("product_price")*((100-$shopper_group_discount)/100) );
$prices_table .= "</td></tr>";
$i == 1 ? $i++ : $i--;
}
} else {
// get the current shopper group discount
$dbsg = new ps_DB();
$q = "SELECT * FROM #__{vm}_shopper_group WHERE shopper_group_id=" . $auth["shopper_group_id"];
$dbsg->setQuery($q);
$dbsg->query();
$dbsg->next_record();
$shopper_group_discount = $dbsg->f("shopper_group_discount");
while( $db->next_record() ) {
$price = $GLOBALS['CURRENCY']->convert( $db->f("product_price"), $db->f("product_currency") );
$prices_table .= "<tr class=\"sectiontableentry$i\"><td>".$db->f("price_quantity_start")." - ".$db->f("price_quantity_end")."</td>";
$prices_table .= "<td>";
if (!empty($my_taxrate)) {
$prices_table .= $CURRENCY_DISPLAY->getFullValue( ($my_taxrate+1)*$price*((100-$shopper_group_discount)/100) );
}
else {
$prices_table .= $CURRENCY_DISPLAY->getFullValue( $price*((100-$shopper_group_discount)/100) );
}
$prices_table .= "</td></tr>";
$i == 1 ? $i++ : $i--;
}
}
$prices_table .= "</tbody></table>";
if( @$_REQUEST['page'] != "shop.product_details" ) {
$html .= vmToolTip( $prices_table );
}
else
$html .= $prices_table;
}
}
}
$tpl->set( 'discount_info', $discount_info );
$tpl->set( 'text_including_tax', $text_including_tax );
$tpl->set( 'undiscounted_price', @$undiscounted_price );
$tpl->set( 'base_price', $base_price );
        $tpl->set( 'price_table', $html);
return $tpl->fetch( 'common/price.tpl.php');

}
прийдется упростить, и получите то, что Вам нужно.
но не суть, логика ясна
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Поиск для магазина автозапчастей как на Exist.ru!

Автор zzaj

Ответов: 21
Просмотров: 8913
Последний ответ 11.05.2016, 13:50:02
от Pahom72
Умный поиск по VirtueMart

Автор obua

Ответов: 2
Просмотров: 4458
Последний ответ 01.04.2015, 15:03:01
от supergun
Вывод товара из дочерних категорий в родительскую

Автор B0nG

Ответов: 0
Просмотров: 1876
Последний ответ 03.08.2014, 15:13:57
от B0nG
ID товара вместо cdata

Автор newsky

Ответов: 0
Просмотров: 1686
Последний ответ 01.07.2014, 13:05:12
от newsky
Расширенный Ajax-поиск по характеристикам товара VirtueMart

Автор Arkadiy

Ответов: 990
Просмотров: 209433
Последний ответ 27.06.2014, 16:47:52
от DeLight