Нужна помощь! Компонент virtuemart 2.0.24. Ошибка вывода категории с подкатегориями в Virtuemart.
Страницы: 1
Нужна помощь! Компонент virtuemart 2.0.24. Ошибка вывода категории с подкатегориями в Virtuemart., Ошибка вывода категории с подкатегориями в Virtuemart.
Joomla 2.5.16
Virtuemart 2.0.24
Шаблон OmegaTheme
Возникла проблема с отображением подкатегорий, когда заходишь на страницу категории.
А именно: есть  категория верхнего уровня   и 2  вложенные подкатегории.
Когда заходишь на страницу верхней категории, то получаются каркозяблы ( как во вложении).
Далее при нажатии на каждую подкатегорию идет уже корректное отображение страницы с товарами.
Но если добавить в саму категорию верхнего уровня какой-то товар,  то идет уже корректное отображение: сверху подкатегории, ниже товар, все в нужном виде.
Где нужно подправить, подскажите, плиз! Весь интернет перелопатил! 
Шаблон OmegaTheme устанавливался по Quickstart уже вместе с Virtuemart 2.0.22, далее было проведено обновление до 2.0.24.
skr.jpg (16.38 КБ) [ Скачать ]
если интересно могу дать скайп знакомого программиста который поможет в лс
Вот как нужно делать сайты Bezlimi.com
Конечно интересно! Был бы Вам очень признателен!smile:)smile:confused:
Ошибка находится в этом файле, который находится в шаблоне в папке html. Когда я заменяю его на стандартный файл default.php из папки category скрипта virtuemart, всё начинает работать, но шаблон портится и расплывается. Однако я не силён в PHP, и подправить самому не хватает мозгом. Помогите, пожалуйста голова кругом!smile:wall:

<?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 © 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 $
 */

 // Modified by Omegatheme.com to use with responsive template - VM Version 2.0.18a stable

//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 = '
        '.JHTML::_('image', 'images/M_images/edit.png', JText::_('COM_VIRTUEMART_PRODUCT_FORM_EDIT_PRODUCT'), array('width' => 16, 'height' => 16, 'border' => 0)).'
';
}

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);
        $category_cellwidth = ' span' . floor(OGRID_SYS / $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-fluid">
            <?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 <?php echo $category_cellwidth . $show_vertical_separator ?>">
                    <div class="spacer">
                        category_name ?>">
                            <span class="category-name"> <?php echo $category->category_name ?></span>
                            <br />
                            <?php
                            if (!empty($category->images)) {
                                echo '<span class="category-image">';
                                    echo $category->images[0]->displayMediaThumb("", false);
                                echo '</span>';
                            }
                            ?>
                       

                    </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">
<div class="browse-top">
<!-- <h1><?php echo $this->category->category_name; ?></h1> -->
    <h3 class="category-title">
        <?php if (empty($this->category->category_name)){
            $title = $document->getTitle();
            echo $title;
        } else {
            echo $this->category->category_name;
        } ?>
    </h3>
    <div class="clear"></div>
    <?php if ( empty($this->keyword) && !empty($this->category->category_description) ) { ?>
        <div class="category_description">
            <?php echo $this->category->category_description ; ?>
        </div>
        <div class="clear"></div>
    <?php }?>
    <?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="span6">
            <?php echo $this->orderByList['orderby']; ?>
            <?php echo $this->orderByList['manufacturer']; ?>
        </div>
        <div class="span6">
            <div class="display-number"><?php echo $this->vmPagination->getResultsCounter ();?><br/><?php echo $this->vmPagination->getLimitBox (); ?></div>
            <!-- <div class="vm-pagination pagination">
                <?php echo $this->vmPagination->getPagesLinks (); ?>
                <span style="float:right"><?php echo $this->vmPagination->getPagesCounter (); ?></span>
            </div> -->
        </div>
        <div class="clear"></div>
    </div> <!-- end of orderby-displaynumber -->
    <div class="clear"></div>
</div>

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

    // Calculating Products Per Row
    $BrowseProducts_per_row = $this->perRow;
    //$Browsecellwidth = ' width' . floor (100 / $BrowseProducts_per_row);
    $Browsecellwidth = ' span' . floor (OGRID_SYS / $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++;
    } ?>
   
    <?php // 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-fluid">
    <?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 ot-product <?php echo $Browsecellwidth . $show_vertical_separator ?>">
            <div class="spacer">
                <div class="product-image center">
                    <a title="<?php echo $product->link ?>" rel="vm-additional-images" href="<?php echo $product->link; ?>">
                        <?php echo $product->images[0]->displayMediaThumb('class="browseProductImage"', false); ?>
                    </a>

                    <!-- 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>
                <?php if (!empty($product->prices['discountAmount'])&&!empty($product->prices['basePriceWithTax'])) { ?>
                    <span class="product-discount"><?php echo JText::_('TPL_OT_SALE'); ?></span>
                <?php } ?>
                <div class="clear"></div>
                <div class="product-detail">
                    <!-- <h4 class="product-name">
                        <?php echo JHTML::link($product->link, $product->product_name); ?>
                    </h4> -->
                   
                        <?php echo $product->product_name; ?>
                   

                    <?php // Product Short Description
                    if(!empty($product->product_s_desc)) { ?>
                        <div class="product-s-desc">
                            <p class="product_s_desc">
                            <?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, 40, '...') ?>
                            </p>
                        </div>
                        <div class="clear"></div>
                    <?php } ?>
                </div>
                <div class="clear"></div>
                <div class="product-addtocartbar">
                    <div class="product-price span6" id="productPrice<?php echo $product->virtuemart_product_id ?>">

                        <?php
                        if ($this->show_prices == '1') {
                            if ($product->prices['salesPrice']<=0 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);
                            }
                            if (round($product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
                                echo '<div class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $product->prices) . "</div>";
                            }
                            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 '<div class="price-new" >';
                            }
                            echo $this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
                            if (round($product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
                                echo '</div>';
                            }
                            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 ('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>
                    <div class="product-addtocart span6">
                        <!--<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>
                <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;
            $iBrowseRow++;
        } 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 pagination pagination-mini pagination-centered"><?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 . ')' : '');
}
?>

<script type="text/javascript">
<!--
    jQuery.noConflict();
    jQuery(document).ready(function($) {
        $$('.ot-product .product-price span.PricesalesPrice').each(function (item) {
            var parts  = item.get('text').clean().split('<?php echo $this->currency->getSymbol();?>');
            var i = 0;
            $.each(parts, function() {
                parts[i]  = this.split('<?php echo $this->currency->getDecimalSymbol();?>');
                if(parts[i].length > 1){
                    parts[i] = parts[i][0]+"<span class='decimals'><?php echo $this->currency->getDecimalSymbol();?>"+parts[i][1]+"</span>";
                }
                i++;
            });
            item.set('html', parts.join('<span class="cur_symbol"><?php echo $this->currency->getSymbol();?></span>'));           
        });
    });
-->
</script>
</div><!-- end browse-view -->
Страницы: 1
Похожие темы:
Читают тему (гостей: 1, пользователей: 0, из них скрытых: 0)
Новые темыОбъявленияСвободное общение
10:06 Яндекс.Фильтры 
00:44 К лету готов? АПдейт Яндекс выдача 29 мая 2024 
22:17 А ты жарил? АПдейт Яндекс выдача 11 мая 2024 
19:21 Кто как борется с ботами ПФ? 
14:58 Adtrafico - Правильная партнёрская сеть под бурж трафик 
09:36 Сайт не реагирует на изменения в CSS 
09:35 Смена струкуры URL сайта плохо для SEO? 
10:12 Высококачественные и надежные прокси-серверы и 5G 
05:49 BestChange – обменивать электронную валюту можно быстро и выгодно 
00:40 Web-разработка сайтов, лендингов 
23:28 Криптовалютный обменник Xgram.io - новое воплощение качества 
22:37 Кто сделает прогон для адалт сайта? 
21:35 Скрипт приема платежей (Карта, СБП, Юmoney, BTC, USDT) + Woocommerce плагин 
17:54 Belurk — высокоскоростные анонимные прокси от 0,24 рублей 
10:35 Калифорния легализует компостирование людей к 2027 году 
04:35 Точные прогнозы на футбол 
00:43 Популярный сократитель заблокирован? 
22:22 Ням-ням! - 8 деликатесов, которые когда-то ели только бедные люди 
20:26 Ваше мнение о видео играх 
15:07 Куплю проигрышные букмекерские аккаунты 
10:31 ⭐️ Заработок до 500к/мес на БОНУСАХ ⭐️