Помощь Проблема с FilterPro

SHOX

Постоялец
Регистрация
20 Авг 2007
Сообщения
70
Реакции
38
Здравствуйте.
Использую ocStore-1.5.5.1.1 и Filterpro v2.4.2.21
Сам модуль рабочий, но на некоторых темах не работает. У меня проблема со стилем вывода. Когда открываешь категорию, то все нормально, но начинаешь фильтровать и пропадают картинки к товарам, некоторые данные товаров и что-то с самим стилем вывода.
Я с Опенкарт только начал работать, но по-моему проблема в коде в файле category.tpl по адресу \catalog\view\theme\shablon\template\product

Код:
<script type="text/javascript"><!--
function display(view) {
    if (view == 'list') {
        $('.product-grid').attr('class', 'product-list');
        $('.grid-item').attr('class', 'list-item');
      
        $('.product-list > div').each(function(index, element) {
            html = '';
            var image = $(element).find('.image-content').html();
            if (image != null) {
                html += '<div class="image-content">' + image + '</div>';
            }
            html += '<div class="panel-content">';
                var rating = $(element).find('.upload-rating').html();
                if (rating != null) {
                    html += '<div class="upload-rating">' + rating + '</div>';
                }
                html += '<div class="top">';
                html += '<h3 class="name">' + $(element).find('.name').html() + '</h3>';
                var price = $(element).find('.price').html();
                if (price != null) {
                    html += '<div class="price">' + price  + '</div>';
                }
                html += '</div>';
            html += '<div class="bottom">' + $(element).find('.bottom').html() + '</div>';
            html += '<div class="middle">' + $(element).find('.middle').html() + '</div>';
            html += '</div>';
                      
            $(element).html(html);
        });  
      
        $('.display').html('<a class="" onclick="display(\'grid\');"><i class="<?php if($this->config->get("tranda_icon_grid") != '') { ?><?php echo $this->config->get("tranda_icon_grid"); ?><?php } else { ?>icon-th<?php } ?>"></i><span><?php echo $text_grid; ?></span></a><a class="active" onclick=""><i class="<?php if($this->config->get("tranda_icon_list") != '') { ?><?php echo $this->config->get("tranda_icon_list"); ?><?php } else { ?>icon-th-list<?php } ?>"></i><span><?php echo $text_list; ?></span></a>');

        $.cookie('display', 'list');
        $(".rating").tooltip();
        $(".middle a").tooltip();
    } else {
        $('.product-list').attr('class', 'product-grid');
        $('.list-item').attr('class', 'grid-item');
      
        $('.product-grid > div').each(function(index, element) {
            html = '';
            var image = $(element).find('.image-content').html();
            if (image != null) {
                html += '<div class="image-content">' + image + '</div>';
            }
            html += '<div class="panel-content">';
                var rating = $(element).find('.upload-rating').html();
                if (rating != null) {
                    html += '<div class="upload-rating">' + rating + '</div>';
                }
                html += '<div class="top">';
                var price = $(element).find('.price').html();
                if (price != null) {
                    html += '<div class="price">' + price  + '</div>';
                }
                html += '<h3 class="name">' + $(element).find('.name').html() + '</h3>';
                html += '</div>';
            html += '<div class="middle">' + $(element).find('.middle').html() + '</div>';
            html += '<div class="bottom">' + $(element).find('.bottom').html() + '</div>';
            html += '</div>';
                      
            $(element).html(html);
        });  
      
        $('.display').html('<a class="active" onclick=""><i class="<?php if($this->config->get("tranda_icon_grid") != '') { ?><?php echo $this->config->get("tranda_icon_grid"); ?><?php } else { ?>icon-th<?php } ?>"></i><span><?php echo $text_grid; ?></span></a><a class="" onclick="display(\'list\');"><i class="<?php if($this->config->get("tranda_icon_list") != '') { ?><?php echo $this->config->get("tranda_icon_list"); ?><?php } else { ?>icon-th-list<?php } ?>"></i><span><?php echo $text_list; ?></span></a>');
      
        $.cookie('display', 'grid');
        $(".rating").tooltip();
        $(".middle a").tooltip();
    }
}

view = $.cookie('display');

if (view) {
    display(view);
} else {
    display('grid');
}
//--></script>
[/spoil]

Файл category.tpl полностью:
[spoil]
Код:
<?php echo $header; ?>
<div class="container-top">
<?php if ($thumb) { ?>
<style type="text/css">
<!--
.container-top { background-image:url('<?php echo $thumb; ?>');}
-->
</style>
<?php } ?>
    <div class="gpc">
        <!-- START CONTENT TOP -->
        <div class="content-top">
            <!-- START BREADCRUMB -->
            <h1 class="page_title"><?php echo $heading_title; ?></h1>
            <div class="breadcrumb">
                <h2>
                <?php foreach ($breadcrumbs as $breadcrumb) { ?>
                <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
                <?php } ?>
                </h2>
            </div>
            <!-- END BREADCRUMB -->
            <?php if ($products) { ?>
                <div class="product-filter global-no-value">
                    <div class="display">
                        <a class="" onclick="display('grid');"><i class="<?php if($this->config->get('tranda_icon_grid') != '') { ?><?php echo $this->config->get('tranda_icon_grid'); ?><?php } else { ?>icon-th<?php } ?>"></i><span><?php echo $text_grid; ?></span></a>
                        <a class="active" onclick=""><i class="<?php if($this->config->get('tranda_icon_list') != '') { ?><?php echo $this->config->get('tranda_icon_list'); ?><?php } else { ?>icon-th-list<?php } ?>"></i><span><?php echo $text_list; ?></span></a>
                    </div>
                    <div class="limit">
                      <select onchange="location = this.value;">
                        <?php foreach ($limits as $limits) { ?>
                        <?php if ($limits['value'] == $limit) { ?>
                        <option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
                        <?php } else { ?>
                        <option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
                        <?php } ?>
                        <?php } ?>
                      </select>
                    </div>
                    <div class="sort">
                      <select onchange="location = this.value;">
                        <?php foreach ($sorts as $sorts) { ?>
                        <?php if ($sorts['value'] == $sort . '-' . $order) { ?>
                        <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
                        <?php } else { ?>
                        <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
                        <?php } ?>
                        <?php } ?>
                      </select>
                    </div>
                    <a class="product-compare" href="<?php echo $compare; ?>"><i class="<?php if($this->config->get('tranda_icon_compare') != '') { ?><?php echo $this->config->get('tranda_icon_compare'); ?><?php } else { ?>icon-exchange<?php } ?>"></i><span id="compare-total"><?php echo $text_compare; ?></span></a>
                </div>
            <?php } ?>
        </div>
        <!-- END CONTENT TOP -->
    </div>
</div>
<div class="container-bottom">
    <div class="gpc">
        <?php echo $column_left; ?>
        <?php echo $column_right; ?>
        <!-- START COLUMN CENTER -->
        <div class="column-center">
            <?php echo $content_top; ?>
            <!-- START CATEGORY PAGE -->
            <div class="category-page">
                <?php if ($description) { ?>
                <div class="description global-no-value">
                <?php echo $description; ?>
                </div>
                <?php } ?>
                <?php if ($categories) { ?>
                <div class="subcategories global-module">
                    <h6><?php echo $text_refine; ?></h6>
                    <ul class="list-global-module static-list-global-module">
                        <?php foreach ($categories as $category) { ?>
                        <li><a href="<?php echo $category['href']; ?>" title="<?php echo $category['name']; ?>"><?php echo $category['name']; ?></a></li>
                        <?php } ?>
                    </ul>
                </div>
                <?php } ?>
                <?php if ($products) { ?>
                <div class="product-grid">
                    <?php foreach ($products as $product) { ?>
                    <!-- start item -->
                    <div class="grid-item">
                        <div class="image-content">
                            <?php if ($product['thumb']) { ?>
                            <div class="image">
                                <a href="<?php echo $product['href']; ?>" title="<?php echo $product['name']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a>
                            </div>
                            <?php } else { ?>
                            <div class="image no-image">
                                <i class="icon-camera"></i>
                            </div>
                            <?php } ?>
                        </div>
                        <div class="panel-content">
                            <div class="upload-rating">
                            <?php if ($product['price']) { ?>
                            <?php if ($product['special']) { ?>
                            <div class="certificate-sale"><i class="<?php if($this->config->get('tranda_icon_certificatesale') != '') { ?><?php echo $this->config->get('tranda_icon_certificatesale'); ?><?php } else { ?>icon-certificate<?php } ?>"></i><strong><?php if($this->config->get('tranda_text_certificatesale') != '') { ?><?php echo $this->config->get('tranda_text_certificatesale'); ?><?php } else { ?>SALE<?php } ?></strong></div>
                            <?php } ?>
                            <?php } ?>
                            <?php if ($product['rating']) { ?>
                            <div class="rating rating<?php echo $product['rating']; ?>" data-original-title="<?php echo $product['reviews']; ?>" data-placement="top" rel="tooltip">
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-color color1"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-color color2"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-color color3"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-color color4"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-color color5"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-dark dark1"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-dark dark2"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-dark dark3"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-dark dark4"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-dark dark5"></i>
                            </div>
                            <?php } ?>
                            </div>
                            <div class="top">
                                <?php if ($product['price']) { ?>
                                <div class="price">
                                    <?php if (!$product['special']) { ?>
                                    <?php echo $product['price']; ?>
                                    <?php } else { ?>
                                    <span class="price-new"><?php echo $product['special']; ?></span>
                                    <span class="price-old"><?php echo $product['price']; ?></span>
                                    <?php } ?>
                                    <?php if ($product['tax']) { ?>
                                    <span class="price-tax">/&nbsp;&nbsp;<?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
                                    <?php } ?>
                                </div>
                                <?php } ?>
                                <h3 class="name"><a href="<?php echo $product['href']; ?>" title="<?php echo $product['name']; ?>"><?php echo $product['name']; ?></a></h3>
                            </div>
                            <div class="middle">
                                <a class="add add_cart" onclick="addToCart('<?php echo $product['product_id']; ?>');" rel="tooltip" data-placement="top" data-original-title="<?php echo $button_cart; ?>"><i class="<?php if($this->config->get('tranda_icon_cart') != '') { ?><?php echo $this->config->get('tranda_icon_cart'); ?><?php } else { ?>icon-shopping-cart<?php } ?>"></i></a>
                                <a class="add add_wishlist" onClick="addToWishList('<?php echo $product['product_id']; ?>');" rel="tooltip" data-placement="top" data-original-title="<?php echo $button_wishlist; ?>"><i class="<?php if($this->config->get('tranda_icon_wishlist') != '') { ?><?php echo $this->config->get('tranda_icon_wishlist'); ?><?php } else { ?>icon-file-alt<?php } ?>"></i></a>
                                <a class="add add_compare" onClick="addToCompare('<?php echo $product['product_id']; ?>');" rel="tooltip" data-placement="top" data-original-title="<?php echo $button_compare; ?>"><i class="<?php if($this->config->get('tranda_icon_compare') != '') { ?><?php echo $this->config->get('tranda_icon_compare'); ?><?php } else { ?>icon-exchange<?php } ?>"></i></a>
                            </div>
                            <div class="bottom">
                                <h5><?php echo $product['description']; ?></h5>
                            </div>
                        </div>
                    </div>
                    <!-- end item -->
                    <?php } ?>
                </div>
                <div class="pagination"><?php echo $pagination; ?></div>
                <?php } ?>
                <?php if (!$categories && !$products) { ?>
                <div class="tranda_empty"><i class="icon-cogs info_icon"></i><?php echo $text_empty; ?></div>
                <div class="buttons">
                    <div class="right"><a href="<?php echo $continue; ?>" class="button"><i class="icon-share-alt"></i><?php echo $button_continue; ?></a></div>
                </div>
                <?php } ?>
            </div>
            <!-- END CATEGORY PAGE -->
        </div>
        <!-- END COLUMN CENTER -->
        <!-- START CONTENT BOTTOM -->
        <div class="content-bottom">
            <?php echo $content_bottom; ?>
        </div>
        <!-- END CONTENT BOTTOM -->
    </div>
</div>
<script type="text/javascript"><!--
function display(view) {
    if (view == 'list') {
        $('.product-grid').attr('class', 'product-list');
        $('.grid-item').attr('class', 'list-item');
       
        $('.product-list > div').each(function(index, element) {
            html = '<div class="list-item">';
            var image = $(element).find('.image-content').html();
            if (image != null) {
                html += '<div class="image-content">' + image + '</div>';
            }
            html += '<div class="panel-content">';
                var rating = $(element).find('.upload-rating').html();
                if (rating != null) {
                    html += '<div class="upload-rating">' + rating + '</div>';
                }
                html += '<div class="top">';
                html += '<h3 class="name">' + $(element).find('.name').html() + '</h3>';
                var price = $(element).find('.price').html();
                if (price != null) {
                    html += '<div class="price">' + price  + '</div>';
                }
                html += '</div>';
            html += '<div class="bottom">' + $(element).find('.bottom').html() + '</div>';
            html += '<div class="middle">' + $(element).find('.middle').html() + '</div>';
            html += '</div>';
                       
            $(element).html(html);
        });   
       
        $('.display').html('<a class="" onclick="display(\'grid\');"><i class="<?php if($this->config->get("tranda_icon_grid") != '') { ?><?php echo $this->config->get("tranda_icon_grid"); ?><?php } else { ?>icon-th<?php } ?>"></i><span><?php echo $text_grid; ?></span></a><a class="active" onclick=""><i class="<?php if($this->config->get("tranda_icon_list") != '') { ?><?php echo $this->config->get("tranda_icon_list"); ?><?php } else { ?>icon-th-list<?php } ?>"></i><span><?php echo $text_list; ?></span></a>');

        $.cookie('display', 'list');
        $(".rating").tooltip();
        $(".middle a").tooltip();
    } else {
        $('.product-list').attr('class', 'product-grid');
        $('.list-item').attr('class', 'grid-item');
       
        $('.product-grid > div').each(function(index, element) {
            html = '';
            var image = $(element).find('.image-content').html();
            if (image != null) {
                html += '<div class="image-content">' + image + '</div>';
            }
            html += '<div class="panel-content">';
                var rating = $(element).find('.upload-rating').html();
                if (rating != null) {
                    html += '<div class="upload-rating">' + rating + '</div>';
                }
                html += '<div class="top">';
                var price = $(element).find('.price').html();
                if (price != null) {
                    html += '<div class="price">' + price  + '</div>';
                }
                html += '<h3 class="name">' + $(element).find('.name').html() + '</h3>';
                html += '</div>';
            html += '<div class="middle">' + $(element).find('.middle').html() + '</div>';
            html += '<div class="bottom">' + $(element).find('.bottom').html() + '</div>';
            html += '</div>';
                       
            $(element).html(html);
        });   
       
        $('.display').html('<a class="active" onclick=""><i class="<?php if($this->config->get("tranda_icon_grid") != '') { ?><?php echo $this->config->get("tranda_icon_grid"); ?><?php } else { ?>icon-th<?php } ?>"></i><span><?php echo $text_grid; ?></span></a><a class="" onclick="display(\'list\');"><i class="<?php if($this->config->get("tranda_icon_list") != '') { ?><?php echo $this->config->get("tranda_icon_list"); ?><?php } else { ?>icon-th-list<?php } ?>"></i><span><?php echo $text_list; ?></span></a>');
       
        $.cookie('display', 'grid');
        $(".rating").tooltip();
        $(".middle a").tooltip();
    }
}

view = $.cookie('display');

if (view) {
    display(view);
} else {
    display('grid');
}
//--></script>
<?php echo $footer; ?>
 
Последнее редактирование:
откройте журнал ошибок и смотрите, там, зачастую, всё есть - в каком файле и на какой строке.
А попробуйте указать путь к категории не вашего шаблона, а дефолтного или вставить вот такой код, заменив полностью в \catalog\view\theme\shablon\template\product\category.tpl
PHP:
<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <h1><?php echo $heading_title; ?></h1>
  <?php if ($thumb || $description) { ?>
  <div class="category-info">
    <?php if ($thumb) { ?>
    <div class="image"><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ?>" /></div>
    <?php } ?>
    <?php if ($description) { ?>
    <?php echo $description; ?>
    <?php } ?>
  </div>
  <?php } ?>
  <?php if ($categories) { ?>
  <h2><?php echo $text_refine; ?></h2>
  <div class="category-list">
    <?php if (count($categories) <= 5) { ?>
    <ul>
      <?php foreach ($categories as $category) { ?>
      <li><a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['thumb']; ?>"><span><?php echo $category['name']; ?></a></span></li>
      <?php } ?>
    </ul>
    <?php } else { ?>
    <?php for ($i = 0; $i < count($categories);) { ?>
    <ul>
      <?php $j = $i + ceil(count($categories) / 4); ?>
      <?php for (; $i < $j; $i++) { ?>
      <?php if (isset($categories[$i])) { ?>
      <li><a href="<?php echo $categories[$i]['href']; ?>"><img src="<?php echo $categories[$i]['thumb']; ?>"><span><?php echo $categories[$i]['name']; ?></span></a></li>
      <?php } ?>
      <?php } ?>
    </ul>
    <?php } ?>
    <?php } ?>
  </div>
  <?php } ?>
  <?php if ($products) { ?>
  <div class="product-filter">
    <div class="display"><b><?php echo $text_display; ?></b> <?php echo $text_list; ?> <b>/</b> <a onclick="display('grid');"><?php echo $text_grid; ?></a></div>
    <div class="limit"><b><?php echo $text_limit; ?></b>
      <select onchange="location = this.value;">
        <?php foreach ($limits as $limits) { ?>
        <?php if ($limits['value'] == $limit) { ?>
        <option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
    </div>
  
    <div class="sort"><b><?php echo $text_sort; ?></b>
      <select onchange="location = this.value;">
        <?php foreach ($sorts as $sorts) { ?>
        <?php if ($sorts['value'] == $sort . '-' . $order) { ?>
        <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
    </div>
  </div>
  <div class="product-compare"><a href="<?php echo $compare; ?>" id="compare-total"><?php echo $text_compare; ?></a></div>
  <div class="product-list">
    <?php foreach ($products as $product) { ?>
    <div>
      <?php if ($product['thumb']) { ?>
      <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
      <?php } ?>
      <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
      <div class="description"><?php echo $product['description']; ?></div>
      <?php if ($product['price']) { ?>
      <div class="price">
        <?php if (!$product['special']) { ?>
        <?php echo $product['price']; ?>
        <?php } else { ?>
        <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
        <?php } ?>
        <?php if ($product['tax']) { ?>
        <br />
        <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
        <?php } ?>
      </div>
      <?php } ?>
      <?php if ($product['rating']) { ?>
      <div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
      <?php } ?>
      <div class="cart">
        <input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />
      </div>
  
    </div>
    <?php } ?>
  </div>
  <div class="pagination"><?php echo $pagination; ?></div>
  <?php } ?>
  <?php if (!$categories && !$products) { ?>
  <div class="content"><?php echo $text_empty; ?></div>
  <div class="buttons">
    <div class="right"><a href="<?php echo $continue; ?>" class="button"><?php echo $button_continue; ?></a></div>
  </div>
  <?php } ?>
  <?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
function display(view) {
    if (view == 'list') {
        $('.product-grid').attr('class', 'product-list');
      
        $('.product-list > div').each(function(index, element) {
            html  = '<div class="right">';
            html += '  <div class="cart">' + $(element).find('.cart').html() + '</div>';
            html += '</div>';          
          
            html += '<div class="left">';
          
            var image = $(element).find('.image').html();
          
            if (image != null) {
                html += '<div class="image">' + image + '</div>';
            }
          
            var price = $(element).find('.price').html();
          
            if (price != null) {
                html += '<div class="price">' + price  + '</div>';
            }
                  
            html += '  <div class="name">' + $(element).find('.name').html() + '</div>';
            html += '  <div class="description">' + $(element).find('.description').html() + '</div>';
          
            var rating = $(element).find('.rating').html();
          
            if (rating != null) {
                html += '<div class="rating">' + rating + '</div>';
            }
              
            html += '</div>';
                      
            $(element).html(html);
        });      
      
        $('.display').html('<b><?php echo $text_display; ?></b> <?php echo $text_list; ?> <b>/</b> <a onclick="display(\'grid\');"><?php echo $text_grid; ?></a>');
      
        $.totalStorage('display', 'list');
    } else {
        $('.product-list').attr('class', 'product-grid');
      
        $('.product-grid > div').each(function(index, element) {
            html = '';
          
            var image = $(element).find('.image').html();
          
            if (image != null) {
                html += '<div class="image">' + image + '</div>';
            }
          
            html += '<div class="name">' + $(element).find('.name').html() + '</div>';
            html += '<div class="description">' + $(element).find('.description').html() + '</div>';
          
            var price = $(element).find('.price').html();
          
            if (price != null) {
                html += '<div class="price">' + price  + '</div>';
            }
          
            var rating = $(element).find('.rating').html();
          
            if (rating != null) {
                html += '<div class="rating">' + rating + '</div>';
            }
                      
            html += '<div class="cart">' + $(element).find('.cart').html() + '</div>';
          
            $(element).html(html);
        });  
                  
        $('.display').html('<b><?php echo $text_display; ?></b> <a onclick="display(\'list\');"><?php echo $text_list; ?></a> <b>/</b> <?php echo $text_grid; ?>');
      
        $.totalStorage('display', 'grid');
    }
}

view = $.totalStorage('display');

if (view) {
    display(view);
} else {
    display('list');
}
//--></script>
<?php echo $footer; ?>
 
  • Нравится
Реакции: SHOX
Здравствуйте.
Использую ocStore-1.5.5.1.1 и Filterpro v2.4.2.21
Сам модуль рабочий, но на некоторых темах не работает. У меня проблема со стилем вывода. Когда открываешь категорию, то все нормально, но начинаешь фильтровать и пропадают картинки к товарам, некоторые данные товаров и что-то с самим стилем вывода.
Я с Опенкарт только начал работать, но по-моему проблема в коде в файле category.tpl по адресу \catalog\view\theme\shablon\template\product

Код:
<script type="text/javascript"><!--
function display(view) {
    if (view == 'list') {
        $('.product-grid').attr('class', 'product-list');
        $('.grid-item').attr('class', 'list-item');
     
        $('.product-list > div').each(function(index, element) {
            html = '';
            var image = $(element).find('.image-content').html();
            if (image != null) {
                html += '<div class="image-content">' + image + '</div>';
            }
            html += '<div class="panel-content">';
                var rating = $(element).find('.upload-rating').html();
                if (rating != null) {
                    html += '<div class="upload-rating">' + rating + '</div>';
                }
                html += '<div class="top">';
                html += '<h3 class="name">' + $(element).find('.name').html() + '</h3>';
                var price = $(element).find('.price').html();
                if (price != null) {
                    html += '<div class="price">' + price  + '</div>';
                }
                html += '</div>';
            html += '<div class="bottom">' + $(element).find('.bottom').html() + '</div>';
            html += '<div class="middle">' + $(element).find('.middle').html() + '</div>';
            html += '</div>';
                     
            $(element).html(html);
        }); 
     
        $('.display').html('<a class="" onclick="display(\'grid\');"><i class="<?php if($this->config->get("tranda_icon_grid") != '') { ?><?php echo $this->config->get("tranda_icon_grid"); ?><?php } else { ?>icon-th<?php } ?>"></i><span><?php echo $text_grid; ?></span></a><a class="active" onclick=""><i class="<?php if($this->config->get("tranda_icon_list") != '') { ?><?php echo $this->config->get("tranda_icon_list"); ?><?php } else { ?>icon-th-list<?php } ?>"></i><span><?php echo $text_list; ?></span></a>');

        $.cookie('display', 'list');
        $(".rating").tooltip();
        $(".middle a").tooltip();
    } else {
        $('.product-list').attr('class', 'product-grid');
        $('.list-item').attr('class', 'grid-item');
     
        $('.product-grid > div').each(function(index, element) {
            html = '';
            var image = $(element).find('.image-content').html();
            if (image != null) {
                html += '<div class="image-content">' + image + '</div>';
            }
            html += '<div class="panel-content">';
                var rating = $(element).find('.upload-rating').html();
                if (rating != null) {
                    html += '<div class="upload-rating">' + rating + '</div>';
                }
                html += '<div class="top">';
                var price = $(element).find('.price').html();
                if (price != null) {
                    html += '<div class="price">' + price  + '</div>';
                }
                html += '<h3 class="name">' + $(element).find('.name').html() + '</h3>';
                html += '</div>';
            html += '<div class="middle">' + $(element).find('.middle').html() + '</div>';
            html += '<div class="bottom">' + $(element).find('.bottom').html() + '</div>';
            html += '</div>';
                     
            $(element).html(html);
        }); 
     
        $('.display').html('<a class="active" onclick=""><i class="<?php if($this->config->get("tranda_icon_grid") != '') { ?><?php echo $this->config->get("tranda_icon_grid"); ?><?php } else { ?>icon-th<?php } ?>"></i><span><?php echo $text_grid; ?></span></a><a class="" onclick="display(\'list\');"><i class="<?php if($this->config->get("tranda_icon_list") != '') { ?><?php echo $this->config->get("tranda_icon_list"); ?><?php } else { ?>icon-th-list<?php } ?>"></i><span><?php echo $text_list; ?></span></a>');
     
        $.cookie('display', 'grid');
        $(".rating").tooltip();
        $(".middle a").tooltip();
    }
}

view = $.cookie('display');

if (view) {
    display(view);
} else {
    display('grid');
}
//--></script>
[/spoil]

Файл category.tpl полностью:
[spoil]
Код:
<?php echo $header; ?>
<div class="container-top">
<?php if ($thumb) { ?>
<style type="text/css">
<!--
.container-top { background-image:url('<?php echo $thumb; ?>');}
-->
</style>
<?php } ?>
    <div class="gpc">
        <!-- START CONTENT TOP -->
        <div class="content-top">
            <!-- START BREADCRUMB -->
            <h1 class="page_title"><?php echo $heading_title; ?></h1>
            <div class="breadcrumb">
                <h2>
                <?php foreach ($breadcrumbs as $breadcrumb) { ?>
                <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
                <?php } ?>
                </h2>
            </div>
            <!-- END BREADCRUMB -->
            <?php if ($products) { ?>
                <div class="product-filter global-no-value">
                    <div class="display">
                        <a class="" onclick="display('grid');"><i class="<?php if($this->config->get('tranda_icon_grid') != '') { ?><?php echo $this->config->get('tranda_icon_grid'); ?><?php } else { ?>icon-th<?php } ?>"></i><span><?php echo $text_grid; ?></span></a>
                        <a class="active" onclick=""><i class="<?php if($this->config->get('tranda_icon_list') != '') { ?><?php echo $this->config->get('tranda_icon_list'); ?><?php } else { ?>icon-th-list<?php } ?>"></i><span><?php echo $text_list; ?></span></a>
                    </div>
                    <div class="limit">
                      <select onchange="location = this.value;">
                        <?php foreach ($limits as $limits) { ?>
                        <?php if ($limits['value'] == $limit) { ?>
                        <option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
                        <?php } else { ?>
                        <option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
                        <?php } ?>
                        <?php } ?>
                      </select>
                    </div>
                    <div class="sort">
                      <select onchange="location = this.value;">
                        <?php foreach ($sorts as $sorts) { ?>
                        <?php if ($sorts['value'] == $sort . '-' . $order) { ?>
                        <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
                        <?php } else { ?>
                        <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
                        <?php } ?>
                        <?php } ?>
                      </select>
                    </div>
                    <a class="product-compare" href="<?php echo $compare; ?>"><i class="<?php if($this->config->get('tranda_icon_compare') != '') { ?><?php echo $this->config->get('tranda_icon_compare'); ?><?php } else { ?>icon-exchange<?php } ?>"></i><span id="compare-total"><?php echo $text_compare; ?></span></a>
                </div>
            <?php } ?>
        </div>
        <!-- END CONTENT TOP -->
    </div>
</div>
<div class="container-bottom">
    <div class="gpc">
        <?php echo $column_left; ?>
        <?php echo $column_right; ?>
        <!-- START COLUMN CENTER -->
        <div class="column-center">
            <?php echo $content_top; ?>
            <!-- START CATEGORY PAGE -->
            <div class="category-page">
                <?php if ($description) { ?>
                <div class="description global-no-value">
                <?php echo $description; ?>
                </div>
                <?php } ?>
                <?php if ($categories) { ?>
                <div class="subcategories global-module">
                    <h6><?php echo $text_refine; ?></h6>
                    <ul class="list-global-module static-list-global-module">
                        <?php foreach ($categories as $category) { ?>
                        <li><a href="<?php echo $category['href']; ?>" title="<?php echo $category['name']; ?>"><?php echo $category['name']; ?></a></li>
                        <?php } ?>
                    </ul>
                </div>
                <?php } ?>
                <?php if ($products) { ?>
                <div class="product-grid">
                    <?php foreach ($products as $product) { ?>
                    <!-- start item -->
                    <div class="grid-item">
                        <div class="image-content">
                            <?php if ($product['thumb']) { ?>
                            <div class="image">
                                <a href="<?php echo $product['href']; ?>" title="<?php echo $product['name']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a>
                            </div>
                            <?php } else { ?>
                            <div class="image no-image">
                                <i class="icon-camera"></i>
                            </div>
                            <?php } ?>
                        </div>
                        <div class="panel-content">
                            <div class="upload-rating">
                            <?php if ($product['price']) { ?>
                            <?php if ($product['special']) { ?>
                            <div class="certificate-sale"><i class="<?php if($this->config->get('tranda_icon_certificatesale') != '') { ?><?php echo $this->config->get('tranda_icon_certificatesale'); ?><?php } else { ?>icon-certificate<?php } ?>"></i><strong><?php if($this->config->get('tranda_text_certificatesale') != '') { ?><?php echo $this->config->get('tranda_text_certificatesale'); ?><?php } else { ?>SALE<?php } ?></strong></div>
                            <?php } ?>
                            <?php } ?>
                            <?php if ($product['rating']) { ?>
                            <div class="rating rating<?php echo $product['rating']; ?>" data-original-title="<?php echo $product['reviews']; ?>" data-placement="top" rel="tooltip">
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-color color1"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-color color2"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-color color3"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-color color4"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-color color5"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-dark dark1"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-dark dark2"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-dark dark3"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-dark dark4"></i>
                                <i class="<?php if($this->config->get('tranda_icon_rating') != '') { ?><?php echo $this->config->get('tranda_icon_rating'); ?><?php } else { ?>icon-star<?php } ?> star-dark dark5"></i>
                            </div>
                            <?php } ?>
                            </div>
                            <div class="top">
                                <?php if ($product['price']) { ?>
                                <div class="price">
                                    <?php if (!$product['special']) { ?>
                                    <?php echo $product['price']; ?>
                                    <?php } else { ?>
                                    <span class="price-new"><?php echo $product['special']; ?></span>
                                    <span class="price-old"><?php echo $product['price']; ?></span>
                                    <?php } ?>
                                    <?php if ($product['tax']) { ?>
                                    <span class="price-tax">/&nbsp;&nbsp;<?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
                                    <?php } ?>
                                </div>
                                <?php } ?>
                                <h3 class="name"><a href="<?php echo $product['href']; ?>" title="<?php echo $product['name']; ?>"><?php echo $product['name']; ?></a></h3>
                            </div>
                            <div class="middle">
                                <a class="add add_cart" onclick="addToCart('<?php echo $product['product_id']; ?>');" rel="tooltip" data-placement="top" data-original-title="<?php echo $button_cart; ?>"><i class="<?php if($this->config->get('tranda_icon_cart') != '') { ?><?php echo $this->config->get('tranda_icon_cart'); ?><?php } else { ?>icon-shopping-cart<?php } ?>"></i></a>
                                <a class="add add_wishlist" onClick="addToWishList('<?php echo $product['product_id']; ?>');" rel="tooltip" data-placement="top" data-original-title="<?php echo $button_wishlist; ?>"><i class="<?php if($this->config->get('tranda_icon_wishlist') != '') { ?><?php echo $this->config->get('tranda_icon_wishlist'); ?><?php } else { ?>icon-file-alt<?php } ?>"></i></a>
                                <a class="add add_compare" onClick="addToCompare('<?php echo $product['product_id']; ?>');" rel="tooltip" data-placement="top" data-original-title="<?php echo $button_compare; ?>"><i class="<?php if($this->config->get('tranda_icon_compare') != '') { ?><?php echo $this->config->get('tranda_icon_compare'); ?><?php } else { ?>icon-exchange<?php } ?>"></i></a>
                            </div>
                            <div class="bottom">
                                <h5><?php echo $product['description']; ?></h5>
                            </div>
                        </div>
                    </div>
                    <!-- end item -->
                    <?php } ?>
                </div>
                <div class="pagination"><?php echo $pagination; ?></div>
                <?php } ?>
                <?php if (!$categories && !$products) { ?>
                <div class="tranda_empty"><i class="icon-cogs info_icon"></i><?php echo $text_empty; ?></div>
                <div class="buttons">
                    <div class="right"><a href="<?php echo $continue; ?>" class="button"><i class="icon-share-alt"></i><?php echo $button_continue; ?></a></div>
                </div>
                <?php } ?>
            </div>
            <!-- END CATEGORY PAGE -->
        </div>
        <!-- END COLUMN CENTER -->
        <!-- START CONTENT BOTTOM -->
        <div class="content-bottom">
            <?php echo $content_bottom; ?>
        </div>
        <!-- END CONTENT BOTTOM -->
    </div>
</div>
<script type="text/javascript"><!--
function display(view) {
    if (view == 'list') {
        $('.product-grid').attr('class', 'product-list');
        $('.grid-item').attr('class', 'list-item');
      
        $('.product-list > div').each(function(index, element) {
            html = '<div class="list-item">';
            var image = $(element).find('.image-content').html();
            if (image != null) {
                html += '<div class="image-content">' + image + '</div>';
            }
            html += '<div class="panel-content">';
                var rating = $(element).find('.upload-rating').html();
                if (rating != null) {
                    html += '<div class="upload-rating">' + rating + '</div>';
                }
                html += '<div class="top">';
                html += '<h3 class="name">' + $(element).find('.name').html() + '</h3>';
                var price = $(element).find('.price').html();
                if (price != null) {
                    html += '<div class="price">' + price  + '</div>';
                }
                html += '</div>';
            html += '<div class="bottom">' + $(element).find('.bottom').html() + '</div>';
            html += '<div class="middle">' + $(element).find('.middle').html() + '</div>';
            html += '</div>';
                      
            $(element).html(html);
        });  
      
        $('.display').html('<a class="" onclick="display(\'grid\');"><i class="<?php if($this->config->get("tranda_icon_grid") != '') { ?><?php echo $this->config->get("tranda_icon_grid"); ?><?php } else { ?>icon-th<?php } ?>"></i><span><?php echo $text_grid; ?></span></a><a class="active" onclick=""><i class="<?php if($this->config->get("tranda_icon_list") != '') { ?><?php echo $this->config->get("tranda_icon_list"); ?><?php } else { ?>icon-th-list<?php } ?>"></i><span><?php echo $text_list; ?></span></a>');

        $.cookie('display', 'list');
        $(".rating").tooltip();
        $(".middle a").tooltip();
    } else {
        $('.product-list').attr('class', 'product-grid');
        $('.list-item').attr('class', 'grid-item');
      
        $('.product-grid > div').each(function(index, element) {
            html = '';
            var image = $(element).find('.image-content').html();
            if (image != null) {
                html += '<div class="image-content">' + image + '</div>';
            }
            html += '<div class="panel-content">';
                var rating = $(element).find('.upload-rating').html();
                if (rating != null) {
                    html += '<div class="upload-rating">' + rating + '</div>';
                }
                html += '<div class="top">';
                var price = $(element).find('.price').html();
                if (price != null) {
                    html += '<div class="price">' + price  + '</div>';
                }
                html += '<h3 class="name">' + $(element).find('.name').html() + '</h3>';
                html += '</div>';
            html += '<div class="middle">' + $(element).find('.middle').html() + '</div>';
            html += '<div class="bottom">' + $(element).find('.bottom').html() + '</div>';
            html += '</div>';
                      
            $(element).html(html);
        });  
      
        $('.display').html('<a class="active" onclick=""><i class="<?php if($this->config->get("tranda_icon_grid") != '') { ?><?php echo $this->config->get("tranda_icon_grid"); ?><?php } else { ?>icon-th<?php } ?>"></i><span><?php echo $text_grid; ?></span></a><a class="" onclick="display(\'list\');"><i class="<?php if($this->config->get("tranda_icon_list") != '') { ?><?php echo $this->config->get("tranda_icon_list"); ?><?php } else { ?>icon-th-list<?php } ?>"></i><span><?php echo $text_list; ?></span></a>');
      
        $.cookie('display', 'grid');
        $(".rating").tooltip();
        $(".middle a").tooltip();
    }
}

view = $.cookie('display');

if (view) {
    display(view);
} else {
    display('grid');
}
//--></script>
<?php echo $footer; ?>
Скорее всего проблема не с темплейтом категории, а точнее я уверен что он здесь не при чем. Скрипт фильтра подменяет содержимое контейнера продуктов на свое, соответсвенно там верстка дефолтного макета. Надо найти filterpro.tpl (если мне не изменяет память) и править верстку в нем.
 
  • Нравится
Реакции: SHOX
  • Заблокирован
  • #4
В етом фильтре нужно ставить в catalog/view/theme/default/stylesheet/filterpro.css 33 строку
Код:
#filterpro .price_slider {
padding: 8px;
}
тогда нормально стает ролик цены
 
у меня также бывают проблемы с этим модулем, когда фильтруешь он файл /ваша_тема/template/product/category.tpl подменяет своим сгенерированным /ваша_тема/template/product/filter.tpl но к сожалению не всегда все там правильно.

Допустим если я редактирую category.tpl то мне соответственно все изменения в category.tpl нужно переносить в filter.tpl например:

Хочу закомментировать Ограничение товаров на странице т.е лимит
Нахожу:

Код:
<div class="limit"><b><?php echo $text_limit; ?></b>
            <select onchange="location = this.value;">
                <?php foreach($limits as $limits) { ?>
                <?php if($limits['value'] == $limit) { ?>
                    <option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
                    <?php } else { ?>
                    <option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
                    <?php } ?>
                <?php } ?>
            </select>
        </div>

Комментрую и точно также в filter.tpl ...

Скорее всего вам нужно попросту из category.tpl перенести кусок кода отвечающий за изображение в filter.tpl

Чтобы более менее ореентироваться используйте встроенные в браузеры средства визуального редактирования.

И да обычно такое бывает с "недефолтными" шаблонами
 
Назад
Сверху