A
A
Andrey Nikiforov2016-08-20 10:12:16
PHP
Andrey Nikiforov, 2016-08-20 10:12:16

Opencart, fucking attributes?

There is no code that outputs

<?php if($product['attribute_groups']) { ?>						
        							<table class="responsive">

                  <?php foreach($product['attribute_groups'] as $attribute_group) { ?>
          <thead>
          <tr>
            <th><?php echo $attribute['name']; ?></th>
          </tr>
          </thead>
          <?php foreach($attribute_group['attribute'] as $attribute) { ?>
          <tbody>
          <tr>
            <td><?php echo $attribute['text']; ?></td>
          </tr>	
<?php } ?>					
          </tbody>
          <?php } ?>
            </table>
          <?php } ?>

The attributes are a table, but somewhere there is an error, either in a loop, or I don’t know, it
refers to an error with a line
<th><?php echo $attribute['name']; ?></th>
, but if you pick up the code, then the error is already on another line and name works, somehow it was possible to run the code, but there was a lot of confusion with the table, everything is crooked, I ask for help from the labor coders)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Zubkov, 2016-08-20
@zubkov_work

And why do you have the $attribute variable located above the place where it is defined, do it like this:

<?php if($product['attribute_groups']) { ?>						
        							<table class="responsive">

                  <?php foreach($product['attribute_groups'] as $attribute_group) { ?>

          <?php foreach($attribute_group['attribute'] as $attribute) { ?>
          <thead>
          <tr>
            <th><?php echo $attribute['name']; ?></th>
          </tr>
          </thead>
          <tbody>
          <tr>
            <td><?php echo $attribute['text']; ?></td>
          </tr>	
<?php } ?>					
          </tbody>
          <?php } ?>
            </table>
          <?php } ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question