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

Помогите плыз! Просмотрел почти весть форум, но ответа не нашел.  Как убрать кол-во товаров в категории но оставить в подкатегории- меню Virtuemart (mod_product_categories) может кто сталкивался или знает где копать. Через админку можно только  полностью отключить а мне нужно только убрать в основном меню но при раскрытии подкатегорий чтоб кол-во товаров осталось. В настройках модуля "Вид отображения категории" установлен в "список ссылок" (Joomla 1.0.15)
Нашел кусок кода в ps_product_category.php  отвечающий как мне кажется именно за это меню но, что там исправить не пойму не очень селен в PHP
Код
	/**
* This function is used for the frontend to display a
* complete link list of top-level categories
*
* @param int $category_id The category to be highlighted
* @param string $links_css_class The css class that marks mainlevel links
* @param string $list_css_class (deprecated)
* @param string $highlighted_style The css styles that format the hightlighted category
* @return string HTML code with the link list
*/
function get_category_tree( $category_id=0,
$links_css_class="mainlevel",
$list_css_class="mm123",
$highlighted_style="font-style:italic;" ) {
global $sess;

$categories = ps_product_category::getCategoryTreeArray(); // Get array of category objects
$result = ps_product_category::sortCategoryTreeArray($categories); // Sort array of category objects
$row_list = $result['row_list'];
$depth_list = $result['depth_list'];
$category_tmp = $result['category_tmp'];
$nrows = sizeof($category_tmp);

/** SECOND STEP
* Find out if we have subcategories to display
**/
$allowed_subcategories = Array();
if( !empty( $categories[$category_id]["category_parent_id"] ) ) {
// Find the Root Category of this category
$root = $categories[$category_id];
$allowed_subcategories[] = $categories[$category_id]["category_parent_id"];
// Loop through the Tree up to the root
while( !empty( $root["category_parent_id"] )) {
$allowed_subcategories[] = $categories[$root["category_child_id"]]["category_child_id"];
$root = $categories[$root["category_parent_id"]];
}
}
// Fix the empty Array Fields
if( $nrows < count( $row_list ) ) {
$nrows = count( $row_list );
}
$html = '';
// Now show the categories
for($n = 0 ; $n < $nrows ; $n++) {

if( !isset( $row_list[$n] ) || !isset( $category_tmp[$row_list[$n]]["category_child_id"] ) )
continue;
if( $category_id == $category_tmp[$row_list[$n]]["category_child_id"] )
$style = $highlighted_style;
else
$style = "";

$allowed = false;
if( $depth_list[$n] > 0 ) {
// Subcategory!
if( isset( $root ) && in_array( $category_tmp[$row_list[$n]]["category_child_id"], $allowed_subcategories )
|| $category_tmp[$row_list[$n]]["category_parent_id"] == $category_id
|| $category_tmp[$row_list[$n]]["category_parent_id"] == @$categories[$category_id]["category_parent_id"]) {
$allowed = true;

}
}
else
$allowed = true;
$append = "";
if( $allowed ) {
if( $style == $highlighted_style ) {
$append = 'id="active_menu"';
}
if( $depth_list[$n] > 0 )
$css_class = "sublevel";
else
$css_class = $links_css_class;

$catname = shopMakeHtmlSafe( $category_tmp[$row_list[$n]]["category_name"] );

$html .= '
          <a title="'.$catname.'" style="display:block;'.$style.'" class="'. $css_class .'" href="'. $sess->url(URL."index.php?page=shop.browse&amp;category_id=".$category_tmp[$row_list[$n]]["category_child_id"]) .'" '.$append.'>'
. str_repeat("&nbsp;&nbsp;&nbsp;",$depth_list[$n]) . $catname
. ps_product_category::products_in_category( $category_tmp[$row_list[$n]]["category_child_id"] )
.'</a>';
}
}

return $html;
}
Пожалуйста помогите очень надо, копаюсь два дня и все  безрезультатно.
Заранее благодарен всем кто ответит
« Последнее редактирование: 28.05.2009, 12:52:17 от De-Nis »
*

beagler

  • Moderator
  • 3276
  • 392 / 4
  • https://alorisman.ru/
попробуй в конце этой функции
Код
<a title="'.$catname.'" style="display:block;'.$style.'" class="'. $css_class .'" href="'. $sess->url(URL."index.php?page=shop.browse&amp;category_id=".$category_tmp[$row_list[$n]]["category_child_id"]) .'" '.$append.'>'
. str_repeat("&nbsp;&nbsp;&nbsp;",$depth_list[$n]) . $catname
. ps_product_category::products_in_category( $category_tmp[$row_list[$n]]["category_child_id"] )
.'</a>';
заменить на
Код
<a title="'.$catname.'" style="display:block;'.$style.'" class="'. $css_class .'" href="'. $sess->url(URL."index.php?page=shop.browse&amp;category_id=".$category_tmp[$row_list[$n]]["category_child_id"]) .'" '.$append.'>'
. str_repeat("&nbsp;&nbsp;&nbsp;",$depth_list[$n]) ;
if( empty( $category_tmp[$row_list[$n]]["category_parent_id"] ) ) {$html .= $catname;}
else  { $html .= ps_product_category::products_in_category( $category_tmp[$row_list[$n]]["category_child_id"] ); }
$html .= '</a>';
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Количество просмотров товара VirtueMart Существует?

Автор grishin

Ответов: 38
Просмотров: 9801
Последний ответ 22.08.2020, 08:44:29
от rsn
Поменять в ссылке index.php на алиас меню

Автор sashgera

Ответов: 0
Просмотров: 1350
Последний ответ 03.08.2020, 08:29:14
от sashgera
Не выводит списком Настраиваемое поле в VirtueMart 5.0

Автор ЛюдмилаМир

Ответов: 2
Просмотров: 1726
Последний ответ 25.08.2019, 16:27:04
от ЛюдмилаМир
Joomla VirtueMart помощь в переводе

Автор akkord31

Ответов: 0
Просмотров: 1694
Последний ответ 21.05.2019, 09:14:02
от akkord31
Миграция с Joomla 1.5 на 3 с VirtueMart 1.1.9 stable на свежую. Кто поможет?

Автор Гриша-Десантник

Ответов: 7
Просмотров: 1870
Последний ответ 23.04.2019, 10:22:25
от draff