Post by Sakoulis » Tue Feb 21, 2017 7:20 am

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.

Newbie

Posts

Joined
Thu Jun 19, 2014 1:14 pm

Post by Sakoulis » Wed Feb 22, 2017 4:32 am

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

Code: Select all

<?php if ($thumb || $description) { ?>
and put BEFORE that line that line

Code: Select all

<?php if (($this->request->get['page']) == '1' || ($this->request->get['page']) == '') { ?>
and SEARCH for the line

Code: Select all

<?php if ($categories) { ?>
and put BEFORE that line that line

Code: Select all

<?php } ?>
In other words, SEARCH for the code

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 } ?>
and REPLACE it with

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 } ?>

Newbie

Posts

Joined
Thu Jun 19, 2014 1:14 pm

Post by Sakoulis » Wed Feb 22, 2017 4:35 am

Here is an .xml file I made so you can avoid editing the source files by uploading the file to vqmod/xml folder.

Attachments


Newbie

Posts

Joined
Thu Jun 19, 2014 1:14 pm

Post by vesel@abv.bg » Wed Mar 15, 2017 1:46 pm

Which OC version is that?
Not working on 2.2.

Newbie

Posts

Joined
Fri May 27, 2016 5:29 am
Who is online

Users browsing this forum: No registered users and 35 guests