Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

<div class="description">null</div>


seolink

Recommended Posts

Проблема в категориях товаров, когда выбираю показать списком: вместо описания показывает null.

Тоесть строка

<div class="description">null</div>

 

проверял контроллер категории вроде все ок.

 

Контроллер /controller/category.php

 

class ControllerProductCategory extends Controller {
public function index() {
$this->language->load('product/category');

$this->load->model('catalog/category');

$this->load->model('catalog/product');

$this->load->model('tool/image');

if (isset($this->request->get['filter'])) {
$filter = $this->request->get['filter'];
$this->document->setRobots('noindex,follow');
} else {
$filter = '';
}

if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
$this->document->setRobots('noindex,follow');
} else {
$sort = 'p.model';
}

if (isset($this->request->get['order'])) {
$order = $this->request->get['order'];
} else {
$order = 'ASK';
}

if (isset($this->request->get['coolfilter'])) {
$coolfilter = $this->request->get['coolfilter'];
$this->document->setRobots('noindex,follow');
} else {
$coolfilter = '';
}

if (isset($this->request->get['page'])) {
$page = $this->request->get['page'];
$this->document->setRobots('index,follow');
} else {
$page = 1;
}

if (isset($this->request->get['limit'])) {
$limit = $this->request->get['limit'];
$this->document->setRobots('noindex,follow');
} else {
$limit = $this->config->get('config_catalog_limit');
}

$this->data['breadcrumbs'] = array();

$this->data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/home'),
'separator' => false
);

if (isset($this->request->get['path'])) {
$url = '';

if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}

if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
}

if (isset($this->request->get['coolfilter'])) {
$url .= '&coolfilter=' . $this->request->get['coolfilter'];
}

if (isset($this->request->get['limit'])) {
$url .= '&limit=' . $this->request->get['limit'];
}

$path = '';

$parts = explode('_', (string)$this->request->get['path']);

$category_id = (int)array_pop($parts);

foreach ($parts as $path_id) {
if (!$path) {
$path = (int)$path_id;
} else {
$path .= '_' . (int)$path_id;
}

$category_info = $this->model_catalog_category->getCategory($path_id);

if ($category_info || $path_id == 0) {

if ($path_id == 0) {
$category_info['name'] = $this->language->get('text_all_products');
}
$this->data['breadcrumbs'][] = array(
'text' => $category_info['name'],
'href' => $this->url->link('product/category', 'path=' . $path . $url),
'separator' => $this->language->get('text_separator')
);
}
}
} else {
$category_id = 0;
}

$category_info = $this->model_catalog_category->getCategory($category_id);

if ($category_info || $category_id == 0) {
if ($category_id == 0) {
$category_info = array('name' => $this->language->get('text_all_products'),
'seo_title' => '',
'meta_description' => '',
'meta_keyword' => '',
'seo_h1' => $this->language->get('text_all_products'),
'image' => '',
'description' => '');
//india style fix
$this->request->get['path'] = 0;
//india style fix
}

if ($category_info['seo_title']) {
if ($page > 1) {
$this->document->setTitle($category_info['seo_title'].' - Страница ' .$page );
}
else {
$this->document->setTitle($category_info['seo_title']);
}
} else {
$this->document->setTitle($category_info['name']);

}
if ($category_info['meta_description']) {
if ($page > 1) {
$this->document->setDescription($category_info['meta_description'].' - Страница ' .$page );
}
else {
$this->document->setDescription($category_info['meta_description']);
}
} else {
$this->document->setDescription($category_info['name']);

}



$this->document->setKeywords($category_info['meta_keyword']);

if ($category_info['seo_h1']) {
$this->data['heading_title'] = $category_info['seo_h1'];
} else {
$this->data['heading_title'] = $category_info['name'];
}

$this->document->addScript('catalog/view/javascript/jquery/jquery.total-storage.min.js');
$this->document->addScript('catalog/view/javascript/jquery/jail/jail.min.js');

$this->data['text_refine'] = $this->language->get('text_refine');
$this->data['text_empty'] = $this->language->get('text_empty');
$this->data['text_quantity'] = $this->language->get('text_quantity');
$this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
$this->data['text_model'] = $this->language->get('text_model');
$this->data['text_price'] = $this->language->get('text_price');
$this->data['text_tax'] = $this->language->get('text_tax');
$this->data['text_points'] = $this->language->get('text_points');
$this->data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0));
$this->data['text_display'] = $this->language->get('text_display');
$this->data['text_list'] = $this->language->get('text_list');
$this->data['text_grid'] = $this->language->get('text_grid');
$this->data['text_sort'] = $this->language->get('text_sort');
$this->data['text_limit'] = $this->language->get('text_limit');
$this->data['text_benefits'] = $this->language->get('text_benefits');

$this->data['button_cart'] = $this->language->get('button_cart');
$this->data['button_wishlist'] = $this->language->get('button_wishlist');
$this->data['button_compare'] = $this->language->get('button_compare');
$this->data['button_continue'] = $this->language->get('button_continue');

// Set the last category breadcrumb
$url = '';

if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}

if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
}

if (isset($this->request->get['coolfilter'])) {
$url .= '&coolfilter=' . $this->request->get['coolfilter'];
}

if (isset($this->request->get['page'])) {
$url .= '&page=' . $this->request->get['page'];
}

if (isset($this->request->get['coolfilter'])) {
$url .= '&coolfilter=' . $this->request->get['coolfilter'];
}

if (isset($this->request->get['limit'])) {
$url .= '&limit=' . $this->request->get['limit'];
}

$this->data['breadcrumbs'][] = array(
'text' => $category_info['name'],
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path']),
'separator' => $this->language->get('text_separator')
);

if ($category_info['image']) {
$this->data['thumb'] = $this->model_tool_image->resize($category_info['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
$this->document->setOgImage($this->data['thumb']);
} else {
$this->data['thumb'] = '';
}

$this->data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');
$this->data['description_bottom'] = html_entity_decode($category_info['description_bottom'], ENT_QUOTES, 'UTF-8');
$this->data['compare'] = $this->url->link('product/compare');

$url = '';

if (isset($this->request->get['filter'])) {
$url .= '&filter=' . $this->request->get['filter'];
}

if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}

if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
}

if (isset($this->request->get['coolfilter'])) {
$url .= '&coolfilter=' . $this->request->get['coolfilter'];
}

if (isset($this->request->get['limit'])) {
$url .= '&limit=' . $this->request->get['limit'];
}

$this->data['categories'] = array();

$results = $this->model_catalog_category->getCategories($category_id);

foreach ($results as $result) {
$data = array(
'filter_category_id' => $result['category_id'],
'filter_sub_category' => true,
'coolfilter' => $coolfilter
);
//картинка
if ($result['image']) {
$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
}
else {
$image = $this->model_tool_image->resize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
}
//
//$product_total = $this->model_catalog_product->getTotalProducts($data);

$this->data['categories'][] = array(
// 'name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),
'name' => $result['name'],

'thumb' => $image,
// 'count' => $product_total,
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
);
}

$this->data['products'] = array();

$data = array(
'filter_category_id' => $category_id,
'filter_filter' => $filter,
'sort' => $sort,
'order' => $order,
'start' => ($page - 1) * $limit,
'limit' => $limit,
'coolfilter' => $coolfilter
);

//$product_total = $this->model_catalog_product->getTotalProducts($data);

$results = $this->model_catalog_product->getProducts($data);

foreach ($results as $result) {
if ($result['image']) {
$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
$imagewidth = $this->config->get('config_image_product_width');
$imageheight = $this->config->get('config_image_product_height');
} else {
$image = false;
$imagewidth = '';
$imageheight = '';
}

if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
} else {
$price = false;
}

if ((float)$result['special']) {
$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
} else {
$special = false;
}

if ($this->config->get('config_tax')) {
$tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']);
} else {
$tax = false;
}

if ($this->config->get('config_review_status')) {
$rating = (int)$result['rating'];
} else {
$rating = false;
}

$stickers = $this->getStickers($result['product_id']) ;
//ocshop benefits
$productbenefits = $this->model_catalog_product->getProductBenefitsbyProductId($result['product_id']);

$benefits = array();

foreach ($productbenefits as $benefit) {
if ($benefit['image'] && file_exists(DIR_IMAGE . $benefit['image'])) {
$bimage = $benefit['image'];
if ($benefit['type']) {
$bimage = $this->model_tool_image->resize($bimage, 25, 25);
} else {
$bimage = $this->model_tool_image->resize($bimage, 120, 60);
}
} else {
$bimage = 'no_image.jpg';
}

$benefits[] = array(
'benefit_id' => $benefit['benefit_id'],
'name' => $benefit['name'],
'description' => strip_tags(html_entity_decode($benefit['description'])),
'thumb' => $bimage,
'link' => $benefit['link'],
'type' => $benefit['type']
//'sort_order' => $benefit['sort_order']
);
}

//ocshop benefits
$this->data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'thumbwidth' => $imagewidth,
'thumbheight' => $imageheight,
'name' => $result['name'],
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 300) . '..',
'description_mini' => html_entity_decode ($result['description_mini']),
//'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']),
'price' => $price,
'special' => $special,
'tax' => $tax,
'rating' => $result['rating'],
'sticker' => $stickers,
'benefits' => $benefits,
'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
);
}

$url = '';

if (isset($this->request->get['filter'])) {
$url .= '&filter=' . $this->request->get['filter'];
}

if (isset($this->request->get['coolfilter'])) {
$url .= '&coolfilter=' . $this->request->get['coolfilter'];
}

if (isset($this->request->get['limit'])) {
$url .= '&limit=' . $this->request->get['limit'];
}

if (isset($this->request->get['coolfilter'])) {
$url .= '&coolfilter=' . $this->request->get['coolfilter'];
}

$this->data['sorts'] = array();

$this->data['sorts'][] = array(
'text' => $this->language->get('text_default'),
'value' => 'p.sort_order-ASC',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url)
);

$this->data['sorts'][] = array(
'text' => $this->language->get('text_name_asc'),
'value' => 'pd.name-ASC',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC' . $url)
);

$this->data['sorts'][] = array(
'text' => $this->language->get('text_name_desc'),
'value' => 'pd.name-DESC',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC' . $url)
);

$this->data['sorts'][] = array(
'text' => $this->language->get('text_price_asc'),
'value' => 'p.price-ASC',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=ASC' . $url)
);

$this->data['sorts'][] = array(
'text' => $this->language->get('text_price_desc'),
'value' => 'p.price-DESC',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=DESC' . $url)
);

if ($this->config->get('config_review_status')) {
$this->data['sorts'][] = array(
'text' => $this->language->get('text_rating_desc'),
'value' => 'rating-DESC',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=DESC' . $url)
);

$this->data['sorts'][] = array(
'text' => $this->language->get('text_rating_asc'),
'value' => 'rating-ASC',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=ASC' . $url)
);
}

$this->data['sorts'][] = array(
'text' => $this->language->get('text_model_asc'),
'value' => 'p.model-ASC',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=ASC' . $url)
);

$this->data['sorts'][] = array(
'text' => $this->language->get('text_model_desc'),
'value' => 'p.model-DESC',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=DESC' . $url)
);

$url = '';

if (isset($this->request->get['filter'])) {
$url .= '&filter=' . $this->request->get['filter'];
}

if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}

if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
}

if (isset($this->request->get['coolfilter'])) {
$url .= '&coolfilter=' . $this->request->get['coolfilter'];
}

$this->data['limits'] = array();

$limits = array_unique(array($this->config->get('config_catalog_limit'), 40));

sort($limits);

foreach($limits as $value){
$this->data['limits'][] = array(
'text' => $value,
'value' => $value,
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&limit=' . $value)
);
}

$url = '';

if (isset($this->request->get['filter'])) {
$url .= '&filter=' . $this->request->get['filter'];
}

if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}

if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
}

if (isset($this->request->get['limit'])) {
$url .= '&limit=' . $this->request->get['limit'];
}

if (isset($this->request->get['coolfilter'])) {
$url .= '&coolfilter=' . $this->request->get['coolfilter'];
}

$pagination = new Pagination();
$pagination->total = $product_total;
$pagination->page = $page;
$pagination->limit = $limit;
$pagination->text = $this->language->get('text_pagination');
$pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}');

$this->data['pagination'] = $pagination->render();

$this->data['sort'] = $sort;
$this->data['order'] = $order;
$this->data['limit'] = $limit;

$this->data['continue'] = $this->url->link('common/home');

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) {
$this->template = $this->config->get('config_template') . '/template/product/category.tpl';
} else {
$this->template = 'default/template/product/category.tpl';
}

$this->children = array(
'common/column_left',
'common/column_right',
'common/content_top',
'common/content_bottom',
'common/footer',
'common/header'
);

$this->response->setOutput($this->render());
} else {
$url = '';

if (isset($this->request->get['path'])) {
$url .= '&path=' . $this->request->get['path'];
}

if (isset($this->request->get['filter'])) {
$url .= '&filter=' . $this->request->get['filter'];
}

if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}

if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
}

if (isset($this->request->get['page'])) {
$url .= '&page=' . $this->request->get['page'];
}

if (isset($this->request->get['limit'])) {
$url .= '&limit=' . $this->request->get['limit'];
}

$this->data['breadcrumbs'][] = array(
'text' => $this->language->get('text_error'),
'href' => $this->url->link('product/category', $url),
'separator' => $this->language->get('text_separator')
);

$this->document->setTitle($this->language->get('text_error'));

$this->data['heading_title'] = $this->language->get('text_error');

$this->data['text_error'] = $this->language->get('text_error');

$this->data['button_continue'] = $this->language->get('button_continue');

$this->data['continue'] = $this->url->link('common/home');

$this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
$this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
} else {
$this->template = 'default/template/error/not_found.tpl';
}

$this->children = array(
'common/column_left',
'common/column_right',
'common/content_top',
'common/content_bottom',
'common/footer',
'common/header'
);

$this->response->setOutput($this->render());
}
}

private function getStickers($product_id) {

$stickers = $this->model_catalog_product->getProductStickerbyProductId($product_id) ;

if (!$stickers) {
return;
}

$this->data['stickers'] = array();

foreach ($stickers as $sticker) {
$this->data['stickers'][] = array(
'position' => $sticker['position'],
'image' => HTTP_SERVER . 'image/' . $sticker['image']
);
}


if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/stickers.tpl')) {
$this->template = $this->config->get('config_template') . '/template/product/stickers.tpl';
} else {
$this->template = 'default/template/product/stickers.tpl';
}

return $this->render();

}
}
?>

 

Стоит еще Фильтр про. Когда фильтрую им товары то 300 сим. описания подгружаются.

 

Шаблон

/template/product/category.tpl

<?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 $i=> $breadcrumb) { ?>
	<?php echo $breadcrumb['separator']; ?><?php if($i+1<count($breadcrumbs)) { ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; 		?></a> <?php } else { ?><?php echo $breadcrumb['text']; ?><?php } ?>
	<?php } ?>
  </div>
  <h1><?php echo $heading_title; ?></h1>
  <?php if ($description) { ?>
  <div class="category-info row">
    <!--<?php if ($thumb) { ?>
    <div class="image"><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ?>" /></div>
    <?php } ?>-->
    <div class="col-lg-12">
    <?php if ($description) { ?>
    <?php echo $description; ?>
    <?php } ?>
    </div>
  </div>
  <?php } ?>
   <?php if($this->config->get('marketshop_refine_categories')== 1) { ?> 
  <?php if ($categories) { ?>
  <h2><?php echo $text_refine; ?></h2>
  <?php if($this->config->get('marketshop_refine_categories_images')== 1) { ?>
   <div class="category-list-thumb row" style="margin-bottom:0px;">

    <?php $counter = 0; foreach ($categories as $category) {?>
 
    <?php if ($column_left && $column_right) { ?>
    <?php $class_thumb = 'col-lg-3 col-md-3 col-sm-2 col-xs-4'; ?>
    <?php } elseif ($column_left || $column_right) { ?>
    <?php $class_thumb = 'col-lg-2 col-md-2 col-sm-2 col-xs-4'; ?>
    <?php } else { ?>
    <?php $class_thumb = 'col-lg-1 col-md-2 col-sm-2 col-xs-4'; ?>
    <?php } ?>
    

<div class="<?php echo $class_thumb; ?>">
				<?php if ($category['thumb']) { ?>
				<a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['thumb']; ?>" alt="<?php echo $category['name']; ?>" /></a>
                <?php } else { ?>
                <a href="<?php echo $category['href']; ?>"><img src="catalog/view/theme/marketshop/image/no_image.jpg" alt="<?php echo $category['name']; ?>" /></a>
				<?php } ?>
				<a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
			</div>
	<?php $counter++; } ?>
  </div>
  <?php if ($column_left && $column_right) { ?>
<script>
$(document).ready(function(){
$screensize = $(window).width();
    if ($screensize > 1199) {
        $('.category-list > div:nth-child(4n)').after('<div class="clearfix visible-lg-block"></div>');
    }
    if ($screensize < 1199) {
        $('.category-list > div:nth-child(4n)').after('<div class="clearfix visible-lg-block visible-md-block"></div>');
    }
	if ($screensize < 991) {
        $('.category-list > div:nth-child(6n)').after('<div class="clearfix visible-lg-block visible-sm-block"></div>');
    }
	if ($screensize < 767) {
        $('.category-list > div:nth-child(3n)').after('<div class="clearfix visible-lg-block visible-xs-block"></div>');
    }
$( window ).resize(function() {
    $screensize = $(window).width();
    if ($screensize > 1199) {
        $(".category-list > .clearfix.visible-lg-block").remove();
        $('.category-list > div:nth-child(4n)').after('<div class="clearfix visible-lg-block"></div>');
    } 
    if ($screensize < 1199) {
        $(".category-list > .clearfix.visible-lg-block").remove();
        $('.category-list > div:nth-child(4n)').after('<div class="clearfix visible-lg-block visible-md-block"></div>');
    }
	if ($screensize < 991) {
        $(".category-list > .clearfix.visible-lg-block").remove();
        $('.category-list > div:nth-child(6n)').after('<div class="clearfix visible-lg-block visible-sm-block"></div>');
    }
	if ($screensize < 767) {
        $(".category-list > .clearfix.visible-lg-block").remove();
        $('.category-list > div:nth-child(3n)').after('<div class="clearfix visible-lg-block visible-xs-block"></div>');
    }
});});
</script>
    <?php } elseif ($column_left || $column_right) { ?>
<script>
$(document).ready(function(){
$screensize = $(window).width();
    if ($screensize > 1199) {
        $('.category-list > div:nth-child(6n)').after('<div class="clearfix visible-lg-block"></div>');
    }
    if ($screensize < 1199) {
        $('.category-list > div:nth-child(6n)').after('<div class="clearfix visible-lg-block visible-md-block"></div>');
    }
	if ($screensize < 991) {
        $('.category-list > div:nth-child(6n)').after('<div class="clearfix visible-lg-block visible-sm-block"></div>');
    }
	if ($screensize < 767) {
        $('.category-list > div:nth-child(3n)').after('<div class="clearfix visible-lg-block visible-xs-block"></div>');
    }
$( window ).resize(function() {
    $screensize = $(window).width();
    if ($screensize > 1199) {
        $(".category-list > .clearfix.visible-lg-block").remove();
        $('.category-list > div:nth-child(6n)').after('<div class="clearfix visible-lg-block"></div>');
    } 
    if ($screensize < 1199) {
        $(".category-list > .clearfix.visible-lg-block").remove();
        $('.category-list > div:nth-child(6n)').after('<div class="clearfix visible-lg-block visible-md-block"></div>');
    }
	if ($screensize < 991) {
        $(".category-list > .clearfix.visible-lg-block").remove();
        $('.category-list > div:nth-child(6n)').after('<div class="clearfix visible-lg-block visible-sm-block"></div>');
    }
	if ($screensize < 767) {
        $(".category-list > .clearfix.visible-lg-block").remove();
        $('.category-list > div:nth-child(3n)').after('<div class="clearfix visible-lg-block visible-xs-block"></div>');
    }
});});
</script>
    <?php } else { ?>
    <script type="text/javascript">
$(document).ready(function(){
$screensize = $(window).width();
    if ($screensize > 1199) {
        $('.category-list > div:nth-child(12n)').after('<div class="clearfix visible-lg-block"></div>');
    }
    if ($screensize < 1199) {
        $('.category-list > div:nth-child(6n)').after('<div class="clearfix visible-lg-block visible-md-block"></div>');
    }
	if ($screensize < 991) {
        $('.category-list > div:nth-child(6n)').after('<div class="clearfix visible-lg-block visible-sm-block"></div>');
    }
	if ($screensize < 767) {
        $('.category-list > div:nth-child(3n)').after('<div class="clearfix visible-lg-block visible-xs-block"></div>');
    }
$( window ).resize(function() {
    $screensize = $(window).width();
    if ($screensize > 1199) {
        $(".category-list > .clearfix.visible-lg-block").remove();
        $('.category-list > div:nth-child(12n)').after('<div class="clearfix visible-lg-block"></div>');
    } 
    if ($screensize < 1199) {
        $(".category-list > .clearfix.visible-lg-block").remove();
        $('.category-list > div:nth-child(6n)').after('<div class="clearfix visible-lg-block visible-md-block"></div>');
    }
	if ($screensize < 991) {
        $(".category-list > .clearfix.visible-lg-block").remove();
        $('.category-list > div:nth-child(6n)').after('<div class="clearfix visible-lg-block visible-sm-block"></div>');
    }
	if ($screensize < 767) {
        $(".category-list > .clearfix.visible-lg-block").remove();
        $('.category-list > div:nth-child(3n)').after('<div class="clearfix visible-lg-block visible-xs-block"></div>');
    }
});});
</script>
    <?php } ?>
  <?php } else { ?>
  <div class="category-list row">
    <?php if (count($categories) <= 5) { ?>
    <div class="col-sm-3">
    <ul class="list-item">
      <?php foreach ($categories as $category) { ?>
      <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
      <?php } ?>
    </ul>
    </div>
    <?php } else { ?>
    <?php for ($i = 0; $i < count($categories);) { ?>
    <div class="col-sm-3">
    <ul class="list-item">
      <?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']; ?>"><?php echo $categories[$i]['name']; ?></a></li>
      <?php } ?>
      <?php } ?>
    </ul>
    </div>
    <?php } ?>
    <?php } ?>
  </div>
  <?php } ?>
  <?php } ?>
  
  <?php } ?>
  <?php if ($products) { ?>
  <div class="product-filter">
    <div class="display"><b><?php echo $text_display; ?></b> <span class="grid1-icon"><?php echo $text_list; ?></span><a class="list-icon" onclick="display('grid');"><?php echo $text_grid; ?></a></div><div class="product-compare"><a href="<?php echo $compare; ?>" id="compare-total"><?php echo $text_compare; ?></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>
  
  <?php if($this->config->get('marketshop_category_product_per_row')== 'pr3') { ?>
  	<?php if ($column_left && $column_right) { ?>
    <?php $class_grid = 'col-lg-4 col-md-6 col-sm-4 col-xs-12'; ?>
    <script type="text/javascript">
$(document).ready(function(){
$screensize = $(window).width();
    if ($screensize > 1199) {
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block"></span>');
    }
    if ($screensize < 1199) {
        $('#content .product-grid > div:nth-child(2n)').after('<span class="clearfix visible-lg-block visible-md-block"></span>');
    }
	if ($screensize < 991) {
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block visible-sm-block"></span>');
    }
$( window ).resize(function() {
    $screensize = $(window).width();
    if ($screensize > 1199) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block"></span>');
    } 
    if ($screensize < 1199) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(2n)').after('<span class="clearfix visible-lg-block visible-md-block"></span>');
    }
	if ($screensize < 991) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block visible-sm-block"></span>');
    }
	if ($screensize < 767) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
    }
});});
</script>
    <?php } elseif ($column_left || $column_right) { ?>
    <?php $class_grid = 'col-lg-4 col-md-4 col-sm-4 col-xs-12'; ?>
    <script type="text/javascript">
$(document).ready(function(){
$screensize = $(window).width();
    if ($screensize > 1199) {
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block"></span>');
    }
    if ($screensize < 1199) {
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block visible-md-block"></span>');
    }
	if ($screensize < 991) {
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block visible-sm-block"></span>');
    }
$( window ).resize(function() {
    $screensize = $(window).width();
    if ($screensize > 1199) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block"></span>');
    } 
    if ($screensize < 1199) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block visible-md-block"></span>');
    }
	if ($screensize < 991) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block visible-sm-block"></span>');
    }
	if ($screensize < 767) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
    }
});});
</script>
    <?php } else { ?>
    <?php $class_grid = 'col-lg-4 col-md-4 col-sm-4 col-xs-12'; ?>
    <script type="text/javascript">
$(document).ready(function(){
$screensize = $(window).width();
    if ($screensize > 1199) {
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block"></span>');
    }
    if ($screensize < 1199) {
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block visible-md-block"></span>');
    }
	if ($screensize < 991) {
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block visible-sm-block"></span>');
    }
$( window ).resize(function() {
    $screensize = $(window).width();
    if ($screensize > 1199) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block"></span>');
    } 
    if ($screensize < 1199) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block visible-md-block"></span>');
    }
	if ($screensize < 991) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(3n)').after('<span class="clearfix visible-lg-block visible-sm-block"></span>');
    }
	if ($screensize < 767) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
    }
});});
</script>
    <?php } ?>
  <?php } elseif ($this->config->get('marketshop_category_product_per_row')== 'pr4') {?>
  	<?php if ($column_left && $column_right) { ?>
    <?php $class_grid = 'col-lg-3 col-md-3 col-sm-3 col-xs-12'; ?>
    <?php } elseif ($column_left || $column_right) { ?>
    <?php $class_grid = 'col-lg-3 col-md-3 col-sm-3 col-xs-12'; ?>
    <?php } else { ?>
    <?php $class_grid = 'col-lg-3 col-md-3 col-sm-3 col-xs-12'; ?>
    <?php } ?>
	<script type="text/javascript">
$(document).ready(function(){
$screensize = $(window).width();
    if ($screensize > 1199) {
        $('#content .product-grid > div:nth-child(4n)').after('<span class="clearfix visible-lg-block"></span>');
    }
    if ($screensize < 1199) {
        $('#content .product-grid > div:nth-child(4n)').after('<span class="clearfix visible-lg-block visible-md-block"></span>');
    }
	if ($screensize < 991) {
        $('#content .product-grid > div:nth-child(4n)').after('<span class="clearfix visible-lg-block visible-sm-block"></span>');
    }
$( window ).resize(function() {
    $screensize = $(window).width();
    if ($screensize > 1199) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(4n)').after('<span class="clearfix visible-lg-block"></span>');
    } 
    if ($screensize < 1199) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(4n)').after('<span class="clearfix visible-lg-block visible-md-block"></span>');
    }
	if ($screensize < 991) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(4n)').after('<span class="clearfix visible-lg-block visible-sm-block"></span>');
    }
	if ($screensize < 767) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
    }
});});
</script>
  <?php } elseif ($this->config->get('marketshop_category_product_per_row')== 'pr5') {?>
  	<?php if ($column_left && $column_right) { ?>
    <?php $class_grid = 'col-lg-5ths col-md-5ths col-sm-3 col-xs-12'; ?>
    <?php } elseif ($column_left || $column_right) { ?>
    <?php $class_grid = 'col-lg-5ths col-md-5ths col-sm-3 col-xs-12'; ?>
    <?php } else { ?>
    <?php $class_grid = 'col-lg-5ths col-md-5ths col-sm-3 col-xs-12'; ?>
    <?php } ?>
	<script type="text/javascript">
$(document).ready(function(){
$screensize = $(window).width();
    if ($screensize > 1199) {
        $('#content .product-grid > div:nth-child(5n)').after('<span class="clearfix visible-lg-block"></span>');
    }
    if ($screensize < 1199) {
        $('#content .product-grid > div:nth-child(5n)').after('<span class="clearfix visible-lg-block visible-md-block"></span>');
    }
	if ($screensize < 991) {
        $('#content .product-grid > div:nth-child(4n)').after('<span class="clearfix visible-lg-block visible-sm-block"></span>');
    }
$( window ).resize(function() {
    $screensize = $(window).width();
    if ($screensize > 1199) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(5n)').after('<span class="clearfix visible-lg-block"></span>');
    } 
    if ($screensize < 1199) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(5n)').after('<span class="clearfix visible-lg-block visible-md-block"></span>');
    }
	if ($screensize < 991) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(4n)').after('<span class="clearfix visible-lg-block visible-sm-block"></span>');
    }
	if ($screensize < 767) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
    }
});});
</script>
  <?php } elseif ($this->config->get('marketshop_category_product_per_row')== 'pr6') {?>
  	<?php if ($column_left && $column_right) { ?>
    <?php $class_grid = 'col-lg-2 col-md-2 col-sm-3 col-xs-12'; ?>
    <?php } elseif ($column_left || $column_right) { ?>
    <?php $class_grid = 'col-lg-2 col-md-2 col-sm-3 col-xs-12'; ?>
    <?php } else { ?>
    <?php $class_grid = 'col-lg-2 col-md-2 col-sm-3 col-xs-12'; ?>
    <?php } ?>
    <script type="text/javascript">
$(document).ready(function(){
$screensize = $(window).width();
    if ($screensize > 1199) {
        $('#content .product-grid > div:nth-child(6n)').after('<span class="clearfix visible-lg-block"></span>');
    }
    if ($screensize < 1199) {
        $('#content .product-grid > div:nth-child(6n)').after('<span class="clearfix visible-lg-block visible-md-block"></span>');
    }
	if ($screensize < 991) {
        $('#content .product-grid > div:nth-child(4n)').after('<span class="clearfix visible-lg-block visible-sm-block"></span>');
    }
$( window ).resize(function() {
    $screensize = $(window).width();
    if ($screensize > 1199) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(6n)').after('<span class="clearfix visible-lg-block"></span>');
    } 
    if ($screensize < 1199) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(6n)').after('<span class="clearfix visible-lg-block visible-md-block"></span>');
    }
	if ($screensize < 991) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
        $('#content .product-grid > div:nth-child(4n)').after('<span class="clearfix visible-lg-block visible-sm-block"></span>');
    }
	if ($screensize < 767) {
        $("#content .product-grid > .clearfix.visible-lg-block").remove();
    }
});});
</script>
  <?php } ?>
    
  <div class="product-list row">
    <?php foreach ($products as $product) { ?>
    <div>
      <?php if ($product['thumb']) { ?>
	<div class="image"><?php echo $product['sticker']; ?><a href="<?php echo $product['href']; ?>">
	<div class="imagejail"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
	</div>
      <?php } ?>
      <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></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 if($this->config->get('marketshop_percentage_discount_badge')== 1) { ?><span class="saving">-<?php echo $product['saving']; ?>%</span><?php } ?>
        <?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/marketshop/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" title="<?php echo $button_cart; ?>"/>
      </div>
      
      <div class="wishlist"><a title="<?php echo $button_wishlist; ?>" onclick="addToWishList('<?php echo $product['product_id']; ?>');"><?php echo $button_wishlist; ?></a></div>
      <div class="compare"><a title="<?php echo $button_compare; ?>" onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></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>
    <?php if ($description_bottom) { ?>
	<div class="category-info-bottom">
    <?php echo $description_bottom; ?>
	</div>
	
    <?php } ?>
<script type="text/javascript"><!--
function display(view) {
	if (view == 'list') {
		$('#content .product-grid').attr('class', 'product-list row');
		$('#content .product-list > div').attr('class', 'col-xs-12');
		$('#content .product-list > div').each(function(index, element) {
			html = '<div class="left">';
			
			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>';
			// html += '<div class="attributes">' + $(element).find('.attributes').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>';
			html += '  <div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';
			html += '  <div class="compare">' + $(element).find('.compare').html() + '</div>';
			
			html += '</div>';
						
			$(element).html(html);
		});		
		
		$('.display').html('<b><?php echo $text_display; ?></b> <span class="grid1-icon"><?php echo $text_list; ?></span> <a title="<?php echo $text_grid; ?>" class="list-icon" onclick="display(\'grid\');"><?php echo $text_grid; ?></a>');
		
		$.totalStorage('display', 'list'); 
	} else {
		
		$('#content .product-list').attr('class', 'product-grid row');
		$('#content .product-grid > div').attr('class', '<?php if(isset($class_grid)) { ?><?php echo $class_grid; ?><?php } ?>');
		
		$('#content .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>';
			
			//benefits
			var benefit = $(element).find('.benefit').html();
			
			if (benefit != null) {
				html += '<div class="benefit-text"><?php echo $text_benefits; ?></div>';
				html += '  <div class="benefit">' + $(element).find('.benefit').html() + '</div>';
			}
			//benefits
			//benefits present
			var present = $(element).find('.present').html();
			
			if (present != null) {
				html += '  <div class="present">' + $(element).find('.present').html() + '</div>';
			}
			//benefits present
			
			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>';
			
			html += '<div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';
			html += '<div class="compare">' + $(element).find('.compare').html() + '</div><div class="clear"></div>';
			
			$(element).html(html);
		});	
					
		$('.display').html('<b><?php echo $text_display; ?></b> <a title="<?php echo $text_list; ?>" class="grid-icon" onclick="display(\'list\');"><?php echo $text_list; ?></a><span class="list1-icon"><?php echo $text_grid; ?></span>');
		
		$.totalStorage('display', 'grid');
	}
}

view = $.totalStorage('display');

if (view) {
	display(view);
} else {
	display('grid');
}
//--></script> 
<?php echo $footer; ?>
Надіслати
Поділитися на інших сайтах


  • 2 weeks later...
  • 3 weeks later...

 

Попробуйте в строку 442 файла tpl  добавить

      <div class="description"><?php echo $product['description']; ?></div>

Ну, или 

      <div class="description">бла-бла-бла</div>

 

Спасибо, при старом редактировании этот код почему то удаляли. Открыл еще раз файлы сборки где все работало корректно. Добавил не достающий код

      <div class="description">
      <?php if (!$product['description_mini']) { ?>
        <?php echo $product['description']; ?>
            <?php } else { ?>
        <?php echo $product['description_mini']; ?>
      <?php } ?>
      </div>
Надіслати
Поділитися на інших сайтах


  • 3 months later...

Это проблемы не решает, если вы не хотите выводить описание товара на странице категории, а скрывать его через стили плохая идея в плане сео

 

Решение: 

Удаляем вывод или комментируем описание в файле category.tpl

<div class="description">
      <?php if (!$product['description_mini']) { ?>
        <?php echo $product['description']; ?>
            <?php } else { ?>
        <?php echo $product['description_mini']; ?>
      <?php } ?>
      </div>

Удаляем или комментируем в файле /artsvet-m/public_html/catalog/view/javascript/common.js

html += '<div class="description">' + $(element).find('.description').html() + '</div>';

данный код находится в 2х местах. 147 строка и 177 строка

Змінено користувачем vanamas
Надіслати
Поділитися на інших сайтах


Створіть аккаунт або увійдіть для коментування

Ви повинні бути користувачем, щоб залишити коментар

Створити обліковий запис

Зареєструйтеся для отримання облікового запису. Це просто!

Зареєструвати аккаунт

Вхід

Уже зареєстровані? Увійдіть тут.

Вхід зараз
×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.