Новости Joomla

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

nero5555

  • Новичок
  • 2
  • 0 / 0
Нашел здесь код для  файла browse_listtable.tpl.php. Почти то что мне надо - вот только количество выводится интервалами.
Может кто подскажет - как выводить просто цифрами? Как цену. Бьюсь, бьюсь - не могу додуматься.
Вот код
Код
<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
mm_showMyFileName(__FILE__); ?>

<?php echo $buttons_header // The PDF, Email and Print buttons ?>
<?php echo $browsepage_header // The heading, the category description ?>
<?php echo $parameter_form // The Parameter search form ?>
<?php echo $orderby_form // The sort-by, order-by form PLUS top page navigation ?>

<?php
$data =array(); // Holds the rows of products
$i = 1; $row = 0; // Counters

// Table header
$tableheader[] = $VM_LANG->_('PHPSHOP_PRODUCT_FORM_THUMB_IMAGE') ;
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_NAME');
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_QUANTITY');
if( _SHOW_PRICES && $auth['show_prices'] ) {
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_PRICE');
}

//$tableheader[] = $VM_LANG->_('PHPSHOP_PRODUCT_DESC_TITLE');
if( _SHOW_PRICES && $auth['show_prices'] && USE_AS_CATALOGUE != '1' ) {
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_ACTION');
}

// Creates a new HTML_Table object that will help us
// to build a table holding all the products
$table = new HTML_Table('width="100%"');

$table->addRow( $tableheader, 'class="sectiontableheader"', 'th', true );

foreach( $products as $product ) {

foreach( $product as $attr => $val ) {
// Using this we make all the variables available in the template
// translated example: $this->set( 'product_name', $product_name );
//$product['product_in_stock'];
$this->set( $attr, $val );
}
$data[$row][] = '<a href="'.$product['product_flypage'].'" title="'.$product['product_name'].'" border="100" >'
. ps_product::image_tag ( $product['product_thumb_image'])
. '</a>';
$data[$row][] = '<a href="'.$product['product_flypage'].'" title="'.$product['product_name'].'">'.$product['product_name'].'</a>';
if( $product['product_in_stock']<1 ) {
                  $data[$row][] = '<img src="/images/q0.gif" align="center" vspace="5" hspace="30" border="0">';
            }
            if( $product['product_in_stock']>=1 && $product['product_in_stock']<3 ) {
                  $data[$row][] = '<img src="/images/q1.gif" align="center" vspace="5" hspace="30" border="0">';
            }
            if( $product['product_in_stock']>=3 && $product['product_in_stock']<5 ) {
                  $data[$row][] = '<img src="/images/q2.gif" align="center" vspace="5" hspace="30" border="0">';
            }

            if( $product['product_in_stock']>=5 ) {
                  $data[$row][] = '<img src="/images/q4.gif" align="center" vspace="5" hspace="30" border="0">';
            }

if( _SHOW_PRICES && $auth['show_prices'] ) {
$data[$row][] = $product['product_price'] ;
}

         
//$data[$row][] = $product['product_s_desc'];
if( $product['has_addtocart'] ) {
$data[$row][] = $product['form_addtocart'];
}
else {
$data[$row][] = '<a href="'.$product['product_flypage'].'" title="'.$product['product_name'].'">'
. $product['product_details']
. '</a>';
}

$row++;

}


// Loop through each row and build the table
foreach($data as $key => $value) {

$table->addRow( $data[$key], 'class="sectiontableentry'.$i.'"', 'td', true );
$i = $i == 1 ? 2 : 1;
}
// Display the table
echo $table->toHtml();
?>
<br class="clr" /><br />
<?php echo $browsepage_footer ?>
<?php
// Show Featured Products
if( $this->get_cfg( 'showFeatured', 1 )) {
    /* featuredproducts(random, no_of_products,category_based) no_of_products 0 = all else numeric amount
    edit featuredproduct.tpl.php to edit layout */
    echo $ps_product->featuredProducts(true,10,true);
} ?>
<?php echo $recent_products ?>


*

beagler

  • Moderator
  • 3276
  • 392 / 4
  • https://alorisman.ru/
вместо
Код
if( $product['product_in_stock']<1 ) {
                  $data[$row][] = '<img src="/images/q0.gif" align="center" vspace="5" hspace="30" border="0">';
            }
            if( $product['product_in_stock']>=1 && $product['product_in_stock']<3 ) {
                  $data[$row][] = '<img src="/images/q1.gif" align="center" vspace="5" hspace="30" border="0">';
            }
            if( $product['product_in_stock']>=3 && $product['product_in_stock']<5 ) {
                  $data[$row][] = '<img src="/images/q2.gif" align="center" vspace="5" hspace="30" border="0">';
            }

            if( $product['product_in_stock']>=5 ) {
                  $data[$row][] = '<img src="/images/q4.gif" align="center" vspace="5" hspace="30" border="0">';
            }
просто
Код
$data[$row][] =$product['product_in_stock']
*

nero5555

  • Новичок
  • 2
  • 0 / 0
Спасибо! Сработало  ^-^
« Последнее редактирование: 25.04.2011, 23:08:13 от nero5555 »
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

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

Автор grishin

Ответов: 38
Просмотров: 9824
Последний ответ 22.08.2020, 08:44:29
от rsn
Модуль «VirtueMart Товары» вывод товаров по рейтингу

Автор myrka

Ответов: 0
Просмотров: 1232
Последний ответ 10.01.2017, 17:09:22
от myrka
Количество товаров на витрине

Автор Zegeberg

Ответов: 2
Просмотров: 824
Последний ответ 22.11.2016, 13:00:55
от Zegeberg
Вывод категорий VirtueMart

Автор Deryan

Ответов: 13
Просмотров: 6040
Последний ответ 06.10.2016, 19:58:54
от shell88
Вывод SIGE в настраиваемых полях VirtueMart

Автор she-r

Ответов: 1
Просмотров: 932
Последний ответ 01.03.2016, 16:14:56
от she-r