Новости Joomla

Человек на GitHub ускорил Joomla в 600 раз на объёме 150к+ материалов в 1700+ категориях

Человек на GitHub ускорил Joomla в 600 раз на объёме 150к+ материалов в 1700+ категориях

👩‍💻 Человек на GitHub ускорил Joomla в 600 раз на объёме 150к+ материалов в 1700+ категориях. На старте его сайт на Joomla 3 вообще не смог обновиться на Joomla 5. Пришлось делать экспорт/импорт материалов. Проделав всё это он запустил-таки этот объём данных на Joomla 5. Тестовый скрипт грузил 200 материалов из этого объёма всего за 94 секунды ))) А главная страница с категориями грузилась 20 секунд. Добавив индекс для таблицы #__content

CREATE INDEX idx_catid_state ON #__content (catid, state);
он сократил время загрузки категорий до 1 секунды. Затем наш герой решил поковырять SQL-запрос в ArticleModel, который отвечает за выборку материалов. И решил заменить тип JOIN на STRAIGHT_JOIN для категорий.
// ->from($db->quoteName('#__content', 'a'))->from(    $db->quoteName('#__content', 'a')    . ' STRAIGHT_JOIN ' . $db->quoteName('#__categories', 'c')    . ' ON ' . $db->quoteName('c.id') . ' = ' . $db->quoteName('a.catid'))// ->join('LEFT', $db->quoteName('#__categories', 'c'), $db->quoteName('c.id') . ' = ' . $db->quoteName('a.catid'))
Что сократило загрузку 200 материалов из 150к с 94 секунд до 5. К слову сказать, боевой сайт на Joomla 3 крутится на 12CPU 64GB рамы. А все манипуляции с кодом он делает на базовом 1CPU 1GB сервере и замеры скорости даны именно для базового сервера. Но это всё в дискуссии, хотя в идеале должно вылиться в Pull Requests. Мы - Open Source сообщество, где никто никому ничего не должен. Джунгли. Но человек ищет пути оптимизации Joomla и предлагает решения. Если оказать поддержку и предложить помощь хотя бы с тестированием самых разнообразных сценариев, то возможно эти улучшения смогут войти в ядро. Пусть не быстро, пусть через несколько лет, пусть не все, но войдут. Достаточно предложить руку помощи и приложить немного усилий.
Дискуссию на GitHub можно почитать здесь.@joomlafeed#joomla #community #php

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

permstyle

  • Захожу иногда
  • 148
  • 2 / 0
получается так, что в списке товаров категории фото не выводится у товара. а в самом товаре всё нормально.
вот исходный код, где выводиться  должна картинка.
Код
<a href="http://***/images/stories/virtuemart/product/br1.png"><img src="http://***/components/com_virtuemart/assets/images/vmgeneral/filetype_png.png" alt="" class="browseProductImage" title="Брюки" border="0"></a>
картинка должна быть из папки /images/stories/virtuemart/product/resized/*** а тут из компонента тащится.
в чём может быть проблема?
*

permstyle

  • Захожу иногда
  • 148
  • 2 / 0
проблема актуальна
*

jouser

  • Захожу иногда
  • 124
  • 9 / 0
либо у тебя проблема в файле категории \components\com_virtuemart\views\category\tmpl\default.php в этих строках
<?php /** @todo make image popup */
               echo $product->images[0]->displayMediaThumb ('class="browseProductImage" border="0" title="' . $product->product_name . '" ', TRUE, 'class="modal"');
               ?>
либо в функции displayMediaThumb в файле \administrator\components\com_virtuemart\helpers\mediahandler.php
Тут еще много зависит от твоего шаблона - там может лежать файл с категорией
« Последнее редактирование: 26.11.2012, 12:24:38 от jouser »
*

permstyle

  • Захожу иногда
  • 148
  • 2 / 0
либо у тебя проблема в файле категории \components\com_virtuemart\views\category\tmpl\default.php в этих строках
<?php /** @todo make image popup */
               echo $product->images[0]->displayMediaThumb ('class="browseProductImage" border="0" title="' . $product->product_name . '" ', TRUE, 'class="modal"');
               ?>
либо в функции displayMediaThumb в файле \administrator\components\com_virtuemart\helpers\mediahandler.php

спасибо за наводку. сейчас буду смотреть
просто нюанс в том что на одном сервере работало, при переносе на другой - перестало.
*

jouser

  • Захожу иногда
  • 124
  • 9 / 0
выложи код файла категории (тот который из твоего шаблона)
*

permstyle

  • Захожу иногда
  • 148
  • 2 / 0
Код
<?php
/**
*
* Show the products in a category
*
* @package VirtueMart
* @subpackage
* @author RolandD
* @author Max Milbers
* @todo add pagination
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2012 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart 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.
 * @version $Id: default.php 6104 2012-06-13 14:15:29Z alatak $
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

if ($this->category->haschildren) {

// Category and Columns Counter
$iCol = 1;
$iCategory = 1;

// Calculating Categories Per Row
$categories_per_row = VmConfig::get ( 'categories_per_row', 3 );
$category_cellwidth = ' width'.floor ( 100 / $categories_per_row );

// Separator
$verticalseparator = " vertical-separator";
?>

<div class="category-view">

<?php // Start the Output
if ($this->category->children ) {
    foreach ( $this->category->children as $category ) {

    // Show the horizontal seperator
    if ($iCol == 1 && $iCategory > $categories_per_row) { ?>
    <div class="horizontal-separator"></div>
    <?php }

    // this is an indicator wether a row needs to be opened or not
    if ($iCol == 1) { ?>
    <div class="row">
    <?php }

    // Show the vertical separator
    if ($iCategory == $categories_per_row or $iCategory % $categories_per_row == 0) {
    $show_vertical_separator = ' ';
    } else {
    $show_vertical_separator = $verticalseparator;
    }

    // Category Link
    $caturl = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id );

    // Show Category ?>
    <div class="category floatleft<?php echo $category_cellwidth . $show_vertical_separator ?>">
    <div class="spacer">
    <h2>
    <a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
    <?php echo $category->category_name ?>
    <br />
    <?php // if ($category->ids) {
    echo $category->images[0]->displayMediaThumb("",false);
    //} ?>
    </a>
    </h2>
    </div>
    </div>
    <?php
    $iCategory ++;

    // Do we need to close the current row now?
    if ($iCol == $categories_per_row) { ?>
    <div class="clear"></div>
    </div>
    <?php
    $iCol = 1;
    } else {
    $iCol ++;
    }
    }
}
// Do we need a final closing row tag?
if ($iCol != 1) { ?>
<div class="clear"></div>
</div>
<?php
}
?>
</div>
<?php } ?>
*

jouser

  • Захожу иногда
  • 124
  • 9 / 0
не то - то файл из папки categories а надо из папки category
*

permstyle

  • Захожу иногда
  • 148
  • 2 / 0
не то - то файл из папки categories а надо из папки category
прости..не внимательно смотрел.
Код
<?php
/**
 *
 * Show the products in a category
 *
 * @package    VirtueMart
 * @subpackage
 * @author RolandD
 * @author Max Milbers
 * @todo add pagination
 * @link http://www.virtuemart.net
 * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * VirtueMart 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.
 * @version $Id: default.php 6556 2012-10-17 18:15:30Z kkmediaproduction $
 */

//vmdebug('$this->category',$this->category);
vmdebug ('$this->category ' . $this->category->category_name);
// Check to ensure this file is included in Joomla!
defined ('_JEXEC') or die('Restricted access');
JHTML::_ ('behavior.modal');
/* javascript for list Slide
  Only here for the order list
  can be changed by the template maker
*/
$js = "
jQuery(document).ready(function () {
jQuery('.orderlistcontainer').hover(
function() { jQuery(this).find('.orderlist').stop().show()},
function() { jQuery(this).find('.orderlist').stop().hide()}
)
});
";

$document = JFactory::getDocument ();
$document->addScriptDeclaration ($js);

/*$edit_link = '';
if(!class_exists('Permissions')) require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'permissions.php');
if (Permissions::getInstance()->check("admin,storeadmin")) {
$edit_link = '<a href="'.JURI::root().'index.php?option=com_virtuemart&tmpl=component&view=category&task=edit&virtuemart_category_id='.$this->category->virtuemart_category_id.'">
'.JHTML::_('image', 'images/M_images/edit.png', JText::_('COM_VIRTUEMART_PRODUCT_FORM_EDIT_PRODUCT'), array('width' => 16, 'height' => 16, 'border' => 0)).'</a>';
}

echo $edit_link; */
if (empty($this->keyword)) {
?>
<div class="category_description">
<?php echo $this->category->category_description; ?>
</div>
<?php
}

/* Show child categories */

if (VmConfig::get ('showCategory', 1) and empty($this->keyword)) {
if ($this->category->haschildren) {

// Category and Columns Counter
$iCol = 1;
$iCategory = 1;

// Calculating Categories Per Row
$categories_per_row = VmConfig::get ('categories_per_row', 3);
$category_cellwidth = ' width' . floor (100 / $categories_per_row);

// Separator
$verticalseparator = " vertical-separator";
?>

<div class="category-view">

<?php // Start the Output
if (!empty($this->category->children)) {
foreach ($this->category->children as $category) {

// Show the horizontal seperator
if ($iCol == 1 && $iCategory > $categories_per_row) {
?>
<div class="horizontal-separator"></div>
<?php
}

// this is an indicator wether a row needs to be opened or not
if ($iCol == 1) {
?>
<div class="row">
<?php
}

// Show the vertical seperator
if ($iCategory == $categories_per_row or $iCategory % $categories_per_row == 0) {
$show_vertical_separator = ' ';
} else {
$show_vertical_separator = $verticalseparator;
}

// Category Link
$caturl = JRoute::_ ('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id);

// Show Category
?>
<div class="category floatleft<?php echo $category_cellwidth . $show_vertical_separator ?>">
<div class="spacer">
<h2>
<a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
<?php echo $category->category_name ?>
<br/>
<?php // if ($category->ids) {
echo $category->images[0]->displayMediaThumb ("", FALSE);
//} ?>
</a>
</h2>
</div>
</div>
<?php
$iCategory++;

// Do we need to close the current row now?
if ($iCol == $categories_per_row) {
?>
<div class="clear"></div>
</div>
<?php
$iCol = 1;
} else {
$iCol++;
}
}
}
// Do we need a final closing row tag?
if ($iCol != 1) {
?>
<div class="clear"></div>
</div>
<?php } ?>
</div>

<?php
}
}
?>
<div class="browse-view">
<?php
if (!empty($this->keyword)) {
?>
<h3><?php echo $this->keyword; ?></h3>
<?php
} ?>
<?php if ($this->search !== NULL) { ?>
<form action="<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=category&limitstart=0&virtuemart_category_id=' . $this->category->virtuemart_category_id); ?>" method="get">

<!--BEGIN Search Box -->
<div class="virtuemart_search">
<?php echo $this->searchcustom ?>
<br/>
<?php echo $this->searchcustomvalues ?>
<input name="keyword" class="inputbox" type="text" size="20" value="<?php echo $this->keyword ?>"/>
<input type="submit" value="<?php echo JText::_ ('COM_VIRTUEMART_SEARCH')?>" class="button" onclick="this.form.keyword.focus();"/>
</div>
<input type="hidden" name="search" value="true"/>
<input type="hidden" name="view" value="category"/>

</form>
<!-- End Search Box -->
<?php } ?>

<?php // Show child categories
if (!empty($this->products)) {
?>
<div class="orderby-displaynumber">
<div class="width70 floatleft">
<?php echo $this->orderByList['orderby']; ?>
<?php echo $this->orderByList['manufacturer']; ?>
</div>
<div class="width30 floatright display-number"><?php echo $this->vmPagination->getResultsCounter ();?><br/><?php echo $this->vmPagination->getLimitBox (); ?></div>
<div class="vm-pagination">
<?php echo $this->vmPagination->getPagesLinks (); ?>
<span style="float:right"><?php echo $this->vmPagination->getPagesCounter (); ?></span>
</div>

<div class="clear"></div>
</div> <!-- end of orderby-displaynumber -->

<h1><?php echo $this->category->category_name; ?></h1>

<?php
// Category and Columns Counter
$iBrowseCol = 1;
$iBrowseProduct = 1;

// Calculating Products Per Row
$BrowseProducts_per_row = $this->perRow;
$Browsecellwidth = ' width' . floor (100 / $BrowseProducts_per_row);

// Separator
$verticalseparator = " vertical-separator";

// Count products ?? why not just count ($this->products)  ?? note by Max Milbers
$BrowseTotalProducts = 0;
foreach ($this->products as $product) {
$BrowseTotalProducts++;
}

// Start the Output
foreach ($this->products as $product) {

// Show the horizontal seperator
if ($iBrowseCol == 1 && $iBrowseProduct > $BrowseProducts_per_row) {
?>
<div class="horizontal-separator"></div>
<?php
}

// this is an indicator wether a row needs to be opened or not
if ($iBrowseCol == 1) {
?>
<div class="row">
<?php
}

// Show the vertical seperator
if ($iBrowseProduct == $BrowseProducts_per_row or $iBrowseProduct % $BrowseProducts_per_row == 0) {
$show_vertical_separator = ' ';
} else {
$show_vertical_separator = $verticalseparator;
}

// Show Products
?>
<div class="product floatleft<?php echo $Browsecellwidth . $show_vertical_separator ?>">
<div class="spacer">
<div class="width30 floatleft center">
<?php /** @todo make image popup */
echo $product->images[0]->displayMediaThumb ('class="browseProductImage" border="0" title="' . $product->product_name . '" ', TRUE, 'class="modal"');
?>

<!-- The "Average Customer Rating" Part -->
<?php if ($this->showRating) { ?>
<span class="contentpagetitle"><?php echo JText::_ ('COM_VIRTUEMART_CUSTOMER_RATING')?>:</span>
<br/>
<?php
// $img_url = JURI::root().VmConfig::get('assets_general_path').'/reviews/'.$product->votes->rating.'.gif';
// echo JHTML::image($img_url, $product->votes->rating.' '.JText::_('COM_VIRTUEMART_REVIEW_STARS'));
// echo JText::_('COM_VIRTUEMART_TOTAL_VOTES').": ". $product->votes->allvotes;
?>
<?php } ?>
  <?php
if ( VmConfig::get ('display_stock', 1)) { ?>
<!-- if (!VmConfig::get('use_as_catalog') and !(VmConfig::get('stockhandle','none')=='none')){?> -->
<div class="paddingtop8">
<span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo $product->stock->stock_tip ?>"></span>
<span class="stock-level"><?php echo JText::_ ('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP')?></span>
</div>
<?php } ?>
</div>

<div class="width70 floatright">

<h2><?php echo JHTML::link ($product->link, $product->product_name); ?></h2>

<?php // Product Short Description
if (!empty($product->product_s_desc)) {
?>
<p class="product_s_desc">
<?php echo shopFunctionsF::limitStringByWord ($product->product_s_desc, 40, '...')?>
</p>
<?php } ?>

<div class="product-price marginbottom12" id="productPrice<?php echo $product->virtuemart_product_id ?>">
<?php
if ($this->show_prices == '1') {
if (empty($product->prices['salesPrice']) and VmConfig::get ('askprice', 1) and  !$product->images[0]->file_is_downloadable) {
echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
}
//todo add config settings
if ($this->showBasePrice) {
echo $this->currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $product->prices);
echo $this->currency->createPriceDiv ('basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $product->prices);
}
echo $this->currency->createPriceDiv ('variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $product->prices);
if (round($product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1])!= $product->prices['salesPrice']) {
echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $product->prices). "</span>";
}
if (round($product->prices['salesPriceWithDiscount'],$this->currency->_priceConfig['salesPrice'][1])!= $product->prices['salesPrice']) {
echo $this->currency->createPriceDiv ('salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $product->prices);
}
echo $this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
echo $this->currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices);
echo $this->currency->createPriceDiv ('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $product->prices);
echo $this->currency->createPriceDiv ('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $product->prices);
$unitPriceDescription = JText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', $product->product_unit);
echo $this->currency->createPriceDiv ('unitPrice', $unitPriceDescription, $product->prices);
} ?>

</div>

<p>
<?php // Product Details Button
echo JHTML::link ($product->link, JText::_ ('COM_VIRTUEMART_PRODUCT_DETAILS'), array('title' => $product->product_name, 'class' => 'product-details'));
?>
</p>

</div>
<div class="clear"></div>
</div>
<!-- end of spacer -->
</div> <!-- end of product -->
<?php

// Do we need to close the current row now?
if ($iBrowseCol == $BrowseProducts_per_row || $iBrowseProduct == $BrowseTotalProducts) {
?>
<div class="clear"></div>
   </div> <!-- end of row -->
<?php
$iBrowseCol = 1;
} else {
$iBrowseCol++;
}

$iBrowseProduct++;
} // end of foreach ( $this->products as $product )
// Do we need a final closing row tag?
if ($iBrowseCol != 1) {
?>
<div class="clear"></div>

<?php
}
?>

<div class="vm-pagination"><?php echo $this->vmPagination->getPagesLinks (); ?><span style="float:right"><?php echo $this->vmPagination->getPagesCounter (); ?></span></div>

<?php
} elseif ($this->search !== NULL) {
echo JText::_ ('COM_VIRTUEMART_NO_RESULT'). ($this->keyword ? ' : (' . $this->keyword . ')' : '');
}
?>
</div><!-- end browse-view -->
*

jouser

  • Захожу иногда
  • 124
  • 9 / 0
это файл из шаблона или из компонента?
*

permstyle

  • Захожу иногда
  • 148
  • 2 / 0
это именно из компонента
*

permstyle

  • Захожу иногда
  • 148
  • 2 / 0
вот из шаблона
Код
<?php
/**
*
* Show the products in a category
*
* @package VirtueMart
* @subpackage
* @author RolandD
* @author Max Milbers
* @todo add pagination
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart 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.
* @version $Id: default.php 6053 2012-06-05 12:36:21Z Milbo $
*/

//vmdebug('$this->category',$this->category);
vmdebug('$this->category '.$this->category->category_name);
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
JHTML::_( 'behavior.modal' );
/* javascript for list Slide
  Only here for the order list
  can be changed by the template maker
*/
$js = "
jQuery(document).ready(function () {
jQuery('.orderlistcontainer').hover(
function() { jQuery(this).find('.orderlist').stop().show()},
function() { jQuery(this).find('.orderlist').stop().hide()}
)
});
";

$document = JFactory::getDocument();
$document->addScriptDeclaration($js);

/*$edit_link = '';
if(!class_exists('Permissions')) require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'permissions.php');
if (Permissions::getInstance()->check("admin,storeadmin")) {
$edit_link = '<a href="'.JURI::root().'index.php?option=com_virtuemart&tmpl=component&view=category&task=edit&virtuemart_category_id='.$this->category->virtuemart_category_id.'">
'.JHTML::_('image', 'images/M_images/edit.png', JText::_('COM_VIRTUEMART_PRODUCT_FORM_EDIT_PRODUCT'), array('width' => 16, 'height' => 16, 'border' => 0)).'</a>';
}

echo $edit_link; */
?>

<h1 class="category-name"><?php echo $this->category->category_name; ?></h1>
<?php
if ( empty($this->keyword) ) {
?>
<div class="category_description">
<?php echo $this->category->category_description ; ?>
</div>
<?php
}

/* Show child categories */

if ( VmConfig::get('showCategory',1) and empty($this->keyword)) {
if ($this->category->haschildren) {

// Category and Columns Counter
$iCol = 1;
$iCategory = 1;

// Calculating Categories Per Row
$categories_per_row = VmConfig::get ( 'categories_per_row', 3 );
$category_cellwidth = ' width'.floor ( 100 / $categories_per_row );

// Separator
$verticalseparator = " vertical-separator";
?>

<div class="category-view">

<?php // Start the Output
if(!empty($this->category->children)){
foreach ( $this->category->children as $category ) {

// Show the horizontal seperator
if ($iCol == 1 && $iCategory > $categories_per_row) { ?>
<div class="horizontal-separator"></div>
<?php }

// this is an indicator wether a row needs to be opened or not
if ($iCol == 1) { ?>
<div class="row">
<?php }

// Show the vertical seperator
if ($iCategory == $categories_per_row or $iCategory % $categories_per_row == 0) {
$show_vertical_separator = ' ';
} else {
$show_vertical_separator = $verticalseparator;
}

// Category Link
$caturl = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id );

// Show Category ?>
<div class="category floatleft<?php echo $category_cellwidth . $show_vertical_separator ?>">
<div class="spacer">
<h2>
<a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
<?php echo $category->category_name ?>
<br />
<?php // if ($category->ids) {
echo $category->images[0]->displayMediaThumb("",false);
//} ?>
</a>
</h2>
</div>
</div>
<?php
$iCategory ++;

// Do we need to close the current row now?
if ($iCol == $categories_per_row) { ?>
<div class="clear"></div>
</div>
<?php
$iCol = 1;
} else {
$iCol ++;
}
}
}
// Do we need a final closing row tag?
if ($iCol != 1) { ?>
<div class="clear"></div>
</div>
<?php } ?>
</div>

<?php }
}
?>
<div class="browse-view">
    <?php
if (!empty($this->keyword)) {
?>
<h3><?php echo $this->keyword; ?></h3>
<?php
} ?>
  <?php if ($this->search !==null ) { ?>
    <form action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&limitstart=0&virtuemart_category_id='.$this->category->virtuemart_category_id ); ?>" method="get">

    <!--BEGIN Search Box -->
<div class="virtuemart_search">
    <div class="choose-product-type">
<?php echo $this->searchcustom ?>
</div>

    <?php echo $this->searchcustomvalues ?>
    <input name="keyword" class="inputbox" type="text" size="20" value="<?php echo $this->keyword ?>" />
    <input type="submit" value="<?php echo JText::_('COM_VIRTUEMART_SEARCH')?>" class="button" onclick="this.form.keyword.focus();"/>
    </div>
    <input type="hidden" name="search" value="true" />
    <input type="hidden" name="view" value="category" />

    </form>
<!-- End Search Box -->
<?php } ?>

<?php // Show child categories
if (!empty($this->products)) {
?>
<div class="orderby-displaynumber">
<div class="width70 floatleft">
<?php echo $this->orderByList['orderby']; ?>
<?php echo $this->orderByList['manufacturer']; ?>
</div>

<div class="width30 floatright display-number">
<div class="title"><?php echo $this->vmPagination->getResultsCounter();?></div><?php echo $this->vmPagination->getLimitBox(); ?>
</div>

<div class="vm-pagination">
<?php echo $this->vmPagination->getPagesLinks(); ?>
<span style="float:right"><?php echo $this->vmPagination->getPagesCounter(); ?></span>
</div>

</div> <!-- end of orderby-displaynumber -->

<?php
// Category and Columns Counter
$iBrowseCol = 1;
$iBrowseProduct = 1;

// Calculating Products Per Row
$BrowseProducts_per_row = $this->perRow;
$Browsecellwidth = ' width'.floor ( 100 / $BrowseProducts_per_row );

// Separator
$verticalseparator = " vertical-separator";

// Count products
$BrowseTotalProducts = 0;
foreach ( $this->products as $product ) {
   $BrowseTotalProducts ++;
}

// Start the Output
foreach ( $this->products as $product ) {

// Show the horizontal seperator
if ($iBrowseCol == 1 && $iBrowseProduct > $BrowseProducts_per_row) { ?>
<div class="horizontal-separator"></div>
<?php }

// this is an indicator wether a row needs to be opened or not
if ($iBrowseCol == 1) { ?>
<div class="row">
<?php }

// Show the vertical seperator
if ($iBrowseProduct == $BrowseProducts_per_row or $iBrowseProduct % $BrowseProducts_per_row == 0) {
$show_vertical_separator = ' ';
} else {
$show_vertical_separator = $verticalseparator;
}

// Show Products ?>
<div class="product floatleft<?php echo $Browsecellwidth . $show_vertical_separator ?>">
<div class="spacer">
<div class="floatleft center">
<?php /** @todo make image popup */
echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',true,'class="modal"');
?>


<!-- The "Average Customer Rating" Part -->
<?php if ($this->showRating) { ?>
<span class="contentpagetitle"><?php echo JText::_('COM_VIRTUEMART_CUSTOMER_RATING')?>:</span>
<?php
// $img_url = JURI::root().VmConfig::get('assets_general_path').'/reviews/'.$product->votes->rating.'.gif';
// echo JHTML::image($img_url, $product->votes->rating.' '.JText::_('COM_VIRTUEMART_REVIEW_STARS'));
// echo JText::_('COM_VIRTUEMART_TOTAL_VOTES').": ". $product->votes->allvotes; ?>
<?php } ?>

<?php
if (!VmConfig::get('use_as_catalog') and !(VmConfig::get('stockhandle','none')=='none') && (VmConfig::get ( 'display_stock', 1 )) ){?>
<!-- if (!VmConfig::get('use_as_catalog') and !(VmConfig::get('stockhandle','none')=='none')){?> -->
<div class="paddingtop8">
<span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo $product->stock->stock_tip ?>"></span>
<span class="stock-level"><?php echo JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP')?></span>
</div>
<?php }?>
</div>

<div class="product-info">

<div class="product-price marginbottom12" id="productPrice<?php echo $product->virtuemart_product_id ?>">
<?php
if ($this->show_prices == '1') {
if( $product->product_unit && VmConfig::get('vm_price_show_packaging_pricelabel')) {
echo "<strong>". JText::_('COM_VIRTUEMART_CART_PRICE_PER_UNIT').' ('.$product->product_unit."):</strong>";
}
if(empty($product->prices) and VmConfig::get('askprice',1) and empty($product->images[0]->file_is_downloadable) ){
echo JText::_('COM_VIRTUEMART_PRODUCT_ASKPRICE');
}
//todo add config settings
if( $this->showBasePrice){
echo $this->currency->createPriceDiv('basePrice','COM_VIRTUEMART_PRODUCT_BASEPRICE',$product->prices);
echo $this->currency->createPriceDiv('basePriceVariant','COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT',$product->prices);
}
//echo $this->currency->createPriceDiv('variantModification','COM_VIRTUEMART_PRODUCT_VARIANT_MOD',$product->prices);
//echo $this->currency->createPriceDiv('basePriceWithTax','COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX',$product->prices);
//echo $this->currency->createPriceDiv('discountedPriceWithoutTax','COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE',$product->prices);
//echo $this->currency->createPriceDiv('salesPriceWithDiscount','COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT',$product->prices);
echo $this->currency->createPriceDiv('salesPrice','',$product->prices);
//echo $this->currency->createPriceDiv('priceWithoutTax','COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX',$product->prices);
//echo $this->currency->createPriceDiv('discountAmount','COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT',$product->prices);
//echo $this->currency->createPriceDiv('taxAmount','COM_VIRTUEMART_PRODUCT_TAX_AMOUNT',$product->prices);
} ?>
</div>

<h2><?php echo JHTML::link($product->link, $product->product_name); ?></h2>
<!--

<?php // Product Short Description
if(!empty($product->product_s_desc)) { ?>
<p class="product_s_desc">
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, 40, '...')?>
</p>
<?php } ?>
-->
<p>
<?php // Product Details Button
echo JHTML::link($product->link, JText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), array('title' => $product->product_name,'class' => 'product-details'));
?>
</p>

</div>
<div class="clear"></div>
</div><!-- end of spacer -->
</div> <!-- end of product -->
<?php

   // Do we need to close the current row now?
   if ($iBrowseCol == $BrowseProducts_per_row || $iBrowseProduct == $BrowseTotalProducts) {?>
   <div class="clear"></div>
   </div> <!-- end of row -->
      <?php
      $iBrowseCol = 1;
   } else {
      $iBrowseCol ++;
   }

   $iBrowseProduct ++;
} // end of foreach ( $this->products as $product )
// Do we need a final closing row tag?
if ($iBrowseCol != 1) { ?>
<div class="clear"></div>

<?php
}
?>
<!-- /div removed valerie -->
<div class="vm-pagination"><?php echo $this->vmPagination->getPagesLinks(); ?><span style="float:right"><?php echo $this->vmPagination->getPagesCounter(); ?></span></div>
<!-- /div removed valerie -->
<?php } elseif ($this->search !==null ) echo JText::_('COM_VIRTUEMART_NO_RESULT').($this->keyword? ' : ('. $this->keyword. ')' : '')
?>
</div><!-- end browse-view -->
« Последнее редактирование: 26.11.2012, 12:53:54 от permstyle »
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Расчёт стоимости товара в VirtueMart за периметр

Автор NIKOLY

Ответов: 0
Просмотров: 475
Последний ответ 04.07.2025, 09:18:31
от NIKOLY
Не отображаются товары в категории

Автор iZacNT

Ответов: 0
Просмотров: 2297
Последний ответ 23.06.2023, 12:20:49
от iZacNT
Как вывести ID товара в описании товара?

Автор Stasweb

Ответов: 8
Просмотров: 4523
Последний ответ 28.11.2022, 23:22:27
от Evgen Kulibin
Joomla 3 + VM + Universal AJAX Live Search - как вывести картики товара в поиске?

Автор PSN

Ответов: 10
Просмотров: 9911
Последний ответ 27.03.2022, 17:29:00
от Evgen Kulibin
Как сделать - Вывод модуля на всех страницах - Кроме в карточке товара?

Автор artem_wrong

Ответов: 15
Просмотров: 3458
Последний ответ 15.02.2022, 15:07:34
от beliyadm