Hello all.
I would like to show the category description only when the first page of the products' of any category is shown. When a user selects the 2nd page, the 3rd page and so on, the category description will not be shown.
Is there any easy way to do it?
Thanks in advance.
I would like to show the category description only when the first page of the products' of any category is shown. When a user selects the 2nd page, the 3rd page and so on, the category description will not be shown.
Is there any easy way to do it?
Thanks in advance.
I tried myself and I made it. Here is the solution:
In file "catalog/view/theme/default/template/product/category.tpl"
SEARCH for the line
and put BEFORE that line that line
and SEARCH for the line
and put BEFORE that line that line
In other words, SEARCH for the code
and REPLACE it with
In file "catalog/view/theme/default/template/product/category.tpl"
SEARCH for the line
Code: Select all
<?php if ($thumb || $description) { ?>
Code: Select all
<?php if (($this->request->get['page']) == '1' || ($this->request->get['page']) == '') { ?>
Code: Select all
<?php if ($categories) { ?>
Code: Select all
<?php } ?>
Code: Select all
<?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 MijoShop::get('base')->triggerContentPlg($description); ?>
<?php } ?>
</div>
<?php } ?>
Code: Select all
<?php if (($this->request->get['page']) == '1' || ($this->request->get['page']) == '') { ?>
<?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 MijoShop::get('base')->triggerContentPlg($description); ?>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
Here is an .xml file I made so you can avoid editing the source files by uploading the file to vqmod/xml folder.
I bump this thread i'm facing the same issue in opencart 3.0.3.3 does anyone have a soulution for this problem?
Normally, for OC v2.2x and above, an event would need to be created. However, to convert the codes to OC v3.x releases, it is as followed.Sakoulis wrote: ↑Wed Feb 22, 2017 4:32 amI tried myself and I made it. Here is the solution:
In file "catalog/view/theme/default/template/product/category.tpl"
SEARCH for the lineand put BEFORE that line that lineCode: Select all
<?php if ($thumb || $description) { ?>
and SEARCH for the lineCode: Select all
<?php if (($this->request->get['page']) == '1' || ($this->request->get['page']) == '') { ?>
and put BEFORE that line that lineCode: Select all
<?php if ($categories) { ?>
In other words, SEARCH for the codeCode: Select all
<?php } ?>
and REPLACE it withCode: Select all
<?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 MijoShop::get('base')->triggerContentPlg($description); ?> <?php } ?> </div> <?php } ?>
Code: Select all
<?php if (($this->request->get['page']) == '1' || ($this->request->get['page']) == '') { ?> <?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 MijoShop::get('base')->triggerContentPlg($description); ?> <?php } ?> </div> <?php } ?> <?php } ?>
In catalog/controller/product/category.php file, find:
Code: Select all
$data['breadcrumbs'] = array();
Code: Select all
$data['page'] = $page;
Code: Select all
{% if thumb or description %}
Code: Select all
{% if page %}
Code: Select all
{% if categories %}
Code: Select all
{% endif %}
This should resolve the issue.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: Google [Bot] and 208 guests