Jump to content
Sign in to follow this  
prazhma

Вывод подкатегорий с фото

Recommended Posts

OpenCart Version 1.5.4.1 тема hyla

Народ тыкните носов вечер сижу не могу найти переменные на фотографию подкатегории, ситуация такая , хочу сделать что бы при открытии категории открывался список подкатегорий и что бы у каждой из них своя фотка. --Модераторы если не в тот раздел запостил перенесите плиз--

вот что сделал в catalog /theme /template /product/category.tpl

<?php echo $header; ?><div id="contentwrapper"><?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">
<div class="image"><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ?>" /></div>
<?php if ($thumb) { ?>

<?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) <= 1) { ?>
<ul>
  <?php foreach ($categories as $category) { ?>
  <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
  <?php } ?>
</ul>
<?php } else { ?>
<?php for ($i = 0; $i < count($categories) ;)/>/>/>/> { ?>
<ul>
  <?php $j = $i + ceil(count($categories) / 6); ?>
  <?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>
<?php } ?>
<?php } ?>
 </div>
 <?php } ?>
 <?php if ($products) { ?>
 <div class="product-filter">
<div class="display"><span class="displaytext"><?php echo $text_display; ?></span> <div class="listviewactive"><span class="listtext"><?php echo $text_list; ?></span></div><a onclick="display(\'grid\');"><div class="gridview"><span class="gridtext"><?php echo $text_grid; ?></span></div></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>
 <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/hyla/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 class="wishlist"><a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><?php echo $button_wishlist; ?></a></div>
  <div class="compare"><a 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></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>';
  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();
  html += '  <div class="cart">' + $(element).find('.cart').html() + '</div>';
  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>';
  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>   <?php echo $text_list; ?> <img src="catalog/view/theme/hyla/image/product-list.png" alt="<?php echo $text_list; ?>" title="<?php echo $text_list; ?>" /> <b>/</b> <a onclick="display(\'grid\');"><?php echo $text_grid; ?></a> <img src="catalog/view/theme/hyla/image/product-grid.png" alt="<?php echo $text_grid; ?>" title="<?php echo $text_grid; ?>" onclick="display(\'grid\');"/>');
 $.cookie('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>';
  }
  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>';
  $(element).html(html);
 });
 $('.display').html('<b><?php echo $text_display; ?></b>   <a onclick="display(\'list\');"><?php echo $text_list; ?></a> <img src="catalog/view/theme/hyla/image/product-list.png" alt="<?php echo $text_list; ?>" title="<?php echo $text_list; ?>" onclick="display(\'list\');"/> <b>/</b> <?php echo $text_grid; ?> <img src="catalog/view/theme/hyla/image/product-grid.png" alt="<?php echo $text_grid; ?>" title="<?php echo $text_grid; ?>"/>');
 $.cookie('display', 'grid');
}
}
view = $.cookie('display');
if (view) {
display(view);
} else {
display('list');
}
//--></script>
<?php echo $footer; ?>

Вот что из этого получилось , но хочется с фотками , не могу найти переменную :cry:

1.jpg

Share this post


Link to post
Share on other sites

Задался той же целью... И столкнулся с той же проблемой :(

Share this post


Link to post
Share on other sites

рекомендую задаться поиском по форуму и по сайту опенкарт
refine search
http://www.opencart.com/index.php?route=extension/extension/info&extension_id=3907&filter_search=refine

 

Сделал ручную установку, xml выдаёт 500 ошибку....

Меня смутило что в описании на странице подходит для 1.5.4, а в архиве только для других версий...

 

В коментах пишут что должно работать, в чем может быть причина?

Share this post


Link to post
Share on other sites

Та-же тема, та-же проблема=( Пооомооогиииитееее! 

Share this post


Link to post
Share on other sites

Замените 2 файла и баста.

 

catalog\controller\product\category.php     и    catalog\view\theme\default\template\product\category.tpl

 

http://zalil.ru/34617599

 

в архиве 2 файла с расширениями, распихайте соответсвенно путям. 

  • +1 1

Share this post


Link to post
Share on other sites

Скажите актуально это в новой версии 2.1.0.2

Или может быть шаблон подскажете где посмотреть где это реализовано уже...

Edited by Respectiv

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.