A
A
azaza2019-10-16 17:43:37
opencart
azaza, 2019-10-16 17:43:37

Opencart 2 - how to exclude a group of attributes or necessary attributes by ID?

Good time everyone,
there are OC 2.3 attribute output cycles

<?php if ($attribute_groups) { ?>
                <?php foreach ($attribute_groups as $attribute_group) { ?>

                   <?php echo $attribute_group['name']; ?>
                      <?php foreach ($attribute_group['attribute'] as $attribute) { ?>

                         <?php echo $attribute['name']; ?>
                         <?php echo $attribute['text']; ?>

                      <?php } ?>

                   <?php } ?>
              <?php } ?>

How can I exclude the output of certain attributes by ID or group?
Can. who faced

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
azaza, 2019-10-16
@natojezlo

found

<?php if ($attribute_groups) { ?>
  <div class="tab-pane" id="tab-specification">
    <table class="table table-bordered">
    <?php foreach ($attribute_groups as $attribute_group) { ?>
      <?php if($attribute_group['attribute_group_id'] != 'id группы'){ ?>
        <thead>
          <tr>
            <td colspan="2"><strong><?php echo $attribute_group['name']; ?></strong></td>
          </tr>
        </thead>
        <tbody>
          <?php foreach ($attribute_group['attribute'] as $attribute) { ?>
            <tr>
              <td><?php echo $attribute['name']; ?></td>
              <td><?php echo $attribute['text']; ?></td>
            </tr>
          <?php } ?>
        </tbody>
        <?php } ?>
      <?php } ?>
    </table>
  </div>
<?php } ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question