Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Скрыть категорию из синдартного модуля категории?


yurame1nik
 Share

Recommended Posts

Всем здравствуйте!

Есть решение згдесь на форуме, только для 2.3

 

Скрытый текст
<div class="list-group">
  <?php foreach ($categories as $category) { ?>
  <?php if ($category['category_id'] != згдесь указываем ID категории которую нужно скрыть) { ?>
  <?php if ($category['category_id'] == $category_id) { ?>
  <a href="<?php echo $category['href']; ?>" class="list-group-item active"><?php echo $category['name']; ?></a>
  <?php if ($category['children']) { ?>
  <?php foreach ($category['children'] as $child) { ?>
  <?php if ($child['category_id'] == $child_id) { ?>
  <a href="<?php echo $child['href']; ?>" class="list-group-item active">   - <?php echo $child['name']; ?></a>
  <?php } else { ?>
  <a href="<?php echo $child['href']; ?>" class="list-group-item">   - <?php echo $child['name']; ?></a>
  <?php } ?>  
  <?php } ?>
  <?php } ?>
  <?php } else { ?>
  <a href="<?php echo $category['href']; ?>" class="list-group-item"><?php echo $category['name']; ?></a>
  <?php } ?>
  <?php } ?>
  <?php } ?>
</div>

 

 

Подскажите пожалуйси как это условие

<?php if ($category['category_id'] != згдесь указываем ID категории которую нужно скрыть) { ?>

добавить в twig, скрыть например категории с ID 10, 12, 18.

 

{% if category.category_id !=  ? %} 

Edited by yurame1nik
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

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.